Ambari安装Hadoop集群

时间:2022-12-24 20:00:40

* System Environment:centOS6.7

1.Prepare the Environment

  1)Set Up Password-less SSH : (Generate public and private SSH keys on the Ambari Server host.)

 cd ~
ssh-keygen

  will generate id_rsa  id_rsa.pub  under .ssh folder.

Do the below command on Ambari server:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys  

   Do command oneach target hosts:

 scp ~/.ssh/authorized_keys slave-1:/root/.ssh/
scp ~/.ssh/authorized_keys slave-2:/root/.ssh/

  Do command on each host(include Ambari server)

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

  From the Ambari Server, make sure you can connect to each host in the cluster using SSH, without having to enter a password. If the following warning message displays during your first connection:  Are you sure you want to continue

  connecting (yes/no)?  Enter  Yes .

  Ambari安装Hadoop集群 Note:It is possible to use a non-root SSH account, if that account can execute  sudowithout entering a password.

  2) Enable NTP on the Cluster and on the Browser Host

chkconfig --list ntpd
chkconfig ntpd on
service ntpd start

  3) Check DNS and NSCD

  3.1) HostName

  Add a line for each host in your cluster. The line should consist of the IP address and the FQDN

vi /etc/hosts

Ambari安装Hadoop集群

  Use the "hostname" command to set the hostname on each host in your cluster. Fo example:

Ambari安装Hadoop集群

  Confirm that the hostname is set by running the following command:

hostname -f

  This should return the <fully.qualified.domain.name> you just set. e.g:

Ambari安装Hadoop集群

  3.2)Edit the Network Configuration File

vi /etc/sysconfig/network

  Modify the HOSTNAME property to set the fully qualified domain name.

NETWORKING=yes
HOSTNAME=Master

Ambari安装Hadoop集群

  3.3)Configuring iptables

chkconfig iptables off
/etc/init.d/iptables stop

  3.4) Disable SELinux and PackageKit and check the umask Value

setenforce 
 vi /etc/selinux/config
vi /etc/yum/pluginconf.d/refresh-packagekit.conf

Ambari安装Hadoop集群

Ambari安装Hadoop集群

 umask
echo umask >> /etc/profile

Okay. Now .You finished the environment prepared.

Let's begin to install Ambari.

Step1: Download the Ambari repository on the Ambari Server host

cd /etc/yum.repos.d/
wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari.repo

Step 2: Install, Setup, and Start Ambari Server

yum install ambari-server
ambari-server setup
ambari-server start
Step 3: Deploy Cluster using Ambari Web UI 

Open up a web browser and go to http://<ambari-server-host>:8080.

相关参考:

1.安装ambari:

https://cwiki.apache.org/confluence/display/AMBARI/Install+Ambari+2.2.1+from+Public+Repositories

http://hortonworks.com/hdp/downloads/#hdf

http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.1.1/bk_ambari_reference_guide/content/index.html

2. 安装 agent问题 解决

http://blog.csdn.net/shiqidide/article/details/18361203

http://linux.it.net.cn/e/cluster/hadoop/2015/1007/17607.html

3.删除用户 等

http://geniuszhe.blog.163.com/blog/static/11934682013111984718679/

4.解决issue:

解决办法,在Linux下执行:

echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/defrag