主机名 | 角色 | IP地址 |
mylinux1.contoso.com |
Haproxy | |
mylinux3.contoso.com | ssh server(做tcp实验用) | eth0:192.168.100.181 |
mylinux4.contoso.com | ssh server(做tcp实验用) | eth1:192.168.100.182 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#检查防火墙
[root@mylinux1~]
#iptables-L-n
ChainINPUT(policyACCEPT)
targetprotopt
source
destination
ChainFORWARD(policyACCEPT)
destination
ChainOUTPUT(policyACCEPT)
destination
#检查SELinux
#getenforce
Disabled
#检查时间同步
#crontab-l
0****
/usr/sbin/ntpdate
210.72.145.4464.147.116.229
time
.nist.gov
#设置yum源
mkdir
-p
/etc/yum
.repos.d
/bak
mv
.repos.d/*.*
/bak/
wget-O
/CentOS-Base
.repohttp:
//mirrors
.aliyun.com
/repo/Centos-6
.repo
yumcleanall
yummakecache
#设置主机名
sed
-i
'/^HOSTNAME/s/^/#/'
/etc/sysconfig/network
'/#HOSTNAME/aHOSTNAME=[主机名]'
/etc/sysconfig/network
hostname
[主机名]
|
#mkdir-p/opt/tools
#cd/opt/tools/
[root@mylinux1tools]
#ll
total2608
#tar-zxfhaproxy-1.5.18.tar.gz
#cdhaproxy-1.5.18
[root@mylinux1haproxy-1.5.18]
#ls
CHANGELOGCONTRIBUTINGebtreeincludeMakefileROADMAPSUBVERSVERDATE
contribdocexamplesLICENSEREADMEsrctestsVERSION
#mkdir-p/usr/local/haproxy
#makeTARGET=linux26ARCH=x86_64PREFIX=/usr/local/haproxy/
#makeinstallPREFIX=/usr/local/haproxy
#cd/usr/local/haproxy/
[root@mylinux1haproxy]
#tree
├──doc
│└──haproxy
│├──architecture.txt
│├──configuration.txt
│├──haproxy-en.txt
│└──haproxy-fr.txt
├──sbin
│└──haproxy
└──share
└──
man
└──man1
└──haproxy.1
6directories,6files
#cpexamples/haproxy.cfg/usr/local/haproxy/conf/