CentOS Docker容器中安装LVS负载均衡(一) ipvsadm

前端之家收集整理的这篇文章主要介绍了CentOS Docker容器中安装LVS负载均衡(一) ipvsadm前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

安装环境:

Docker容器和宿主机都是CentOS 7.3版本


1. Docker容器内安装ipvsadm

yum install -y ipvsadm
# enable IP forward
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf 

sysctl -p
touch /etc/sysconfig/ipvsadm 
systemctl start ipvsadm 
systemctl enable ipvsadm 

2. Docker宿主机上安装ipvsadm
yum install -y ipvsadm

否则容器内运行ipvsadm会出现如下错误

Can't initialize ipvs: Protocol not available

Are you sure that IP Virtual Server is built in the kernel or as module?

猜你在找的CentOS相关文章