天天看點

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

文檔編寫目的

CDP DC7.0.3是Cloudera與Hortonworks合并後,第一個融合CDH和HDP所有元件的on-premise版本,CDP Data Center主要由Cloudera Runtime構成,Cloudera Runtime由超過35個開源項目組成,當然CDP Data Center還包括其它功能如管理功能Cloudera Manager,Key Management,專業支援等,如下圖所示:

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

Cloudera Runtime的主要元件版本如下圖所示:

Component Apache Version
Atlas 2.0.0
Avro 1.8
DAS 1.4
Hadoop 3.1
HBase 2.2
Hive 3.1
Hive Warehouse Connector 1.0 (Technical Preview)
Hue 4.3
Impala 3.3
Kafka 2.3
Kudu 1.11
Oozie 5.1
ORC 1.5
Ozone 0.4.0 (Technical Preview)
Parquet 1.1
Phoenix 5
Ranger 2
Solr 7.4
Spark 2.4
Sqoop 1.4
Tez 0.9
Zookeeper 3.5.5

本文檔Fayson主要描述如何在Redhat7.6安裝CDP DC7.0.3。CDP DC7與CDH5/6的安裝步驟一緻,主要包括以下四部分:

1.安全前置準備,包括安裝作業系統、關閉防火牆、同步伺服器時鐘等;

2.外部資料庫如MySQL安裝

3.安裝Cloudera Manager;

4.安裝CDH叢集;

  • 測試環境

1.CM和CDH版本為7.0.3

2.Redhat7.6

3.OpenJDK1.8.0_232

4.MariaDB-5.5.64

5.root使用者安裝

前置準備

2.1 hostname及hosts配置

叢集中各個節點之間能互相通信使用靜态IP位址。IP位址和主機名通過/etc/hosts配置,主機名通過/etc/hostname進行配置。

以cm節點(172.31.2.24)為例:

1.hostname配置,建議你将hostname配置為有意義的字母或單詞組合,比如cdp01,請不要使用localhost作為主機名,也不要使用下劃線或者其它特殊字元作為主機名。/etc/hostname檔案示例如下:

[root@ip-172-31-2-24 ~]# cat /etc/hostname
ip-172-31-2-24.ap-southeast-1.compute.internal
           

複制

2.hosts配置需要将叢集的所有主機都加入進來,包括用戶端節點,管理節點和工作節點。/etc/hosts檔案示例如下:

