Ceci est une ancienne révision du document !
Table des matières
Version : 2020.01
Dernière mise-à-jour : 2020/09/17 08:52
BDF101 - Ajouter un Hôte à un Cluster HDP Existant
Contenu du Module
- BDF101 - Ajouter un Hôte à un Cluster HDP Existant
- Contenu du Module
- LAB #1 - Préparer l'hôte worker4
- LAB #2 - Configurer l'hôte worker4
- LAB #3 - Ajouter l'hôte worker4 au Cluster
LAB #1 - Préparer l'hôte worker4
Commencez par configurer la redirection de port pour la VM sur nic1 :
desktop@serverXX:~$ VBoxManage modifyvm "CentOS_7_8" --natpf1 "centos_7_8,tcp,,3022,,22"
Configurez ensuite nic3 en Réseau Privé Hôte :
desktop@serverXX:~$ VBoxManage modifyvm CentOS_7_8 --nic3 hostonly --hostonlyadapter2 vboxnet0
Afin d'éviter un conflit d'adresse IP avec master1, désactivez nic2 :
desktop@serverXX:~$ VBoxManage modifyvm CentOS_7_8 --nic2 none
Démarrez maintenant la VM CentOS_7_8 :
desktop@serverXX:~$ VBoxManage startvm CentOS_7_8 --type headless
Éditez le fichier /etc/hosts du serverXX en ajoutant la ligne pour worker4.ittraining.loc :
desktop@serverXX:~$ sudo su - [sudo] password for desktop: root@serverXX:~# vi /etc/hosts root@serverXX:~# cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 serverXX.ittraining.network serverXX # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters XXX.XXX.XXX.XXX serverXX.ittraining.network serverXX 192.168.56.2 master1.ittraining.loc master1 192.168.56.3 master2.ittraining.loc master2 192.168.56.4 master3.ittraining.loc master3 192.168.56.5 worker1.ittraining.loc worker1 192.168.56.6 worker2.ittraining.loc worker2 192.168.56.7 worker3.ittraining.loc worker3 192.168.56.8 worker4.ittraining.loc worker4 root@serverXX:~# exit logout
Connectez-vous à la VM CentOS_7_8 en utilisant la redirection de port de nic1 :
desktop@server40:~$ ssh -l trainee localhost -p 3022 trainee@localhost's password: trainee Last login: Tue Sep 15 06:53:32 2020 from 192.168.56.1
Devenez root :
[trainee@centos7 ~]$ su - Password: fenestros Last login: Tue Sep 15 06:54:53 CEST 2020 on pts/1
Editez le fichier /etc/hosts de la VM en ajoutant la ligne pour worker4.ittraining.loc :
[root@centos7 ~]# vi /etc/hosts [root@centos7 ~]# cat /etc/hosts 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.56.2 master1.ittraining.loc master1 192.168.56.3 master2.ittraining.loc master2 192.168.56.4 master3.ittraining.loc master3 192.168.56.5 worker1.ittraining.loc worker1 192.168.56.6 worker2.ittraining.loc worker2 192.168.56.7 worker3.ittraining.loc worker3 192.168.56.8 worker4.ittraining.loc worker4
Configurez ensuite la troisième interface enp0s9 réseau en IP fixe :
[root@centos7 ~]# nmcli connection add con-name ip_enp0s9 ifname enp0s9 type ethernet ip4 192.168.56.8/24 gw4 10.0.2.2 Connection 'ip_enp0s9' (2d9b46b3-c575-4a16-86b5-dc4ed540f866) successfully added. [root@centos7 ~]# nmcli connection up ip_enp0s9
Fermez le terminal figé et ouvrez un nouveau terminal. Cconnectez-vous à votre serverXX :
$ ssh desktop@serverXX.ittraining.network desktop@serverX.ittraining.network's password:
Reconnectez-vous à la VM en utilisant l'adresse 192.168.56.8 :
desktop@serverXX:~$ ssh -l trainee 192.168.56.8 The authenticity of host '192.168.56.8 (192.168.56.8)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.8' (ECDSA) to the list of known hosts. trainee@192.168.56.8's password: Last login: Thu Sep 17 06:29:24 2020 from gateway [trainee@centos7 ~]$
Configurez la première interface réseau enp0s3 en IP fixe :
[trainee@centos7 ~]$ su - Password: fenestros Last login: Thu Sep 17 06:31:56 CEST 2020 on pts/0 [root@centos7 ~]# nmcli connection add con-name ip_enp0s3 ifname enp0s3 type ethernet ip4 10.0.2.15/24 gw4 10.0.2.2 Warning: There is another connection with the name 'ip_enp0s3'. Reference the connection by its uuid 'b1ece19a-6dee-49a9-b2f1-95004af3cdc2' Connection 'ip_enp0s3' (b1ece19a-6dee-49a9-b2f1-95004af3cdc2) successfully added. [root@centos7 ~]# nmcli connection mod ip_enp0s3 ipv4.dns 8.8.8.8 [root@centos7 ~]# nmcli connection up ip_enp0s3 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
Dernièrement modifiez le nom d'hôte de la VM :
[root@centos7 ~]# nmcli general hostname worker4.ittraining.loc
Arrêtez la VM et supprimez la redirection de port de la VM :
[root@centos7 ~]# exit logout [trainee@centos7 ~]$ exit logout Connection to localhost closed. desktop@serverXX:~$ VBoxManage controlvm CentOS_7_8 poweroff 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% desktop@serverXX:~$ VBoxManage modifyvm CentOS_7_8 --natpf1 delete centos_7_8
LAB #2 - Configurer l'hôte worker4
Démarrez la VM CentOS_7_8 :
desktop@serverXX:~$ VBoxManage startvm CentOS_7_8 --type headless Waiting for VM "CentOS_7_8" to power on... VM "CentOS_7_8" has been successfully started.
Connectez-vous à la VM en utilisant l'adresse 192.168.56.8 :
desktop@serverXX:~$ ssh -l trainee 192.168.56.8 trainee@192.168.56.8's password: Last login: Thu Sep 17 06:33:32 2020 from 192.168.56.1
Devenez root :
[trainee@worker4 ~]$ su - Password: fenestros Last login: Thu Sep 17 06:34:38 CEST 2020 on pts/1
Editer /etc/sysconfig/network :
[root@worker4 ~]# vi /etc/sysconfig/network [root@worker4 ~]# cat /etc/sysconfig/network # Created by anaconda NETWORKING=yes HOSTNAME=worker4.ittraining.loc
Créez le repository ambari dans yum :
[root@worker4 ~]# vi /etc/yum.repos.d/ambari.repo [root@worker4 ~]# cat /etc/yum.repos.d/ambari.repo [ambari] name = Ambari Repo baseurl = http://master1.ittraining.loc/ambari/centos7/2.7.4.0-118 gpgcheck = 0
Mettez à jour la base de données des dépôts dans yum :
[root@worker4 ~]# yum clean all Loaded plugins: fastestmirror Cleaning repos: ambari base extras updates Cleaning up list of fastest mirrors [root@worker4 ~]# yum makecache Loaded plugins: fastestmirror Determining fastest mirrors * base: ftp.rezopole.net * extras: centos.mirror.fr.planethoster.net * updates: centos.crazyfrogs.org ambari | 2.9 kB 00:00:00 base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/13): ambari/filelists_db | 104 kB 00:00:00 (2/13): ambari/other_db | 1.4 kB 00:00:00 (3/13): ambari/primary_db | 25 kB 00:00:00 (4/13): base/7/x86_64/group_gz | 153 kB 00:00:00 (5/13): base/7/x86_64/filelists_db | 7.1 MB 00:00:00 (6/13): base/7/x86_64/other_db | 2.6 MB 00:00:00 (7/13): base/7/x86_64/primary_db | 6.1 MB 00:00:00 (8/13): extras/7/x86_64/primary_db | 206 kB 00:00:01 (9/13): extras/7/x86_64/other_db | 124 kB 00:00:00 (10/13): extras/7/x86_64/filelists_db | 217 kB 00:00:01 (11/13): updates/7/x86_64/primary_db | 4.5 MB 00:00:00 (12/13): updates/7/x86_64/filelists_db | 2.4 MB 00:00:00 (13/13): updates/7/x86_64/other_db | 318 kB 00:00:00 Metadata Cache Created
Installez ambari agent :
[root@worker2 ~]# yum -y install ambari-agent
Modifiez le fichier /etc/ambari-agent/conf/ambari-agent.ini :
[root@worker2 ~]# vi /etc/ambari-agent/conf/ambari-agent.ini ... [server] hostname=master1.ittraining.loc <-----------------------modifier de localhost à master1.ittraining.loc ...
Modifiez le fichier /etc/hosts de la VM master1 et vérifiez le contenu du fichier :
[root@worker4 ~]# ssh -l root 192.168.56.2 The authenticity of host '192.168.56.2 (192.168.56.2)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. ECDSA key fingerprint is MD5:03:f0:db:ae:0c:0a:5e:47:9b:7e:8c:5b:87:c1:0e:6f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.2' (ECDSA) to the list of known hosts. root@192.168.56.2's password: fenestros Last login: Tue Sep 15 22:15:44 2020 [root@master1 ~]# echo "192.168.56.8 worker4.ittraining.loc worker4" >> /etc/hosts [root@master1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.56.2 master1.ittraining.loc master1 192.168.56.3 master2.ittraining.loc master2 192.168.56.4 master3.ittraining.loc master3 192.168.56.5 worker1.ittraining.loc worker1 192.168.56.6 worker2.ittraining.loc worker2 192.168.56.7 worker3.ittraining.loc worker3 192.168.56.8 worker4.ittraining.loc worker4 [root@master1 ~]# exit logout Connection to 192.168.56.2 closed.
Modifiez le fichier /etc/hosts de la VM master2 :
[root@worker4 ~]# ssh -l root 192.168.56.3 The authenticity of host '192.168.56.3 (192.168.56.3)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. ECDSA key fingerprint is MD5:03:f0:db:ae:0c:0a:5e:47:9b:7e:8c:5b:87:c1:0e:6f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.3' (ECDSA) to the list of known hosts. root@192.168.56.3's password: fenestros Last login: Tue Sep 15 22:17:53 2020 [root@master2 ~]# echo "192.168.56.8 worker4.ittraining.loc worker4" >> /etc/hosts [root@master2 ~]# exit logout Connection to 192.168.56.3 closed.
Modifiez le fichier /etc/hosts des VMs master3, worker1, worker2 et worker3 :
[root@worker4 ~]# ssh -l root 192.168.56.4 The authenticity of host '192.168.56.4 (192.168.56.4)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. ECDSA key fingerprint is MD5:03:f0:db:ae:0c:0a:5e:47:9b:7e:8c:5b:87:c1:0e:6f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.4' (ECDSA) to the list of known hosts. root@192.168.56.4's password: fenestros Last login: Tue Sep 15 22:17:11 2020 [root@master3 ~]# echo "192.168.56.8 worker4.ittraining.loc worker4" >> /etc/hosts [root@master3 ~]# exit logout Connection to 192.168.56.4 closed. [root@worker4 ~]# ssh -l root 192.168.56.5 The authenticity of host '192.168.56.5 (192.168.56.5)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. ECDSA key fingerprint is MD5:03:f0:db:ae:0c:0a:5e:47:9b:7e:8c:5b:87:c1:0e:6f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.5' (ECDSA) to the list of known hosts. root@192.168.56.5's password: fenestros Last login: Tue Sep 15 22:18:22 2020 [root@worker1 ~]# echo "192.168.56.8 worker4.ittraining.loc worker4" >> /etc/hosts [root@worker1 ~]# exit logout Connection to 192.168.56.5 closed. [root@worker4 ~]# ssh -l root 192.168.56.6 The authenticity of host '192.168.56.6 (192.168.56.6)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. ECDSA key fingerprint is MD5:03:f0:db:ae:0c:0a:5e:47:9b:7e:8c:5b:87:c1:0e:6f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.6' (ECDSA) to the list of known hosts. root@192.168.56.6's password: fenestros Last login: Tue Sep 15 22:18:45 2020 [root@worker2 ~]# echo "192.168.56.8 worker4.ittraining.loc worker4" >> /etc/hosts [root@worker2 ~]# exit logout Connection to 192.168.56.6 closed. [root@worker4 ~]# ssh -l root 192.168.56.7 The authenticity of host '192.168.56.7 (192.168.56.7)' can't be established. ECDSA key fingerprint is SHA256:p5z2DKHnUDZcE3RKKo5AbZiVHEe4MPj0qMRug9tAq7M. ECDSA key fingerprint is MD5:03:f0:db:ae:0c:0a:5e:47:9b:7e:8c:5b:87:c1:0e:6f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.7' (ECDSA) to the list of known hosts. root@192.168.56.7's password: fenestros Last login: Tue Sep 15 22:19:13 2020 [root@worker3 ~]# echo "192.168.56.8 worker4.ittraining.loc worker4" >> /etc/hosts [root@worker3 ~]# exit logout Connection to 192.168.56.7 closed.
Démarrez le service ambari-agent :
[root@worker4 ~]# systemctl status ambari-agent ● ambari-agent.service - LSB: ambari-agent daemon Loaded: loaded (/etc/rc.d/init.d/ambari-agent; bad; vendor preset: disabled) Active: inactive (dead) Docs: man:systemd-sysv-generator(8) [root@worker4 ~]# systemctl enable ambari-agent ambari-agent.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig ambari-agent on [root@worker4 ~]# systemctl start ambari-agent [root@worker4 ~]# systemctl status ambari-agent ● ambari-agent.service - LSB: ambari-agent daemon Loaded: loaded (/etc/rc.d/init.d/ambari-agent; bad; vendor preset: disabled) Active: active (running) since Thu 2020-09-17 08:08:19 CEST; 6s ago Docs: man:systemd-sysv-generator(8) Process: 1603 ExecStart=/etc/rc.d/init.d/ambari-agent start (code=exited, status=0/SUCCESS) CGroup: /system.slice/ambari-agent.service ├─1662 /usr/bin/python /usr/lib/ambari-agent/lib/ambari_agent/AmbariAgent.py start └─1666 /usr/bin/python /usr/lib/ambari-agent/lib/ambari_agent/main.py start Sep 17 08:08:17 worker4.ittraining.loc ambari-agent[1603]: Checking ambari-common dir... Sep 17 08:08:17 worker4.ittraining.loc ambari-agent[1603]: Starting ambari-agent Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: Verifying ambari-agent process status... Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: tput: No value for $TERM and no -T specified Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: Ambari Agent successfully started Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: tput: No value for $TERM and no -T specified Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: Agent PID at: /run/ambari-agent/ambari-agent.pid Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: Agent out at: /var/log/ambari-agent/ambari-agent.out Sep 17 08:08:19 worker4.ittraining.loc ambari-agent[1603]: Agent log at: /var/log/ambari-agent/ambari-agent.log Sep 17 08:08:19 worker4.ittraining.loc systemd[1]: Started LSB: ambari-agent daemon.
Redémarrez la VM CentOS_7_8 :
[root@worker4 ~]# shutdown -r now Connection to 192.168.56.8 closed by remote host. Connection to 192.168.56.8 closed.
LAB #3 - Ajouter l'hôte worker4 au Cluster
Accéder à la Console d'Ambari
Connectez-vous au serverXX en utilisant le client X2Go :
Ouvrez le navigateur Firefox et saisissez l'URL http://master1.ittraining.loc:8080. Entrez l'utilisateur admin et le mot de passe admin et cliquez sur le bouton SIGN IN :
Vous êtes maintenant dans la console d'Ambari :
Cliquez sur le lien Hosts :
Cliquez sur le bouton Actions puis le lien Add New Hosts :
Install Options
Entrez le nom de worker4.ittraining.loc dans l'emplacement prévu :
Choisissez l'option Perform manual registration and do not use SSH :
Confirm Hosts
Cliquez sur le bouton OK pour valider la boîte d'avertissement et cliquez sur le bouton REGISTER AND CONFIRM :
Cliquez sur le bouton OK de la boîte d'avertissement Before You Proceed :
L'assistant initialise le noeud puis vérifie que les pré-requis pour continuer sont satisfaits :
Assign Slaves and Clients
L'assistant vous propose maintenant d'assigner des composants à l'hôte. Cochez Client pour l'hôte puis cliquez sur le bouton NEXT :
Configurations
L'assistant vous demande de sélectionner les groupes de configurations auquels l'hôte va être rattaché. Cliquez simplement sur le bouton NEXT :
Review
Install, Start and Test
Cliquez sur le bouton DEPLOY :
A l'issu du déploiement, un résumé de la situation vous informe d'éventuelles erreurs :
En validant le déploiement, vous arrivez sur la liste des le console de gestion :