rancher2+docker+SpringCloud+jenkins+redis集群+mysql主从搭建:一.环境部署规划说明
三台虚拟机
192.168.109.137 3.5G 2核 20G
192.168.109.138 2.5G 2核 20G
192.168.109.139 2.5G 2核 20G
这里是演示三台防护墙全关闭了,如果开启相应服务开放防火墙端口配置
137:(1.docker私有仓库 2.jenkins镜像 3.存储卷 4.rancher容器管理 5.k8s容器编排)
138:[1.业务模块(eureka01 config01 zuul01 oauth01 client01 mysql01 redis01)]
139:[1.业务模块(eureka02 config02 zuul02 oauth02 client02 mysql02 redis02 redis03)]
修改主机名:
hostnamectl set-hostname 137
hostnamectl set-hostname 138
hostnamectl set-hostname 139
服务器时间同步:
安装时间同步插件:
https://blog.csdn.net/vah101/article/details/91868147
yum install -y ntp ntpdate
之后,选择一台服务作为 ntp 时间服务器,修改/etc/ntp.conf文件,删除:
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
改为
server ntp3.aliyun.com iburst
另外,原始文件中有一行为如下内容:
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
去掉#打开注释,并将其ip修改服务器所在网段,比如服务器的ip地址为192.168.210.101,则该项改为:
restrict 192.168.109.2 mask 255.255.255.0 nomodify notrap
在集群中的其他服务器上,也要修改此文件,删除掉:
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
加入:
server 192.168.109.137 prefer
保存后退出,在集群中的所有服务器上执行如下命令:
service ntpd restart
systemctl disable chronyd.service
chkconfig --level 345 ntpd on
之后,在集群中192.168.109.137以外的服务器上执行:
ntpq -p
浙公网安备 33010602011771号