2021-05-23

[root@centos01 ~]# vim /etc/yum.repos.d/local.repo
[root@centos01 ~]# rm -rf /etc/yum.repos.d/CentOS-*
[root@centos01 ~]# mount /dev/cdrom /mnt/
[root@centos01 ~]# yum -y install httpd2021-05-23
[root@centos01 ~]#echo “www.benet.com” > /var/www/html/index.html
[root@centos01 ~]#systemctl start httpd
[root@centos01 ~]#systemctl enable httpd
[root@centos01 ~]#echo “www.accp.com” > /var/www/html/index.html
[root@centos01 ~]#systemctl start httpd
[root@centos01 ~]#systemctl enable httpd
安装lvs和keepalived:
[root@centos04 ~]# vim /etc/yum.repos.d/local.repo
[root@centos04 ~]# rm -rf /etc/yum.repos.d/CentOS-*
[root@centos04 ~]# mount /dev/cdrom /mnt/
[root@centos04 ~]# yum -y install ipvsadm keepalived
设置服务开机自动启动:
[root@centos04 ~]# systemctl enable ipvsadm
[root@centos04 ~]# systemctl enable keepalived
[root@centos05 ~]# vim /etc/yum.repos.d/local.repo
[root@centos05 ~]# rm -rf /etc/yum.repos.d/CentOS-*
[root@centos05 ~]# mount /dev/cdrom /mnt/
[root@centos05 ~]# yum -y install keepalived ipvsadm
[root@centos05 ~]#systemctl enable keepalived
[root@centos05 ~]systemctl enable keepalived
[root@centos05 ~]systemctl enable ipvsadm
修改keepalived主配置文件 :
[root@centos04 ~]# vim /etc/keepalived/keepalived.conf
2021-05-23
2021-05-23
2021-05-23
修改LVS服务器内核参数禁止相应客户端请求:
[root@centos04 ~]# vim /etc/sysctl.conf
[root@centos04 ~]#sysctl -p
修改网站内核参数运行相应客户端请求 :
[root@centos01 ~]# vim /etc/sysctl.conf
[root@centos04 ~]#sysctl -p
启动服务:
[root@centos04 ~]# systemctl start keepalived
2021-05-23
[root@centos04 ~]#systemctl stop keepalived
2021-05-23
2021-05-23
[root@centos03 ~]# rm -rf /etc/yum.repos.d/CentOS-*
[root@centos03 ~]# mount /dev/cdrom /mnt/
[root@centos03 ~]# yum -y install rpcbind nfs-utils
[root@centos03 ~]# mkdir /web
[root@centos03 ~]# echo “www.nfs.com” > /web/inex.html
[root@centos03 ~]# vim /etc/exports
[root@centos03 ~]#systemctl restart rpcbind
[root@centos03 ~]#systemctl restart nfs
[root@centos03 ~]#systemctl enable nfs
[root@centos03 ~]#systemctl enable rpcbind
[root@centos03 ~]#systemctl enable rpcbind
[root@centos03 ~]#showmount -e 192.168.100.302021-05-23

上一篇:keepalived实现nginx负载均衡机高可用


下一篇:技术/方案实现目录