Centos7 yum -y install ipvadm 安装后,启动ipvsadm却报错。

Redirecting to /bin/systemctl start  ipvsadm.service
Job for ipvsadm.service failed because the control process exited with error code. See "systemctl status ipvsadm.service" and "journalctl -xe" for details.

看提示是要我查看服务状态

# systemctl status ipvsadm.service
● ipvsadm.service - Initialise the Linux Virtual Server
Loaded: loaded (/usr/lib/systemd/system/ipvsadm.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 三 -- :: CST; 12s ago
Process: ExecStart=/bin/bash -c exec /sbin/ipvsadm-restore < /etc/sysconfig/ipvsadm (code=exited, status=/FAILURE)
Main PID: (code=exited, status=/FAILURE) 6月 :: localhost.localdomain systemd[]: Starting Initialise the Linux Virtual Server...
6月 :: localhost.localdomain bash[]: /bin/bash: /etc/sysconfig/ipvsadm: 没有那个文件或目录
6月 :: localhost.localdomain systemd[]: ipvsadm.service: main process exited, code=exited, status=/FAILURE
6月 :: localhost.localdomain systemd[]: Failed to start Initialise the Linux Virtual Server.
6月 :: localhost.localdomain systemd[]: Unit ipvsadm.service entered failed state.
6月 :: localhost.localdomain systemd[]: ipvsadm.service failed.

提示没有

/etc/sysconfig/ipvsadm

网上查阅很多资料,说先save,可是并没有这个操作。

# service ipvsadm save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

最后还是看到个靠谱的解决方法,手动生成这个文件:

ipvsadm --save > /etc/sysconfig/ipvsadm

service ipvsadm start   ,启动OK。

附录(来源):ipvsadm命令选项解释:

-A --add-service    在内核的虚拟服务器表中添加一条新的虚拟服务器记录。也就是增加一台新的虚拟服务器。  
-E --edit-service      编辑内核虚拟服务器表中的一条虚拟服务器记录。  
-D --delete-service  删除内核虚拟服务器表中的一条虚拟服务器记录。  
-C --clear                 清除内核虚拟服务器表中的所有记录。  
-R --restore             恢复虚拟服务器规则  
-S --save                 保存虚拟服务器规则,输出为-R 选项可读的格式  
-a --add-server       在内核虚拟服务器表的一条记录里添加一条新的真实服务器记录。也就是在一个虚拟服务器中增加一台新的真实服务器  
-e --edit-server       编辑一条虚拟服务器记录中的某条真实服务器记录  
-d --delete-server    删除一条虚拟服务器记录中的某条真实服务器记录  
-L|-l --list                  显示内核虚拟服务器表  
-Z --zero                  虚拟服务表计数器清零(清空当前的连接数量等)  
--set tcp tcpfin udp  设置连接超时值  
--start-daemon        启动同步守护进程。他后面可以是master 或backup,用来说明LVS Router 是master 或是backup。在这个功能上也可以采用keepalived的VRRP 功能。  
--stop-daemon        停止同步守护进程  
-h --help                  显示帮助信息  
其他的选项:  
-t --tcp-service service-address        说明虚拟服务器提供的是tcp 的服务[vip:port] or [real-server-ip:port]  
-u --udp-service service-address      说明虚拟服务器提供的是udp 的服务[vip:port] or [real-server-ip:port]  
-f --fwmark-service fwmark               说明是经过iptables 标记过的服务类型。  
-s --scheduler scheduler                   使用的调度算法,有这样几个选项rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq,默认的调度算法是: wlc.  
-p --persistent [timeout]                   持久稳固的服务。这个选项的意思是来自同一个客户的多次请求,将被同一台真实的服务器处理。timeout 的默认值为300 秒。  
-M --netmask                                    netmask persistent granularity mask  
-r --real-server server-address         真实的服务器[Real-Server:port]  
-g --gatewaying                                指定LVS 的工作模式为直接路由模式(也是LVS 默认的模式)  
-i --ipip                                              指定LVS 的工作模式为隧道模式  
-m --masquerading                           指定LVS 的工作模式为NAT 模式  
-w --weight weight                           真实服务器的权值  
--mcast-interface interface              指定组播的同步接口  
-c --connection                                  显示LVS 目前的连接 如:ipvsadm -L -c  
--timeout                                        显示tcp tcpfin udp 的timeout 值 如:ipvsadm -L --timeout  
--daemon                                          显示同步守护进程状态  
--stats                                              显示统计信息  
--rate                                                显示速率信息  
--sort                                                对虚拟服务器和真实服务器排序输出  
--numeric -n                                      输出IP 地址和端口的数字形式

最新文章

  1. vim编辑器的使用
  2. GPS模块数据放入谷歌地图显示,不准
  3. PHP绘图
  4. UVa 101 - The Blocks Problem(积木问题,指令操作)
  5. MySQL(六) —— 运算符和函数
  6. bzoj2119
  7. Python基本程序结构
  8. SQLite查询优化性能要点
  9. South入门教程
  10. Intersecting Lines(数学)
  11. 天气正好,hello world!
  12. .8-Vue源码之AST(4)
  13. Mixed Reality-宁波市VR/AR技术应用高研班总结
  14. Redis详解(一)------ redis的简介与安装
  15. Python使用Xpath轻松爬虫(脑残式)
  16. python入门(十):模块、包
  17. OpenCV Mat格式存储YUV图像
  18. Unity应用架构设计(6)——设计动态数据集合ObservableList
  19. es的返回数据结构
  20. memset()函数

热门文章

  1. Mysql和oracle字段类型与java对象类型对应表收藏
  2. AspNet Zero Core
  3. Java基础语法(自定义类、ArrayList集合)
  4. 《移动Web前端高效开发实战》笔记2——使用Gulp构建一个ECMAScript 6和Sass应用
  5. Vue的computed和methods区别
  6. IOS使用固定定位遇到的问题
  7. Windows计算机重置TCP / IP
  8. Python2和Python3语法区别
  9. less的使用总结
  10. Uva 10635 Prince and Princess (LCS变形LIS)