Generating public/private rsa key pair. Enter file inwhich 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: SHA256:7eq7ba8p2jm/VRW42nPzGJ6sZCDPNPJPmHlmxkRPGIk root@master The key's randomart image is: +---[RSA 2048]----+ | ..... | | E .+ .| | o o .| | . . + . | | S = + o | | O X +.o | | O @oo+o| | .o+.% = .| | .oBB*++. | +----[SHA256]-----+
1 2 3 4
# 查看隐藏文件 ls -al # 找到 .ssh文件夹,进入 cd .ssh/
将 master 下的 公钥 id_rsa.pub 拷贝给 slave1 和 slave2
1 2
# 拷贝给 slave1,slave2同理 ssh-copy-id slave1
首次需要输入密码(密码不可见)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[root@master .ssh]# ssh-copy-id hadoop103 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to login 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@slave1's password: # 密码正确显示: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'slave1'" and check to make sure that only the key(s) you wanted were added. [root@master .ssh]#
The authenticity of host 'slave1 (192.168.10.103)' can't be established. ECDSA key fingerprint is SHA256:PTPbUEReNUaje+/doeEYmZV5z68jauvds1z9GPrZUnQ. ECDSA key fingerprint is MD5:d1:91:9e:d0:b7:24:44:c7:bd:82:25:48:48:e1:e7:94. Are you sure you want to continue connecting (yes/no)? yes # 输入yes Warning: Permanently added 'slave1,192.168.10.103' (ECDSA) to the list of known hosts. xiaokang@slave1's password: # 输入管理员密码(密码不可见)
The authenticity of host 'master (192.168.10.102)' can't be established. ECDSA key fingerprint is SHA256:PTPbUEReNUaje+/doeEYmZV5z68jauvds1z9GPrZUnQ. ECDSA key fingerprint is MD5:d1:91:9e:d0:b7:24:44:c7:bd:82:25:48:48:e1:e7:94. Are you sure you want to continue connecting (yes/no)? yes # 输入yes Warning: Permanently added 'master,192.168.10.102' (ECDSA) to the list of known hosts. xiaokang@master's password: # 输入master 的管理员密码(密码不可见)
The authenticity of host 'master (192.168.10.102)' can't be established. ECDSA key fingerprint is SHA256:PTPbUEReNUaje+/doeEYmZV5z68jauvds1z9GPrZUnQ. ECDSA key fingerprint is MD5:d1:91:9e:d0:b7:24:44:c7:bd:82:25:48:48:e1:e7:94. Are you sure you want to continue connecting (yes/no)? yes # 输入yes Warning: Permanently added 'master,192.168.10.102' (ECDSA) to the list of known hosts. xiaokang@master's password: # 输入hadoop102 的管理员密码(密码不可见)
The authenticity of host 'slave2 (192.168.10.104)' can't be established. ECDSA key fingerprint is SHA256:PTPbUEReNUaje+/doeEYmZV5z68jauvds1z9GPrZUnQ. ECDSA key fingerprint is MD5:d1:91:9e:d0:b7:24:44:c7:bd:82:25:48:48:e1:e7:94. Are you sure you want to continue connecting (yes/no)? yes # 输入yes Warning: Permanently added 'slave2,192.168.10.104' (ECDSA) to the list of known hosts. xiaokang@slave2's password: # 输入hadoop104 的管理员密码(密码不可见)
#!/bin/bash #1. 判断参数个数 if [ $# -lt 1 ] then echo Not Enough Arguement! exit; fi #2. 遍历集群所有机器 for host in master slave1 slave2 do echo ==================== $host ==================== #3. 遍历所有目录,挨个发送
for file in $@ do #4. 判断文件是否存在 if [ -e $file ] then #5. 获取父目录 pdir=$(cd -P $(dirname $file); pwd)
#6. 获取当前文件的名称 fname=$(basename $file) ssh $host "mkdir -p $pdir" rsync -av $pdir/$fname $host:$pdir else echo $file does not exists! fi done done
任务二:Sqoop 安装配置
点击查看参考教程
任务三:Hive 安装配置
点击查看参考教程
模块B:离线数据处理
模块C:数据挖掘
报错汇总
点击查看参考教程
failure: repodata/repomd.xml from runoob.com_docker_centos-docker-install.html: [Errno 256] No more mirrors to try.
解决方法:删除库重新下载,建议换个节点
1 2 3 4
# 删库方法 cd /etc/yum.repos.d cd /etc/yum.repos.d | grep "docker" rm -f $fname# $fname 为上一条命令查到的所有文件名
Error response from daemon: Container 80d717367d2432021ddb14f03b2399616be84020f469d9dcf719bc67641b9389 is not running