当前位置: 代码迷 >> 综合 >> Nacos 记录1 - 下载安装
  详细解决方案

Nacos 记录1 - 下载安装

热度:49   发布时间:2024-02-01 11:23:03.0

1. 下载及解压

https://github.com/alibaba/nacos/releases

[cdh@r123m ~]$ tar -zxvf nacos-server-1.3.1.tar.gz  -C /usr/local/soft/[cdh@r123m nacos]$ pwd
/usr/local/soft/nacos[cdh@r123m nacos]$ ls
bin  conf  data  LICENSE  logs  NOTICE  target  work

2. 配置文件

[cdh@r123m nacos]$ cat conf/application.properties
...#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql### Count of DB:
db.num=1### Connect URL of DB:
db.url.0=jdbc:mysql://r123m:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user=root
db.password=123123
...

3. 配置mysql

# 配置数据库
mysql> create database nacos;#初始化
mysql> source /usr/local/soft/nacos/conf/nacos-mysql.sql

4. 启动

[cdh@r123m nacos]$ bin/startup.sh -m standalone
/usr/java/jdk1.8.0_181/bin/java  -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Djava.ext.dirs=/usr/java/jdk1.8.0_181/jre/lib/ext:/usr/java/jdk1.8.0_181/lib/ext -Xloggc:/usr/local/soft/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/usr/local/soft/nacos/plugins/health,/usr/local/soft/nacos/plugins/cmdb -Dnacos.home=/usr/local/soft/nacos -jar /usr/local/soft/nacos/target/nacos-server.jar  --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/usr/local/soft/nacos/conf/ --logging.config=/usr/local/soft/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
nacos is starting with standalone
nacos is starting,you can check the /usr/local/soft/nacos/logs/start.out

5. 查看日志

[cdh@r123m nacos]$ tail -f logs/nacos.log 
...
2020-07-26 17:59:55,658 INFO Nacos started successfully in stand alone mode. use external storage...

6. UI页面

 

 

 

 

  相关解决方案