linux 启动nacos报错_linux下nacos的1.1.3版本集群部署

windows单机版参见0.9.0.RELEASE版本的spring cloud alibaba nacos实例 ,linux集群版我们还是用上次下载的nacos安装包,通过rz -y上传到wlf用户下soft目录,执行解压命令报错了:

$ unzip nacos-server-1.1.3.zip

Archive: nacos-server-1.1.3.zip

End-of-central-directory signature not found. Either this file isnot

a zipfile, or it constitutes one disk of a multi-part archive. In the

lattercasethe central directory and zipfile comment will be found on

the last disk(s) ofthisarchive.

unzip: cannot find zipfile directoryin one of nacos-server-1.1.3.zip or

nacos-server-1.1.3.zip.zip, and cannot find nacos-server-1.1.3.zip.ZIP, period.

看说明应该是这个压缩包有问题,但之前我们在windows下解压是ok的,重新压缩下我们解压过的nacos目录,发现压缩包的大小不一样了:

原来应该是采用了某种压缩算法,原来43M变成了14M。重现上传nacos.zip到wlf的soft目录下,这次解压成功。

接下来就要修改配置文件了。nacos集群至少3个节点,我们把分别部署3台机器10.110.11.1、10.110.11.2和10.110.11.3。下面用10.110.11.1举例,其他两个节点亦然。

先复制conf配置文件:

$ cp cluster.conf.example cluster.conf

配置集群配置文件,用vi修改cluster.conf为:

10.100.11.1:8848

10.100.11.2:8848

10.100.11.3:8848

再配置mysql数据库,修改application.properties,新增标黄配置:

# 存在多网卡情况可以指定某一个网卡,比如有192.172.11.1和10.100.11.1,我们可以指定10的

nacos.inetutils.ip-address=10.100.11.1# mysql配置

db.num=1db.url.0=jdbc:mysql://192.168.111.1:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true

db.user=wlf

db.password=123456# spring

server.contextPath=/nacos

server.servlet.contextPath=/nacos

server.port=8848# nacos.cmdb.dumpTaskInterval=3600# nacos.cmdb.eventTaskInterval=10# nacos.cmdb.labelTaskInterval=300# nacos.cmdb.loadDataAtStart=false# metricsforprometheus

#management.endpoints.web.exposure.include=*# metricsforelastic search

management.metrics.export.elastic.enabled=false#management.metrics.export.elastic.host=http://localhost:9200

# metricsforinflux

management.metrics.export.influx.enabled=false#management.metrics.export.influx.db=springboot

#management.metrics.export.influx.uri=http://localhost:8086

#management.metrics.export.influx.auto-create-db=true#management.metrics.export.influx.consistency=one

#management.metrics.export.influx.compressed=trueserver.tomcat.accesslog.enabled=trueserver.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i

#defaultcurrent work dir

server.tomcat.basedir=## spring security config

### turn off security

#spring.security.enabled=false#management.security=false#security.basic.enabled=false#nacos.security.ignore.urls=/**

nacos.security.ignore.urls=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health/**,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**,/v1/console/server/**

# nacos.naming.distro.taskDispatchPeriod=200

# nacos.naming.distro.batchSyncKeyCount=1000

# nacos.naming.distro.syncRetryDelay=5000

# nacos.naming.data.warmup=true

# nacos.naming.expireInstance=true

如果有多个mysql数据库,修改db.num,假如有2个:

db.num=2db.url.0=jdbc:mysql://11.162.196.16:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true

db.url.1=jdbc:mysql://11.163.152.9:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true

db.user=nacos_devtest

db.password=nacos

以上搞完后就可以起节点了,启动命令不带参数:

$ sh startup.sh

原文:https://www.cnblogs.com/wuxun1997/p/11543343.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值