ipvsadm启动报错解决方法
2024-09-02 01:35:56
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 地址和端口的数字形式
最新文章
- vim编辑器的使用
- GPS模块数据放入谷歌地图显示,不准
- PHP绘图
- UVa 101 - The Blocks Problem(积木问题,指令操作)
- MySQL(六) —— 运算符和函数
- bzoj2119
- Python基本程序结构
- SQLite查询优化性能要点
- South入门教程
- Intersecting Lines(数学)
- 天气正好,hello world!
- .8-Vue源码之AST(4)
- Mixed Reality-宁波市VR/AR技术应用高研班总结
- Redis详解(一)------ redis的简介与安装
- Python使用Xpath轻松爬虫(脑残式)
- python入门(十):模块、包
- OpenCV Mat格式存储YUV图像
- Unity应用架构设计(6)——设计动态数据集合ObservableList
- es的返回数据结构
- memset()函数