centos7.2 haproxy安装及配置

 时间:2024-10-17 03:46:53

1、本机的操作系统为CentOS Linux release 7.2.1511 (Core) 64位

centos7.2 haproxy安装及配置

2、安装配置haproxy之前需要关闭系统selinux,将SELINUX设置位disabled

centos7.2 haproxy安装及配置

3、步骤2需要重启才能生效,所以我们这里先手动设置SELINUX[root@test-10-226 ~]# getenforceDisabled

centos7.2 haproxy安装及配置

4、我们这里不采用复杂的源代码编译的方式安装,而是使用yum install haproxy命令安装haproxy,可以很好的解决各种依赖关系

centos7.2 haproxy安装及配置

5、输入y并回车继续安装

centos7.2 haproxy安装及配置

6、出现已安装完毕并且没有报错的话表明haproxy安装成功

centos7.2 haproxy安装及配置

7、设置haproxy的自启动并启动haproxy服务,启动完成使用ps -ef查看进程[root@test-10-226 ~]# systemctl enable haproxy[root@test-10-226 ~]# systemctl start haproxy[root@test-10-226 ~]# ps -ef|grep haproxyroot 26672 1 0 01:06 ? 00:00:00 /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pidhaproxy 26673 26672 0 01:06 ? 00:00:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Dshaproxy 26674 26673 0 01:06 ? 00:00:10 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Dsroot 27681 27264 0 10:53 pts/2 00:00:00 grep --color=auto haproxy

centos7.2 haproxy安装及配置

8、上一步骤通过查看haproxy进程也可以发现haproxy的默认配置文件是/etc/haproxy/haproxy.cfg,用户可以根据自己的实际情况进行修改编辑

centos7.2 haproxy安装及配置
  • centos7安装maven教程
  • win7怎么配置自己的IIS服务器
  • linux系统中如何创建LVM逻辑卷管理器?
  • 虚拟机中兴新支点系统中安装使用VMtools工具
  • Linux非管理员用户无法登陆图形界面
  • 热门搜索
    三爱三节手抄报内容 我是文明小学生手抄报 寻根乡愁手抄报 关于五四运动的手抄报 黑白手抄报花边边框 三爱手抄报图片 手抄报边框设计 语文手抄报大全 我爱我家手抄报图片 五一节的手抄报