在CentOS7下安裝CDH6.1
環(huán)境
CentOS 7.8
CDH6.1
PostgreSQL
安裝步驟
1.CentOS7 配置
1.1設(shè)置 hostname嫌吠,reboot重啟之后即能顯示(注意:不使用大寫字符作為主機(jī)名,否則在CDH中無法正常通過Kerberos進(jìn)行身份驗證)
hostnamectl set-hostname 主機(jī)名
vim /etc/hostname 設(shè)置主機(jī)名
1.2.設(shè)置 hosts 文件
vim /etc/hosts
192.168.137.131 master
192.168.137.133 node1
192.168.137.134 node2
scp -r /etc/hosts root@node1:/etc
scp -r /etc/hosts root@node2:/etc
1.3.禁用 防火墻(重啟生效)
關(guān)閉 systemctl stop firewalld
開機(jī)禁用 systemctl disable firewalld
查看狀態(tài) systemctl status firewalld
1.4.禁用 SELINUX
1).臨時關(guān)閉SELINUX
setenforce 0
2).永久關(guān)閉SELINUX
修改配置文件 vim /etc/selinux/config
(重啟生效)
將 SELINUX=enforcing
改為 SELINUX=disabled
3)查看SELINUX狀態(tài) sestatus
reboot 重啟機(jī)器后 執(zhí)行 sestatus
顯示 SELinux status: disabled
1.5非對稱加密的方式基于私鑰登陸的方式:(ssh連接時無需輸入用戶密碼)
1.ssh-keygen -t rsa
然后四下回車
2./root/.ssh目錄下:
私鑰:id_rsa
公鑰:id_rsa.pub
3.ssh-copy-id linux的IP
每個節(jié)點都需要拷貝秘鑰然后分發(fā)給別的linux音榜,執(zhí)行命令后然后輸入yes,然后最終輸入密碼
ssh-copy-id node1
ssh-copy-id node2
ssh-copy-id master
4.ssh linux的用戶名@別的linux的IP現(xiàn)在無需輸入別的linux的用戶密碼即能登錄到別的linux中
ssh root@node1
ssh root@node2
ssh root@master
1.6時鐘同步
1.ntp
安裝yum install ntp
啟動服務(wù)systemctl start ntpd
查看是否啟動ps -ef | grep ntpd
開機(jī)啟動systemctl enable ntpd.service
查看當(dāng)前時間date
查看當(dāng)前時間和NTP服務(wù)的同步狀態(tài)timedatectl
2.master作為NTP Server盔沫,node1和node2作為NTP Client,node1和node2要跟master同步時間柔昼,master要去外部授時中心同步時間
1.配置 master:
1.配置前先使用命令同步外部授時中心:ntpdate -u cn.pool.ntp.org
或 ntpdate -u ntp6.aliyun.com
2.vim /etc/ntp.conf
注釋以下配置
#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
2.配置 node1和node2,vim /etc/ntp.conf
注釋掉以下配置馍乙,
#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
設(shè)置master節(jié)點為授時服務(wù)器
server 192.168.137.131 iburst
3.systemctl restart ntpd
重啟服務(wù)端ntpd服務(wù)
4.ntpq -p
查看網(wǎng)絡(luò)中的NTP服務(wù)器布近,同時顯示客戶端和每個服務(wù)器的關(guān)系