1、下载
Releases · alibaba/nacos · GitHub
通过上传工具将下载好的压缩包放到Linux服务中
2、解压
[root@localhost opt]# tar -zxvf nacos-server-2.2.2.tar.gz
[root@localhost opt]# cd nacos
[root@localhost nacos]# ll
total 44
drwxr-xr-x 5 root root 4096 Apr 11 18:03 bin
drwxr-xr-x 2 502 games 4096 Apr 6 17:28 conf
drwxr-xr-x 5 root root 4096 Apr 11 18:03 data
-rw-r--r-- 1 502 games 16583 Mar 6 17:48 LICENSE
drwxr-xr-x 2 root root 4096 Apr 12 00:19 logs
-rw-r--r-- 1 502 games 1305 May 14 2020 NOTICE
drwxr-xr-x 2 root root 4096 Apr 11 17:58 target
3、单机启动
进入 bin 目录,输入以下命令后台启动
[root@localhost bin]# sh startup.sh -m standalone
/opt/jdk1.8.0_361/bin/java -Djava.ext.dirs=/opt/jdk1.8.0_361/jre/lib/ext:/opt/jdk1.8.0_361/lib/ext -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Xloggc:/opt/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/opt/nacos/plugins,/opt/nacos/plugins/health,/opt/nacos/plugins/cmdb,/opt/nacos/plugins/selector -Dnacos.home=/opt/nacos -jar /opt/nacos/target/nacos-server.jar --spring.config.additional-location=file:/opt/nacos/conf/ --logging.config=/opt/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
nacos is starting with standalone
nacos is starting,you can check the /opt/nacos/logs/start.out
可查看启动日志
[root@localhost bin]# cat /opt/nacos/logs/start.out
/opt/jdk1.8.0_361/bin/java -Djava.ext.dirs=/opt/jdk1.8.0_361/jre/lib/ext:/opt/jdk1.8.0_361/lib/ext -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Xloggc:/opt/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/opt/nacos/plugins,/opt/nacos/plugins/health,/opt/nacos/plugins/cmdb,/opt/nacos/plugins/selector -Dnacos.home=/opt/nacos -jar /opt/nacos/target/nacos-server.jar --spring.config.additional-location=file:/opt/nacos/conf/ --logging.config=/opt/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
,--.
,--.'|
,--,: : | Nacos 2.2.2
,`--.'`| ' : ,---. Running in stand alone mode, All function modules
| : : | | ' ,'\ .--.--. Port: 8848
: | \ | : ,--.--. ,---. / / | / / ' Pid: 20748
| : ' '; | / \ / \. ; ,. :| : /`./ Console: http://[ip]:8848/nacos/index.html
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
| | | \ | \__\/: . .. ' / ' | .; : \ \ `. https://nacos.io
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' / / ,. |' | '.'|\ \ / / /`--' /
' : | ; : .' \ : : `----' '--'. /
; |.' | , .-./\ \ / `--'---'
'---' `--`---' `----'
2023-04-12 09:26:20,883 INFO Tomcat initialized with port(s): 8848 (http)
2023-04-12 09:26:21,555 INFO Root WebApplicationContext: initialization completed in 9355 ms
4、关闭
sh shutdown.sh