[root@ip-172-31-2-24 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

172.31.2.24 ip-172-31-2-24.ap-southeast-1.compute.internal
172.31.15.60 ip-172-31-15-60.ap-southeast-1.compute.internal
172.31.8.194 ip-172-31-8-194.ap-southeast-1.compute.internal
172.31.13.81 ip-172-31-13-81.ap-southeast-1.compute.internal
           

複制

以上兩步操作,在叢集中其它節點做相同配置。确認CM的hosts檔案已經同步到叢集所有節點:

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.2 禁用SELinux

在所有節點執行setenforce 0 指令,此處使用批處理shell執行:

[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "setenforce 0"
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

叢集所有節點修改/etc/selinux/config檔案如下:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.3 關閉防火牆

叢集所有節點執行 systemctl stop指令,此處通過shell批量執行指令如下:

[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "systemctl stop firewalld"
[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "systemctl disable firewalld"
[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "systemctl status firewalld"
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.4 叢集時鐘同步

在Redhat7.x的作業系統上,已經預設的安裝了chrony,我們這裡先解除安裝chrony,然後安裝ntp。使用ntp來配置各台機器的時鐘同步,将cm(172.31.2.24)服務作為本地ntp伺服器,其它3台伺服器與其保持同步。

1.所有機器解除安裝chrony

[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "yum -y remove chrony"
           

複制

2.所有機器安裝ntp

[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "yum -y install ntp"
           

複制

3.cm機器配置時鐘與自己同步

[root@ ip-172-31-2-24 shell]# vim /etc/ntp.conf
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.叢集其它節點,配置找cm機器去同步

[root@ip-172-31-11-232 ~]# vim /etc/ntp.conf
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst
server 172.31.2.24
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

5.重新開機所有機器的ntp服務

[root@ ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "systemctl restart ntpd"
[root@ ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "systemctl enable ntpd"
[root@ ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "systemctl status ntpd"
           

複制

6.驗證始終同步,在所有節點執行ntpq -p指令,如下使用腳本批量執行

[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "ntpq -p"
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

左邊出現*号表示同步成功。

2.5 設定swap

1.在所有機器執行以下指令以臨時設定swap為1,并即時生效

sh ssh_do_all.sh node.list "sysctl -a | grep vm.swappiness"
sh ssh_do_all.sh node.list "echo 1 > /proc/sys/vm/swappiness"
sh ssh_do_all.sh node.list "sysctl -a | grep vm.swappiness"
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

確定最後swap列印應該都為1

2.為所有機器永久設定swap為1,修改/etc/sysctl.conf中vm.swappiness為1,沒有則新增。

[root@ip-172-31-2-24 ~]# vim /etc/sysctl.conf
vm.swappiness = 1
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

将/etc/sysctl.conf檔案同步到叢集所有機器

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.6 設定透明大頁面

1.所有節點執行以下指令關閉透明大頁面,并即時生效

sh ssh_do_all.sh node.list "echo never > /sys/kernel/mm/transparent_hugepage/defrag"
sh ssh_do_all.sh node.list  "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
sh ssh_do_all.sh node.list  "cat /sys/kernel/mm/transparent_hugepage/enabled"
sh ssh_do_all.sh node.list "cat /sys/kernel/mm/transparent_hugepage/defrag"
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.修改所有節點的/etc/rc.d/rc.local檔案的權限以實作開機執行

[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "chmod +x /etc/rc.d/rc.local"
[root@ip-172-31-2-24 shell]# sh ssh_do_all.sh node.list "ls -l /etc/rc.d/rc.local"
           

複制

3.在所有節點的/etc/rc.d/rc.local檔案中新增如下内容,以實作開機自動關閉透明大頁面。

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

将該檔案同步到所有節點

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.7 配置作業系統repo

Fayson用的是AWS的環境,這步是可以省略的,放在這裡供實體機部署的兄弟們參考。

1.挂載作業系統iso檔案

[root@ip-172-31-2-24 ~]$ sudo mkdir /media/DVD1
[root@ip-172-31-2-24 ~]$ sudo mount -o loop 
CentOS-7-x86_64-DVD-1611.iso /media/DVD1/
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.配置作業系統repo

[root@ip-172-31-2-24 ~]$ sudo vim /etc/yum.repos.d/local_os.repo
[local_iso]    
name=CentOS-$releasever - Media
baseurl=file:///media/DVD1
gpgcheck=0
enabled=1
[root@ip-172-31-2-24 ~]$ sudo yum repolist
           

複制

2.8 安裝httpd服務

1.安裝httpd服務

[root@ip-172-31-2-24 shell]# yum -y install httpd
           

複制

2.啟動httpd服務

[root@ip-172-31-2-24 shell]# systemctl start httpd
           

複制

3.安裝完httpd後,重新制作作業系統repo,換成http的方式友善其它伺服器也可以通路

[root@ip-172-31-2-24 ~]$ mkdir /var/www/html/iso
[root@ip-172-31-2-24 ~]$ scp -r /media/DVD1/* /var/www/html/iso/
[root@ip-172-31-2-24 ~]$ vim /etc/yum.repos.d/os.repo 
[osrepo]
name=os_repo
baseurl=http:// 172.31.2.24/iso/
enabled=true
gpgcheck=false
[root@ip-172-31-2-24 ~]$ yum repolist
           

複制

4.修改/etc/httpd/conf/httpd.conf配置檔案,在<IfModule mime_module>中修改以下内容

AddType application/x-gzip .gz .tgz .parcel
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

5.儲存httpd.conf的修改,并重新開機httpd服務

[root@ip-172-31-2-24 java]# systemctl restart httpd
           

複制

2.9 安裝MariaDB

1.安裝MariaDB

[root@ip-172-31-2-24 ~]# yum -y install mariadb
[root@ip-172-31-2-24 ~]# yum -y install mariadb-server           

複制

2.啟動并配置MariaDB

[root@ip-172-31-2-24 ~]# systemctl start mariadb
[root@ip-172-31-2-24 ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@ip-172-31-2-24 ~]# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
           

複制

3.建立CM,Hive等需要的表

[root@ip-172-31-2-24 shell]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database metastore default character set utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER 'hive'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON metastore. * TO 'hive'@'%';
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> create database cm default character set utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER 'cm'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON cm. * TO 'cm'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> create database rm default character set utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER 'rm'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON rm. * TO 'rm'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> create database hue default character set utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER 'hue'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON hue. * TO 'hue'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> create database oozie default character set utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER 'oozie'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON oozie. * TO 'oozie'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create database ranger default character set utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER 'rangeradmin'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON ranger. * TO 'rangeradmin'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
           

複制

4.安裝JDBC驅動

[root@ip-172-31-2-24 shell]# mkdir -p /usr/share/java/
[root@ip-172-31-2-24 shell]# cd
[root@ip-172-31-2-24 ~]# mv mysql-connector-java-5.1.34.jar /usr/share/java/
[root@ip-172-31-2-24 ~]# cd /usr/share/java
[root@ip-172-31-2-24 java]# chmod 777 mysql-connector-java-5.1.34.jar
[root@ip-172-31-2-24 java]# ln -s mysql-connector-java-5.1.34.jar mysql-connector-java.jar
[root@ip-172-31-2-24 java]# ll
total 940
-rwxrwxrwx. 1 root root 960372 Nov 23 15:27 mysql-connector-java-5.1.34.jar
lrwxrwxrwx. 1 root root     31 Nov 23 15:28 mysql-connector-java.jar -> mysql-connector-java-5.1.34.jar
           

複制

Cloudera Manager安裝

3.1 配置本地repo源

1.下載下傳CM7.0.3的安裝包,位址為:

http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/cloudera-manager-agent-7.0.3-1635136.el7.x86_64.rpm
http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/cloudera-manager-daemons-7.0.3-1635136.el7.x86_64.rpm
http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/cloudera-manager-server-7.0.3-1635136.el7.x86_64.rpm
http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/cloudera-manager-server-db-2-7.0.3-1635136.el7.x86_64.rpm
http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/enterprise-debuginfo-7.0.3-1635136.el7.x86_64.rpm
http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/openjdk8-8.0+232_9-cloudera.x86_64.rpm
http://archive.cloudera.com/cm7/7.0.3/allkeys.asc
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.下載下傳CDH7.0.3的安裝包,位址為:

http://archive.cloudera.com/cdh7/7.0.3.0/parcels/CDH-7.0.3-1.cdh7.0.3.p0.1635019-el7.parcel
http://archive.cloudera.com/cdh7/7.0.3.0/parcels/CDH-7.0.3-1.cdh7.0.3.p0.1635019-el7.parcel.sha256
http://archive.cloudera.com/cdh7/7.0.3.0/parcels/manifest.json
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

3.将Cloudera Manager安裝需要的6個rpm包以及一個asc檔案下載下傳到本地,放在同一目錄,執行createrepo指令生成rpm中繼資料。

[root@ip-172-31-2-24 cm7.0]# createrepo .
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.配置Web伺服器

将上述cdh7.0/cm7.0目錄移動到/var/www/html目錄下, 使得使用者可以通過HTTP通路這些rpm包。

[root@ip-172-31-2-24 ~]# mv cm7.0/ cdh7.0/ /var/www/html/
[root@ip-172-31-2-24 ~]# cd /var/www/html/
[root@ip-172-31-2-24 html]# ll  *7.0
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

驗證浏覽器能否正常通路

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

5.制作Cloudera Manager的repo源

[root@ip-172-31-2-24 yum.repos.d]# vim cm.repo
[cmrepo]
name = cm_repo
baseurl = http://172.31.2.24/cm7.0
enable = true
gpgcheck = false
[root@ip-172-31-2-24 yum.repos.d]# yum repolist
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

6.驗證安裝JDK

[root@ip-172-31-2-24 yum.repos.d]# yum -y install openjdk8-8.0+232_9-cloudera
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

3.2 安裝Cloudera Manager Server

1.通過yum安裝Cloudera Manager Server

[root@ip-172-31-2-24 java]# yum -y install cloudera-manager-server
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.初始化資料庫

[root@ip-172-31-2-24 java]# /opt/cloudera/cm/schema/scm_prepare_database.sh mysql cm cm password
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

3.啟動Cloudera Manager Server

[root@ip-172-31-2-24 ~]# systemctl start cloudera-scm-server
[root@ip-172-31-2-24 ~]# systemctl status cloudera-scm-server
           

複制

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.檢查端口是否監聽

[root@ip-172-31-2-24 ~]# netstat -lnpt | grep 7180
tcp        0      0 0.0.0.0:7180            0.0.0.0:*               LISTEN      22048/java
           

複制

5.通過http://cm_ip:7180/cmf/login通路CM

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

注意:完全啟動成功需要幾分鐘時間。

CDH安裝

4.1 CDH叢集安裝向導

1.admin/admin登入到CM,選擇60天試用,點選繼續

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.點選繼續

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

3.點選“繼續”,輸入叢集名稱,可以使用預設的“Cluster 1”。

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.輸入主機IP或者名稱,點選搜尋找到主機後點選繼續

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

5.選擇自定義存儲庫,輸入cm的http位址

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

“CDH and other software”中選擇“Parcel Repositories & Network Settings”,點選“ 更多選項”,點選“-”删除其它所有位址,輸入http://172.31.2.24/cdh7.0,點選“儲存更改”

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

點選Save & Verify Configuration,驗證通過,點選關閉

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

點選“繼續”

6.選擇Install a Cloudera-provided version of OpenJDK,點選繼續

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

7.進入下一步配置ssh賬号密碼,確定所有機器的root密碼都一緻,然後輸入root的密碼即可。

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

8.點選“繼續”,進入下一步,安裝Cloudera Manager相關到各個節點

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

等待Agent安裝完畢後,自動跳轉到下一步開始分發Parcel

9.點選“繼續”,進入下一步安裝cdh到各個節點

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

10.點選Inspect Network Performance和Inspect Hosts,檢查主機

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

如果有錯誤或者黃色警告,檢視“顯示檢查器結果”,并逐項解決,然後“重新運作”檢查,直到所有的檢查都通過,否則沒辦法點選繼續下一步。

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.2 叢集設定安裝向導

1.選擇需要安裝的服務,根據需要選擇,這裡随便選擇Data Mart,也可以自定義服務

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

2.點選“繼續”,進入叢集角色配置設定,一台機器作為管理節點,另外三台機器作為DataNode

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

注意:Activity Monitor和Telemetry Publisher不用選擇任何主機,留白,即不安裝,因為用不到。

3.點選“繼續”,進入下一步,測試資料庫連接配接

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.測試成功,點選繼續。設定Range相關參數。

首先輸入CM的使用者名和密碼admin/admin

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

以下4個密碼,都需要包含至少一個字母與一個數字,為了安裝友善都輸入admin@123

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

最後是Ranger的MySQL相關的配置

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

點選繼續

5.進入目錄設定,此處使用預設目錄,根據實際情況進行目錄修改,但請注意将Ranger的資料庫改為MySQL

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

6.點選“繼續”,進入各個服務啟動

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

7.安裝成功後進入home管理界面

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

4.3 元件版本檢查

0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3
0733-7.0.3-如何在Redhat7.6中安裝CDP DC7.0.3

可以看到Hadoop3.1.1,HBase2.2,Hive3.1,Spark2.4,Hue4.5,Impala3.2,Kafka2.3.0,Kudu1.11,Oozie5.1,Senty2.1,Solr7.4,Sqoop1.4.7,Zookeeper3.5.5等。

總結

1.從安裝方式上來看,CDP DC7.0.3與CDH6變化不大,這也友善了CDH的使用者可以較為快速的遷移到CDP DC7,以及适應CDP DC7的安裝與使用。

2.安裝條件前置沒有任何變化,包括防火牆,SELinux關閉,ntp同步等等。可以參考Fayson之前的文章《CDH安裝前置準備》

3.Cloudera Manager自帶的JDK直接提供的是OpenJDK1.8,而不是Oracle JDK,同樣CDP DC也不再支援JDK1.7。

4.與安裝CDH6一樣,CM的安裝除了下載下傳rpm包以外,還要下載下傳allkeys.asc檔案,否則安裝agent的時候會報錯。

5.對于離線安裝CDH6.x,分發Parcel出現hash校驗失敗的問題,是因為在CM6中修複了一個bug,讓它不再忽略由http伺服器發送的“Content-Encoding”的header資訊,但是我們在Redhat中安裝的httpd服務,當它傳輸parcel檔案時,預設會錯誤的設定“Content-Encoding”。于是CM server會錯誤的認為parcel檔案已經被httpd壓縮并嘗試解壓縮。是以會導緻失敗。解決辦法是參考2.8章節的,設定httpd的conf檔案,AddType application/x-gzip .gz .tgz .parcel,然後重新開機httpd服務和CM服務。這個問題在beta的時候就已經存在了,具體請參考《0350-Redhat7.4安裝CDH6.0_beta1時分發Parcel異常分析》

6.在建立中繼資料庫時,不需要再建立Navigator和Sentry相關的中繼資料庫,但需要建立Ranger服務相關的中繼資料庫。

7.第一次啟動Ranger服務時,建立x_portal_user表時會報以下錯誤:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
SQLException : SQL state: 42000 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes ErrorCode: 1071
2019-11-24 01:12:06,672  [E] ranger_core_db_mysql.sql file import failed!           

複制

這是因為索引建立的時候,字元長度超過255,由于utf-8字元最長隻能為255,超長之後會報錯,是以需要對MySQL做如下配置:

SET GLOBAL innodb_file_per_table = ON,
           innodb_file_format = Barracuda,
           innodb_large_prefix = ON;
           

複制

參考:

https://stackoverflow.com/questions/29676724/1071-specified-key-was-too-long-max-key-length-is-767-bytes           

複制