#install OS centos 7.5
#install lsb net-tools package
yum install -y redhat-lsb net-tools
1. Configure hostnames
Configure each host in the cluster as follows to ensure that all members can communicate with each other:
Set the hostname to a unique name (not localhost).
sudo hostnamectl set-hostname foo-1.example.com
Edit /etc/hosts with the IP address and fully qualified domain name (FQDN) of each host in the cluster. You can add the unqualified name as well.
1.1.1.1 foo-1.example.com foo-1 2.2.2.2 foo-2.example.com foo-2 3.3.3.3 foo-3.example.com foo-3 4.4.4.4 foo-4.example.com foo-4
Edit /etc/sysconfig/network with the FQDN of this host only:
HOSTNAME=foo-1.example.com
Verify that each host consistently identifies to the network:
Run uname -a and check that the hostname matches the output of the hostname command.
Run /sbin/ifconfig and note the value of inet addr in the eth0 (or bond0) entry, for example:
eth0 Link encap:Ethernet HWaddr 00:0C:29:A4:E8:97
inet addr:172.29.82.176 Bcast:172.29.87.255 Mask:255.255.248.0
...
Run host -v -t A $(hostname) and verify that the output matches the hostname command.
The IP address should be the same as reported by ifconfig for eth0 (or bond0):
Trying "foo-1.example.com"
...
;; ANSWER SECTION:
foo-1.example.com. 60 IN
A
172.29.82.176
2.Disabling the Firewall
To disable the firewall on each host in your cluster, perform the following steps on each host.
For iptables, save the existing rule set:
sudo iptables-save > ~/firewall.rules
Disable the firewall:
RHEL 7 compatible:
sudo systemctl disable firewalld sudo systemctl stop firewalld
3.SELinux
#disable selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0
#优化配置
sysctl vm.swappiness=10 echo 'vm.swappiness=10' >> /etc/sysctl.conf echo never > /sys/kernel/mm/transparent_hugepage/defrag echo never > /sys/kernel/mm/transparent_hugepage/enabled echo 'echo never > /sys/kernel/mm/transparent_hugepage/defrag' >> /etc/rc.local echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.local chmod +x /etc/rc.d/rc.local
4.set ntp
yum install -y ntp
#Edit the /etc/ntp.conf file master
server 120.25.108.11 iburst
server 182.92.12.11 iburst
#other server
vim /etc/ntp.conf
server 192.168.88.35
fudge 192.168.88.35 stratum 10
#check
ntpdate -u 120.25.108.11 sudo systemctl start ntpd sudo systemctl enable ntpd hwclock --systohc
# all server
systemctl stop chronyd.service
systemctl disable chronyd.service
5.Installing Cloudera Manager, CDH, and Managed Services on manager-server
#enable httpd
sudo yum -y install httpd sudo systemctl enabled httpd sudo systemctl start httpd
#download cm6
sudo mkdir -p /var/www/html/cloudera-repos/cm6 wget https://archive.cloudera.com/cm6/version/repo-as-tarball/cm6.3.1-redhat7.tar.gz tar xvfz cm6.3.1-redhat7.tar.gz -C /var/www/html/cloudera-repos/cm6 --strip-components=1 sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cm6
#download cdh6.3.2
sudo mkdir -p /var/www/html/cloudera-repos sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.3.2/redhat7/ -P /var/www/html/cloudera-repos sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/gplextras6/6.3.2/redhat7/ -P /var/www/html/cloudera-repos sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cdh6 sudo chmod -R ugo+rX /var/www/html/cloudera-repos/gplextras6
sudo rpm --import https://archive.cloudera.com/cm6/6.3.1/redhat7/yum/RPM-GPG-KEY-cloudera