1.部署JDK(采用的是rpm包安装,安装在默认位置,自动配置环境变量,脚本默认去该目录找JAVA)
rpm -ivh jdk-8u221-linux-x64.rpm
配置JAVA_HOMM
export JAVA_HOME=/usr/java/latest
2.配置hosts映射(cdh11是主节点)
vi /etc/hosts
在文件末尾追加配置
192.168.11.11 cdh11
192.168.11.12 cdh12
192.168.11.13 cdh13
3.禁用SELinux
vi /etc/selinux/config
修改SELINUX=disabled
4.关闭防火墙,禁止开机启动
service iptables stop
chkconfig iptables off
5.设置SWAP 末尾增加1行(vm.swappiness = 10)
vi /etc/sysctl.conf
vm.swappiness = 10
6. 检查是否生效
sysctl -p
7. 关闭透明大页面
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
echo never >/sys/kernel/mm/redhat_transparent_hugepage/enabled
所有节点 /etc/rc.d/rc.local脚本中增加如下代码,使其永久生效
if test -f/sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
fi
赋予权限
chmod +x /etc/rc.d/rc.local