部署Ambari Server实战案例
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.准备三台虚拟机(需要自行安装jdk环境)
1>.角色分配
NameNode节点:
hdp101.yinzhengjie.org.cn
DataNode节点:
hdp101.yinzhengjie.org.cn
hdp102.yinzhengjie.org.cn
hdp103.yinzhengjie.org.cn
MySQL服务器:
hdp101.yinzhengjie.org.cn
YUM源仓库服务器:
hdp101.yinzhengjie.org.cn
2>.内存分配(根据物理机情况合理分配即可)
hdp101.yinzhengjie.org.cn: 10G-16G,推荐12G hdp102.yinzhengjie.org.cn: 3G-6G,推荐6G hdp103.yinzhengjie.org.cn: 3G-6G,推荐6G
二.配置SSH免密码登录
1>.生成秘钥并配置与本机的免密登录
[root@hdp101.yinzhengjie.org.cn ~]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa Generating public/private rsa key pair. Created directory '/root/.ssh'. 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: SHA256:1q/IHVpogVivEj03C8ef3kUpJuDsGgaPT+PU5m8aycY root@hdp101.yinzhengjie.org.cn The key's randomart image is: +---[RSA 2048]----+ | | | | | . . | | + * o . | | + = S o o o | | = % B = o | | o O E = . . | | B X B.+ . | | + *+= . | +----[SHA256]-----+ [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]# ll ~/.ssh/id_rsa -rw------- 1 root root 1679 Jan 21 02:37 /root/.ssh/id_rsa [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]#
2>.配置hdp101.yinzhengjie.org.cn节点到其他节点免密登陆
[root@hdp101.yinzhengjie.org.cn ~]# ssh-copy-id root@hdp101.yinzhengjie.org.cn /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host 'hdp101.yinzhengjie.org.cn (172.200.1.101)' can't be established. ECDSA key fingerprint is SHA256:y6iS5ipSyWSGRmgcjivbWhd78pKfrcuQHeBPd5H9/U8. ECDSA key fingerprint is MD5:da:0f:2a:93:c0:d4:6e:7e:13:16:61:f1:93:a7:38:01. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@hdp101.yinzhengjie.org.cn's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@hdp101.yinzhengjie.org.cn'" and check to make sure that only the key(s) you wanted were added. [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]# who root tty1 2020-01-21 02:21 root pts/0 2020-01-21 02:35 (172.200.0.1) [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]# ssh hdp101.yinzhengjie.org.cn Last login: Tue Jan 21 02:35:51 2020 from 172.200.0.1 [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]# who root tty1 2020-01-21 02:21 root pts/0 2020-01-21 02:35 (172.200.0.1) root pts/1 2020-01-21 02:39 (172.200.1.101) [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]# exit logout Connection to hdp101.yinzhengjie.org.cn closed. [root@hdp101.yinzhengjie.org.cn ~]# [root@hdp101.yinzhengjie.org.cn ~]#