开发者

win10上安装nginx的方法步骤

开发者 https://www.devze.com 2020-01-10 01:26 出处:网络 作者: 不死的鱼
这篇文章主要介绍了win10上安装nginx的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

三、安装、配置keepalived(主节点)

3.1:安装keepalived(01、02、03节点)

yum install -y keepalived

systemctl enable keepalived

node01的keepalived.conf

cat <<EOF > /etc/keepalived/keepalived.conf

global_defs {

router_id LVS_k8s

}

vrrp_script CheckK8sMaster {

script "curl -k https://10.8.1.105:6443"

interval 3

timeout 9

fall 2

rise 2

}

vrrp_instance VI_1 {

state MASTER

interface ens3

virtual_router_id 61

priority 100

advert_int 1

mcast_src_ip 10.8.1.101

nopreempt

authentication {

auth_type PASS

auth_pass sqP05dQgMSlzrxHj

}

unicast_peer {

10.8.1.102

10.8.1.103

}

virtual_ipaddress {

10.8.1.105/24

}

track_script {

CheckK8sMaster

}

}

EOF

node02的keepalived.conf

cat <<EOF > /etc/keepalived/keepalived.conf

global_defs {

router_id LVS_k8s

}

global_defs {

router_id LVS_k8s

}

vrrp_script CheckK8sMaster {

script "curl -k https://10.8.1.105:6443"

interval 3

timeout 9

fall 2

rise 2

}

vrrp_instance VI_1 {

state BACKUP

interface ens3

virtual_router_id 61

priority 90

advert_int 1

mcast_src_ip 10.8.1.102

nopreempt

authentication {

auth_type PASS

auth_pass sqP05dQgMSlzrxHj

}

unicast_peer {

10.8.1.101

10.8.1.103

}

virtual_ipaddress {

10.8.1.105/24

}

track_script {

CheckK8sMaster

}

}

EOF

node03的keepalived.conf

cat <<EOF > /etc/keepalived/keepalived.conf

global_defs {

router_id LVS_k8s

}

global_defs {

router_id LVS_k8s

}

vrrp_script CheckK8sMaster {

script "curl -k https://10.8.1.105:6443"

interval 3

timeout 9

fall 2

rise 2

}

vrrp_instance VI_1 {

state BACKUP

interface ens3

virtual_router_id 61

priority 80

advert_int 1

mcast_src_ip 10.8.1.103

nopreempt

authentication {

auth_type PASS

auth_pass sqP05dQgMSlzrxHj

}

unicast_peer {

10.8.1.101

10.8.1.102

}

virtual_ipaddress {

10.8.1.105/24

}

track_script {

CheckK8sMaster

}

}

EOF

3.2:启动keepalived

systemctl restart keepalived

可以看到虚拟IP已经绑定到node01的网卡上了

win10上安装nginx的方法步骤

提示:键盘也能翻页,试试"← →"键
0

精彩评论

暂无评论...
验证码 换一张
取 消