# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
如果重启系统,就会发现SELinux的状态变成disabled
5. 关闭linux内核huge_page:
Add the following lines in /etc/rc.local and reboot the server: echo never > /sys/kernel/mm/RedHat_transparent_hugepage/enabled echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
6. 安装java,配置JAVA_HOME
mkdir /usr/java
cd/usr/java
rz-be
/usr/java/jdk1.7.0_75
ln -s /usr/java/jdk1.7.0_75 /usr/java/default
vim/etc/profile
route add default gw172.28.0.1
export JAVA_HOME=/usr/java/default
export PATH=$JAVA_HOME/bin:$PATH
编辑好/etc/profile,执行source /etc/profile使配置生效,保证每一台机器上的java版本都是一致的,并且JAVA_HOME环境变量是有效的:
7. 每台机器上安装ntpd
rpm -aq | grep ntpd yum install ntpd chkconfig ntpd on service ntpd start
确保每台机器的ntpd服务都处于运行状态:
8. 确保机器上安装了openssh-server,并且升级openssl到最新:
rpm -qa | grep ssh yum install openssh-server service sshd restart chkconfig sshd on
确保openssl最新:
yum install openssl-devel-1.0.1e-42.el6.x86_64
9. yum源确保可以用,本次安装采用了163的yum源,先将/etc/yum.repos.d/中,所有的文件都删掉,然后新建文件CentOS6-Base-163.repo,填入如下内容:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use thisfor CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib- packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
配置ambari的yum源,本配置源是部署在本地局域网中的一台apache服务器上的: