spring cloud nacos
# 解压nacos安装包
# tar -zvxf nacos-server-1.4.1.tar.gz
# nacos默认是以集群的模式启动,此处先用单机模式
# cd /usr/local/mysoft/nacos/bin
# sh startup.sh -m standalone
# nacos 日志
# tail -f /usr/local/mysoft/nacos/log/nacos.log
# 本地连接,需关闭防火墙
- 查看防火墙状态:
# systemctl status firewalld.service
- 关闭防火墙:
# systemctl stop firewalld.service
- 关闭防火墙:
# systemctl start firewalld.service
修改nacos数据源为mysql
在MySQL中新建shemal为nacos 将nacos脚本执行,解压nacos包,在MySQL中执行脚本nacos-mysql.sql执行
# vim nacos/conf/application.properties
nacos 集群配置
基于原来nacos目录复制三个,分别为nacos1,nacos2,nacos3
# cp -r nacos nacos1
# cp -r nacos nacos2
# cp -r nacos nacos3
修改nacos端口 分别为8845,8846,8847
# vim nacos1/conf/application.properties ---8845
# vim nacos3/conf/application.properties ---8846
# vim nacos3/conf/application.properties ---8847
# mv nacos1/conf/cluster.conf.example nacos1/conf/cluster.conf
# mv nacos2/conf/cluster.conf.example nacos2/conf/cluster.conf
# mv nacos3/conf/cluster.conf.example nacos3/conf/cluster.conf
# cd /usr/local/mysoft
# ./nacos1/bin/startup.sh
# ./nacos2/bin/startup.sh
# ./nacos3/bin/startup.sh
- 浏览器访问
192.168.126.66:8845/nacos
192.168.126.66:8846/nacos
192.168.126.66:8847/nacos
naginx下载地址:http://nginx.org/en/download.html
安装gcc的环境
# yum install gcc-c++
上传nginx包到linux进行解压
# cd /usr/local/mysoft
# tar -zvxf nginx-1.16.1.tar.gz
# mv nginx-1.16.1 nginx
# 添加/修改如下配置
upstream nacos-server {
server 192.168.110.66:8845;
server 192.168.110.66:8846;
server 192.168.110.66:8847;
}
location /nacos/ {
proxy_pass http://nacos-server/nacos/
}