172.20.4.156 node1
172.20.4.157 node2
172.20.4.158 node3
#更改主机名和hosts
hostname node1
hostname node2
hostname node3
vi /etc/hosts
#关闭防火墙
service iptables status
关闭防火墙-----service iptables stop
重启防火墙-----service iptables restart
查看防火墙状态--service iptables status
永久关闭防火墙--chkconfig iptables off
#关闭SELINUX 重启服务器使hostname和selinux的配置生效
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
reboot
#检查hostname和selinux的配置
cat /etc/hosts &&
hostname &&
getenforce &&
sestatus -v
安装NPT服务
yum -y install ntp
service ntpd start&&
service ntpd enable&&
service ntpd status
chkconfig ntpd on
安装上次下载工具lrzsz
yum install lrzsz
#安装依赖包
yum -y install psmisc &&
yum -y install psmisc MySQL-python at bc bind-libs bind-utils cups-client cups-libs cyrus-sasl-gssapi cyrus-sasl-plain
ed fuse fuse-libs httpd httpd-tools keyutils-libs-devel krb5-devel libcom_err-devel libselinux-devel libsepol-devel
libverto-devel mailcap noarch mailx mod_ssl openssl-devel pcre-devel postgresql-libs python-psycopg2 redhat-lsb-core
redhat-lsb-submod-security x86_64 spax time zlib-devel &&
chmod +x /etc/rc.d/rc.local &&
echo "echo 0 > /proc/sys/vm/swappiness" >>/etc/rc.d/rc.local &&
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" >>/etc/rc.d/rc.local &&
echo 0 > /proc/sys/vm/swappiness &&
echo never > /sys/kernel/mm/transparent_hugepage/defrag &&
yum -y install rpcbind &&
service rpcbind start &&
echo "service rpcbind start" >> /etc/rc.d/rc.local