【01】微服务系列之 Nacos 安装部署

微服务系列之 Nacos 安装部署

前言

Nacos 版本:2.3.2

JDK 版本:jdk1.8.0_131

Linux 操作系统版本:Red Hat Enterprise Linux Server 7.5 (Maipo)

部署

下载

Nacos 资源从官网 https://nacos.io/docs/

或者直接访问下载地址

解压文件

将资源下载到服务的 /soft 文件夹中,然后进行解压到 /u01/app/ 文件夹中。

shell 复制代码
# 创建文件夹
mkdir /soft
mkdir -p /u01/app

# 将文件上传到 /soft 文件夹中

# 将压缩包解压至 /u01/app 文件夹中 
unzip /soft/nacos-server-2.3.2.zip -d /u01/app/
 
  • 参考日志
shell 复制代码
[root@wgqdevun01 soft]# unzip /soft/nacos-server-2.3.2.zip -d /u01/app/
Archive:  /soft/nacos-server-2.3.2.zip
   creating: /u01/app/nacos/
   creating: /u01/app/nacos/target/
   creating: /u01/app/nacos/conf/
   creating: /u01/app/nacos/bin/
  inflating: /u01/app/nacos/LICENSE  
  inflating: /u01/app/nacos/bin/startup.sh  
  inflating: /u01/app/nacos/NOTICE   
  inflating: /u01/app/nacos/conf/application.properties  
  inflating: /u01/app/nacos/target/nacos-server.jar  
  inflating: /u01/app/nacos/conf/announcement_zh-CN.conf  
  inflating: /u01/app/nacos/bin/shutdown.cmd  
  inflating: /u01/app/nacos/conf/1.4.0-ipv6_support-update.sql  
  inflating: /u01/app/nacos/bin/shutdown.sh  
  inflating: /u01/app/nacos/conf/derby-schema.sql  
  inflating: /u01/app/nacos/bin/startup.cmd  
  inflating: /u01/app/nacos/conf/application.properties.example  
  inflating: /u01/app/nacos/conf/nacos-logback.xml  
  inflating: /u01/app/nacos/conf/mysql-schema.sql  
  inflating: /u01/app/nacos/conf/console-guide.conf  
  inflating: /u01/app/nacos/conf/cluster.conf.example  
  inflating: /u01/app/nacos/conf/announcement_en-US.conf  
[root@wgqdevun01 soft]# 

启动 nacos

shell 复制代码
# 进入到解压后的目录中,执行启动命令.
cd /u01/app/nacos/bin
nohup sh startup.sh -m standalone & 
  • 参考日志:
shell 复制代码
[root@wgqdevun01 bin]# pwd
/u01/app/nacos/bin
[root@wgqdevun01 bin]# 
[root@wgqdevun01 bin]# nohup sh startup.sh -m standalone & 
[1] 11038
[root@wgqdevun01 bin]# nohup: ignoring input and appending output to 'nohup.out'

[1]+  Done                    nohup sh startup.sh -m standalone
[root@wgqdevun01 bin]# 

验证

  • 检查进程&默认端口(8848)是否存在
shell 复制代码
ps -ef | grep nacos
netstat -lnptu | grep -i 8848

参考日志:

shell 复制代码
[root@wgqdevun01 bin]# ps -ef | grep nacos
root      11058      1 10 04:55 pts/0    00:00:20 /usr/jdk1.8.0_131/bin/java -Djava.ext.dirs=/usr/jdk1.8.0_131/jre/lib/ext:/usr/jdk1.8.0_131/lib/ext -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -Xloggc:/u01/app/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/u01/app/nacos/plugins,/u01/app/nacos/plugins/health,/u01/app/nacos/plugins/cmdb,/u01/app/nacos/plugins/selector -Dnacos.home=/u01/app/nacos -jar /u01/app/nacos/target/nacos-server.jar --spring.config.additional-location=file:/u01/app/nacos/conf/ --logging.config=/u01/app/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288 nacos.nacos
root      11451   3565  0 04:58 pts/0    00:00:00 grep --color=auto nacos
[root@wgqdevun01 bin]# 
[root@wgqdevun01 bin]# 
[root@wgqdevun01 bin]# netstat -lnptu | grep -i 8848
tcp6       0      0 :::8848                 :::*                    LISTEN      11058/java          
[root@wgqdevun01 bin]# 

若有转载,请标明出处:https://blog.csdn.net/CharlesYuangc/article/details/157516746

相关推荐
兆子龙17 小时前
用 React + Remotion 做视频:入门与 AI 驱动生成
前端·架构
阿里云云原生18 小时前
阿里云获评 Agentic AI 开发平台领导者,函数计算 AgentRun 赢下关键分!
云原生
一枚前端小姐姐19 小时前
低代码平台表单设计系统技术分析(实战二)
低代码·架构·前端框架
爱勇宝19 小时前
2026年前端生存规划:只会写页面的人,正在被悄悄淘汰
前端·后端·架构
天蓝色的鱼鱼20 小时前
Node.js 中间层退潮:从“前端救星”到“成本噩梦”
前端·架构·node.js
codingWhat21 小时前
uniapp 多地区、多平台、多环境打包方案
前端·架构·node.js
RoyLin21 小时前
20 行代码,构建 Claude Code 核心能力
架构·agent
一枚前端小姐姐1 天前
低代码平台表单设计系统架构分析(实战一)
前端·低代码·架构
Mintopia1 天前
如何识别和拆解关键重要的业务问题:从“拍脑袋”到数据驱动的系统方法
架构
阿里云云原生1 天前
MSE Nacos Prompt 管理:让 AI Agent 的核心配置真正可治理
微服务·云原生