使用ansible离线部署CDH 5.15.1大数据集群

                                       作者:尹正杰 

版权声明:原创作品,谢绝转载!否则将追究法律责任。

 

  在此之前,我之前分享过使用shell自定义脚本部署大数据集群,不管是部署CDH集群还是部署HDP集群基本上套路都一样,调优的方式也都大同小异。只是操作界面上可能存在一定的差异。最近赶上公司搞自动化运维项目,我们用到了ansible的一些功能,本篇博客主要记录ansible部署CDH服务。

 

 

一.安装ansible

1>.操作环境介绍

  注意,请检查你的虚拟机是否可以正常联网,如果不能联网的话,本篇博客估计也就只能成为你的一个参考部署方案了!由于Mac内存有限,我只开了3台虚拟机,使用的操作系统是CentOS 7.2发行版的,内存分配每个节点4G,大家根据自己的机器适当调大或调小内存。详细信息如下:

[root@node101 ~]# hostname
node101.yinzhengjie.org.cn            #这是本篇博客所说的主节点,该节点配置必须高于其他节点配置或者配置不能低于2G内存!否则你在后期安装服务时,可能会遇到各种坑!(我测试时,三台主机分配过4,1,1,或者3,3,3基本上都可以正常运行!)
[root@node101 ~]# 
[root@node101 ~]# hostname -i
172.30.1.101
[root@node101 ~]# 
[root@node101 ~]# cat /etc/redhat-release          
CentOS Linux release 7.2.1511 (Core) 
[root@node101 ~]# 
[root@node101 ~]# 
[root@node101 ~]# free  -h   
              total        used        free      shared  buff/cache   available
Mem:           5.9G        120M        5.5G        6.7M        213M        713M
Swap:          2.0G          0B        2.0G
[root@node101 ~]# 
[root@node101 ~]# df -h      
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   50G  3.8G   43G   9% /
devtmpfs                      480M     0  480M   0% /dev
tmpfs                         495M     0  495M   0% /dev/shm
tmpfs                         495M  6.7M  488M   2% /run
tmpfs                         495M     0  495M   0% /sys/fs/cgroup
/dev/sda1                     477M  133M  315M  30% /boot
/dev/mapper/VolGroup-lv_home   12G   41M   11G   1% /home
Home                          234G  156G   79G  67% /media/psf/Home
tmpfs                          99M     0   99M   0% /run/user/0
[root@node101 ~]# 
[root@node101 ~]# cat /etc/hosts | grep yinzhengjie
172.30.1.101 node101.yinzhengjie.org.cn
172.30.1.102 node102.yinzhengjie.org.cn
172.30.1.103 node103.yinzhengjie.org.cn
[root@node101 ~]# 
[root@node101 ~]# 

2>.在主节点(node101.yinzhengjie.org.cn)配置至各个节点的免密钥登录

[root@node101 ~]# 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:
7b:9a:3a:cd:0b:7b:b5:5e:da:ad:b8:dd:aa:0a:b1:fb root@node101.yinzhengjie.org.cn
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
|      . S        |
|       o ..      |
|      +o.....    |
|      .=++.* o   |
|      +=E+*o=oo  |
+-----------------+
[root@node101 ~]# 
生成密钥([root@node101 ~]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa)

相关文章:

  • 2022-02-28
  • 2022-01-07
  • 2021-05-04
  • 2022-01-26
  • 2021-04-09
  • 2021-07-02
  • 2021-05-21
猜你喜欢
  • 2021-08-27
  • 2021-06-24
  • 2022-02-03
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案