赞
踩
Ambari2.7.5、HDP31.5、libtirpc-devel:
链接:https://pan.baidu.com/s/1eteZ2jGkSq4Pz5YFfHyJgQ
提取码:6hq3
redhat7.6操作系统:
链接:https://pan.baidu.com/s/1fXb0wG8ODseXwrYa_WJhBw
提取码:srut
linux(redhat7.6)环境:
node001 16g + 120 g
node002 8g + 120 g
node003 8g + 120 g
]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
BOOTPROTO="static"
NAME="ens33"
UUID="f0728346-a3b1-4fc8-9952-d78c4caceae8"
DEVICE="ens33"
ONBOOT="yes"
IPADDR="10.168.1.25"
NETMASK="255.255.255.0"
GATEWAY="10.168.1.21"
DNS1="10.168.1.1"
DNS2="8.8.8.8"
重启网络使配置生效
]# systemctl restart network
查看是否修改成功
]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.168.1.25 netmask 255.255.255.0 broadcast 10.168.1.255
inet6 fe80::20c:29ff:feef:fa55 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ef:fa:55 txqueuelen 1000 (Ethernet)
RX packets 2245696 bytes 2793523273 (2.6 GiB)
RX errors 0 dropped 3596 overruns 0 frame 0
TX packets 825291 bytes 616615664 (588.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
同理配置其他服务器ip
vim /etc/hostname
分别将3台服务器hostname分别设置为node001.djin.com,node002.djin.com,node003.djin.com
vim /etc/hosts
]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.168.1.25 node001.djin.com node001
10.168.1.26 node002.djin.com node002
10.168.1.27 node003.djin.com node003
3台服务器的hosts都需要做如上修改
3台服务器上分别执行以下操作,关闭防火墙并配置开机不自动启动
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
关闭3台服务器selinux
临时关闭,不用重启服务器
setenforce 0
为了重启后依然关闭,配置如下文件
vim /etc/sysconfig/selinux
修改
SELINUX=disabled
重启后验证是否禁用成功
]# sestatus -v
SELinux status: disabled
方法一
ssh-keygen -t rsa
ssh-copy-id -i /root/.ssh/id_rsa.pub node001
ssh-copy-id -i /root/.ssh/id_rsa.pub node002
ssh-copy-id -i /root/.ssh/id_rsa.pub node003
方法二
5. 在每台服务器上执行如下操作,一直回车即可
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
~/.ssh/id_rsa.pub
中的内容拷贝到服务器1的~/.ssh/authorized_keys
中,查看文件中的内容 ]# cat ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/eA09X4s5RIYvuYNxVvtOo6unY1mgipsFyoz/hy/Gwk0onfZvBi/Sl3TVRZO5aqcHccAGlLF7OPTKH1qUuKVtnUOQik0TouL5VKsOBDMHHRT9D5UwqaIE8tYDC8V6uwieFgscZcBjhrsJ/Iramo9ce7N9RTO3otRMRQxOs+Wd1F/ZOmpRtMGU2N4RH4i2quRU6m2lt/eJKpNupSHKoztTQRsEanilHVASnikAXH8JpG70iO7RXR/hLz+/Of3ISUrOMSO4/ZIIu4xnYN3jvsXOdK/qIhP/PI2s+uF22IvVE6xZYVadQFa4zAuhQmCBWkE7vMyI1UJkxP7OQYj72LUH root@node001
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnz8wHoytR2Xlnl04rQq4I2vgUVWbkKjv30pj+Toz4719ah4cY9pvZj0JsfhVzaaCsR14BLFVLkqKUhCWK3K6muT4iHb+N0WirpbwfJkztmQeco7Ha9xrPQ8v/I4xZujFoMVA0tkb/32zRTxOkPv9AUgB8V6Lin6LnB/AcnhnmoIs5PdbAdh/kBGpQGKIZkbyCUOYz9/PZuGJoJBblqfWiqzxYYLN9+cYMkmPnB1HdDewAepIsIC18U3ujE+1Su2UlmISPvvr1zG4XR4ZZoKQsOOJq3XRMGVkDvmFhl03JHZpd6BW0796CeYVZ41UomWXTOduQql+tYWUbegzGLmRZ root@node002
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8AFoGJHp2M45xLYNzXUHLWzRwHsgRPHjeErStq0tEy9bQv4OkN41j0FrxVAYJiGHdHGturriVgUEtL59RjcrJH6bAvhP54nM5YiQlNnWnSUR27Zuaodz4nhYUFq/Co5eDN6lTfL8pgYiEdpBOvE5t1w3bisdblP7YGQ2lF1zzCEGfQ79QbntEbyGNoR9sGHm11x9fOH+fape8TjQJrEAO4d1tAhMqVygQKwqwAPKeqhEum6BaLli83TsXzd7gyz9H7AAc1m04NaLB26xfynW6MVuk1j94awXKlGXjrbNTC/Kg6M8bd5PT/k3DOkx4b+nEs8xZ5x1j4D2OaO1X6rZx root@node003
chmod 600 ~/.ssh/authorized_keys
~/.ssh/authorized_keys
同步到其他节点scp ~/.ssh/authorized_keys node002:~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys node003:~/.ssh/authorized_keys
ssh node002
pssh基于Python编写的并发在多台服务器上批量执行命令的工具,它支持文件并行复制、远程并行执行命令、杀掉远程主机上的进程等,这里介绍安装及常用命令,完整的介绍参考这里。
cd /opt/bao
wget http://peak.telecommunity.com/dist/ez_setup.py
wget http://files.opstool.com/files/pssh-2.3.tar.gz
上面的网址可能下载不下来,用另一个
wget https://pypi.python.org/packages/60/9a/8035af3a7d3d1617ae2c7c174efa4f154e5bf9c24b36b623413b38be8e4a/pssh-2.3.1.tar.gz
tar -zxvf pssh-2.3.1.tar.gz -C /opt/src
cd /opt/src
mv pssh-2.3.1 pssh
cd pssh
python setup.py build
python setup.py install
]# pssh --version
2.3.1
vim /node.list
]# cat /node.list
root@10.168.1.25:22
root@10.168.1.26:22
root@10.168.1.27:22
]# pssh -h /node.list -i -P 'date'
node001: 2021年 08月 28日 星期六 20:20:07 CST
[1] 20:20:07 [SUCCESS] root@node001:22
2021年 08月 28日 星期六 20:20:07 CST
node002: 2021年 08月 28日 星期六 20:20:07 CST
[2] 20:20:07 [SUCCESS] root@node002:22
2021年 08月 28日 星期六 20:20:07 CST
node003: 2021年 08月 28日 星期六 20:20:07 CST
[3] 20:20:07 [SUCCESS] root@node003:22
2021年 08月 28日 星期六 20:20:07 CST
yum -y remove chronyd
[root@node001 ~]# pssh -h /node.list -i 'yum -y install ntp'
vim /etc/ntp.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
修改为
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。