centos6.5 && ambari2.4.1.0安装Demo:
我的机器是本地搭的虚拟机(3台),由于电脑配置限制(8g),只能分给直节点2g,两从节点各1.5g;
1.先下载本地源(压缩包)
Ambari-2.4.1.0 压缩包地址:
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.1.0/ambari-2.4.1.0-centos7.tar.gz
http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.1.0/ambari-2.4.1.0-centos6.tar.gz
HDP-2.5.0.0压缩包地址:
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.0.0/HDP-2.5.0.0-centos7-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.5.0.0/HDP-2.5.0.0-centos6-rpm.tar.gz
HDP UTILS压缩包下载地址:
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos6/HDP-UTILS-1.1.0.21-centos6.tar.gz
其他版本,下载地址请参考:
Ambari:
http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.1.0/bk_ambari-installation/content/ambari_repositories.html
HDP和HDP UTILS:
http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.1.0/bk_ambari-installation/content/hdp_stack_repositories.html
2.改ip这块结合这个播客看,有详细介绍,我只不过是总结了下:http://blog.csdn.net/wanz2/article/details/52820876
配置静态IP:
静态IP地址配置主要用到以下三个文件:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network
/etc/resolv.conf
1).[root@ambari-server3 ~]# vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=ambari-server3
NTPSERVERARGS=iburst
GATEWAY=192.168.182.2
2).[root@ambari-server3 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=55d620df-ca54-4907-bac5-f8f6fb6bb2f1
ONBOOT=yes
NM_CONTROLLED=yes
HWADDR=00:0C:29:DD:52:B6
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
LAST_CONNECT=1515859956
#这几个除了dhcp改为static外,下面几个都是加上去的,这个因人而异
BOOTPROTO=static
IPADDR=192.168.182.132
NETMASK=255.255.255.0
GATEWAY=192.168.182.2
DNS1=192.168.182.2
DNS2=8.8.8.8
3).上一步配置完成后,系统会在/etc/resolv.conf文件中自动写入DNS服务器地址
[root@ambari-server3 ~]# more /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.182.2
nameserver 8.8.8.8
重启网络服务:
[root@ambari-server3 ~]# service network restart
正在关闭接口 eth0: 设备状态:3 (断开连接)
[确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/4 [确定]
打开ssh服务:
[root@ambari-server3 ~]# service sshd status
openssh-daemon (pid 1685) 正在运行...
[root@ambari-server3 ~]# service sshd start
[root@ambari-server3 ~]# chkconfig sshd on #设置开机运行ssh
[root@ambari-server3 ~]# chkconfig --list sshd
sshd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
这台节点就算完事了,有几台节点,就对应的改几次、
3.各三台机器做免密钥:
我这里ambari-server3是主节点:
1).先配置三台机器的hosts文件:三台都要做,一样的;
[root@ambari-server3 .ssh]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.182.130 ambari-server1
192.168.182.131 ambari-server2
192.168.182.132 ambari-server3
[root@ambari-server1 .ssh]# vim /etc/hosts
[root@ambari-server2 .ssh]# vim /etc/hosts
2).需求:准备安装ambari-server3(192.168.182.132)机器,需要到所有的机器都免密,包括本机。
在准备安装ambari-server3(192.168.182.132)的机器上生成秘钥
[root@ambari-server3 source]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
33:21:02:fd:00:3a:d8:61:97:25:55:83:64:19:bb:52 root@ambari-server3
The key's randomart image is:
+--[ RSA 2048]----+
| =oo=*=o |
|.+ ++oo. . |
|+ . .oE . |
| . o.o . |
| . . S |
| . o |
| |
| |
| |
+-----------------+
3).配置ambari-server3(192.168.182.132)机器到所有机器的免密
包括自己本身
ssh-copy-id root@192.168.182.130
ssh-copy-id root@192.168.182.131
ssh-copy-id root@192.168.182.132
[root@ambari-server3 .ssh]# ssh-copy-id root@192.168.182.130
root@192.168.182.130's password:
Now try logging into the machine, with "ssh 'root@192.168.182.130'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
Last login: Sun Jan 14 11:49:22 2018 from ambari-server3
[root@ambari-server1 ~]# hostname
ambari-server1
[root@ambari-server1 ~]# exit
logout
Connection to 192.168.182.130 closed.
[root@ambari-server3 .ssh]# hostname
ambari-server3
[root@ambari-server3 .ssh]# ssh-copy-id root@192.168.182.131
root@192.168.182.131's password:
Now try logging into the machine, with "ssh 'root@192.168.182.131'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@ambari-server3 .ssh]# ssh-copy-id root@192.168.182.132
The authenticity of host '192.168.182.132 (192.168.182.132)' can't be established.
RSA key fingerprint is ad:4f:3d:d2:02:6d:6f:5b:44:97:b7:a1:1c:e3:5e:ff.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.182.132' (RSA) to the list of known hosts.
root@192.168.182.132's password:
Now try logging into the machine, with "ssh 'root@192.168.182.132'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@ambari-server3 .ssh]# ssh 192.168.182.131
Last login: Sun Jan 14 11:51:14 2018 from ambari-server3
[root@ambari-server2 ~]# exit
logout
Connection to 192.168.182.131 closed.
[root@ambari-server3 .ssh]# ssh 192.168.182.132
Last login: Sun Jan 14 10:22:37 2018 from 192.168.182.1
[root@ambari-server3 ~]# exit
logout
Connection to 192.168.182.132 closed.
到这里主节点到各台子节点的面密就做完了
4.装ambari必须要的组件:jdk、mysql
1).jdk好装,就不做详细介绍了;
[root@ambari-server3 source]# rpm -qa | grep jdk
java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
[root@ambari-server3 source]# clear
[root@ambari-server3 source]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
[root@ambari-server3 source]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
[root@ambari-server3 source]# tar -zxvf jdk-8u73-linux-x64.gz -C /usr/java/
[root@ambari-server3 source]# vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_73
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
[root@ambari-server3 source]# source /etc/profile
[root@ambari-server3 source]# java -version
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
[root@ambari-s
我的机器是本地搭的虚拟机(3台),由于电脑配置限制(8g),只能分给直节点2g,两从节点各1.5g;
原文链接:http://blog.csdn.net/haoxiaoyan/article/details/72723270
本文综合借鉴了其他播客,整理出适合自己的这套ambari环境体系:1.先下载本地源(压缩包)
Ambari-2.4.1.0 压缩包地址:
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.1.0/ambari-2.4.1.0-centos7.tar.gz
http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.1.0/ambari-2.4.1.0-centos6.tar.gz
HDP-2.5.0.0压缩包地址:
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.0.0/HDP-2.5.0.0-centos7-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.5.0.0/HDP-2.5.0.0-centos6-rpm.tar.gz
HDP UTILS压缩包下载地址:
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos6/HDP-UTILS-1.1.0.21-centos6.tar.gz
其他版本,下载地址请参考:
Ambari:
http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.1.0/bk_ambari-installation/content/ambari_repositories.html
HDP和HDP UTILS:
http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.1.0/bk_ambari-installation/content/hdp_stack_repositories.html
2.改ip这块结合这个播客看,有详细介绍,我只不过是总结了下:http://blog.csdn.net/wanz2/article/details/52820876
配置静态IP:
静态IP地址配置主要用到以下三个文件:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network
/etc/resolv.conf
1).[root@ambari-server3 ~]# vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=ambari-server3
NTPSERVERARGS=iburst
GATEWAY=192.168.182.2
2).[root@ambari-server3 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=55d620df-ca54-4907-bac5-f8f6fb6bb2f1
ONBOOT=yes
NM_CONTROLLED=yes
HWADDR=00:0C:29:DD:52:B6
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
LAST_CONNECT=1515859956
#这几个除了dhcp改为static外,下面几个都是加上去的,这个因人而异
BOOTPROTO=static
IPADDR=192.168.182.132
NETMASK=255.255.255.0
GATEWAY=192.168.182.2
DNS1=192.168.182.2
DNS2=8.8.8.8
3).上一步配置完成后,系统会在/etc/resolv.conf文件中自动写入DNS服务器地址
[root@ambari-server3 ~]# more /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.182.2
nameserver 8.8.8.8
重启网络服务:
[root@ambari-server3 ~]# service network restart
正在关闭接口 eth0: 设备状态:3 (断开连接)
[确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/4 [确定]
打开ssh服务:
[root@ambari-server3 ~]# service sshd status
openssh-daemon (pid 1685) 正在运行...
[root@ambari-server3 ~]# service sshd start
[root@ambari-server3 ~]# chkconfig sshd on #设置开机运行ssh
[root@ambari-server3 ~]# chkconfig --list sshd
sshd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
这台节点就算完事了,有几台节点,就对应的改几次、
3.各三台机器做免密钥:
我这里ambari-server3是主节点:
1).先配置三台机器的hosts文件:三台都要做,一样的;
[root@ambari-server3 .ssh]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.182.130 ambari-server1
192.168.182.131 ambari-server2
192.168.182.132 ambari-server3
[root@ambari-server1 .ssh]# vim /etc/hosts
[root@ambari-server2 .ssh]# vim /etc/hosts
2).需求:准备安装ambari-server3(192.168.182.132)机器,需要到所有的机器都免密,包括本机。
在准备安装ambari-server3(192.168.182.132)的机器上生成秘钥
[root@ambari-server3 source]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
33:21:02:fd:00:3a:d8:61:97:25:55:83:64:19:bb:52 root@ambari-server3
The key's randomart image is:
+--[ RSA 2048]----+
| =oo=*=o |
|.+ ++oo. . |
|+ . .oE . |
| . o.o . |
| . . S |
| . o |
| |
| |
| |
+-----------------+
3).配置ambari-server3(192.168.182.132)机器到所有机器的免密
包括自己本身
ssh-copy-id root@192.168.182.130
ssh-copy-id root@192.168.182.131
ssh-copy-id root@192.168.182.132
[root@ambari-server3 .ssh]# ssh-copy-id root@192.168.182.130
root@192.168.182.130's password:
Now try logging into the machine, with "ssh 'root@192.168.182.130'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
出现这个不影响免密登陆,刚测试了
[root@ambari-server3 .ssh]# ssh 192.168.182.130Last login: Sun Jan 14 11:49:22 2018 from ambari-server3
[root@ambari-server1 ~]# hostname
ambari-server1
[root@ambari-server1 ~]# exit
logout
Connection to 192.168.182.130 closed.
[root@ambari-server3 .ssh]# hostname
ambari-server3
[root@ambari-server3 .ssh]# ssh-copy-id root@192.168.182.131
root@192.168.182.131's password:
Now try logging into the machine, with "ssh 'root@192.168.182.131'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@ambari-server3 .ssh]# ssh-copy-id root@192.168.182.132
The authenticity of host '192.168.182.132 (192.168.182.132)' can't be established.
RSA key fingerprint is ad:4f:3d:d2:02:6d:6f:5b:44:97:b7:a1:1c:e3:5e:ff.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.182.132' (RSA) to the list of known hosts.
root@192.168.182.132's password:
Now try logging into the machine, with "ssh 'root@192.168.182.132'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@ambari-server3 .ssh]# ssh 192.168.182.131
Last login: Sun Jan 14 11:51:14 2018 from ambari-server3
[root@ambari-server2 ~]# exit
logout
Connection to 192.168.182.131 closed.
[root@ambari-server3 .ssh]# ssh 192.168.182.132
Last login: Sun Jan 14 10:22:37 2018 from 192.168.182.1
[root@ambari-server3 ~]# exit
logout
Connection to 192.168.182.132 closed.
到这里主节点到各台子节点的面密就做完了
4.装ambari必须要的组件:jdk、mysql
1).jdk好装,就不做详细介绍了;
[root@ambari-server3 source]# rpm -qa | grep jdk
java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
[root@ambari-server3 source]# clear
[root@ambari-server3 source]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
[root@ambari-server3 source]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
[root@ambari-server3 source]# tar -zxvf jdk-8u73-linux-x64.gz -C /usr/java/
[root@ambari-server3 source]# vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_73
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
[root@ambari-server3 source]# source /etc/profile
[root@ambari-server3 source]# java -version
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
[root@ambari-s