目录
两台服务器:一台部署rancher服务(用的阿里云4C8G),另一台起nginx容器做负载均衡(2C4G)
主机名 | ip |
rancher | 39.108.216.50 |
nginx | 39.108.222.169 |
修改主机名
hostnamectl set-hostname rancher/nginx
下载常用模块(也可以不用下)
- yum install -y lrzsz
- yum install -y net-tools
- yum install -y wget
- yum install -y vim-enhanced
- yum install -y bash-completion
- yum install -y git
- yum install -y telnet
- yum install -y telnet-server
关闭防火墙、selinux、交换分区
- ####全部建议永久关闭,避免重启后服务报错
- # 关闭防火墙
- systemctl stop firewalld && systemctl disable firewalld
- systemctl stop NetworkManager && systemctl disable NetworkManager
-
- # 关闭selinux
- sed -i 's/enforcing/disabled/' /etc/selinux/config # 永久
- setenforce 0 # 临时
-
- # 关闭swap
- swapoff -a # 临时
- sed -ri 's/.*swap.*/#&/' /etc/fstab # 永久
启动ipv4转发
- echo "
- # 需要加载br_netfilter内核模块,用于遍历bridge的数据