0002-CENTOS7.2安裝CDH5.10和Kudu1.2(一)

1 概述

本文檔描述CENTOS7.2操做系統部署CDH企業版的過程。Cloudera企業級數據中心的安裝主要分爲4個步驟:html

1.集羣服務器配置,包括安裝操做系統、關閉防火牆、同步服務器時鐘等;java

2.外部數據庫安裝node

3.安裝Cloudera管理器;mysql

4.安裝CDH集羣;linux

  1. 集羣完整性檢查,包括HDFS文件系統、MapReduce、Hive等是否能夠正常運行。

這篇文檔將着重介紹Cloudera管理器與CDH的安裝,並基於如下假設:sql

  1. 操做系統版本:CENTOS7.2
  2. MariaDB數據庫版本爲10.2.1
  3. CM版本:CDH 5.10.0
  4. CDH版本:CDH 5.10.0

5.採用ec2-user對集羣進行部署shell

6.您已經下載CDH和CM的安裝包數據庫

2 前期準備

2.1 hostname及hosts配置

集羣中各個節點之間能互相通訊使用靜態IP地址。IP地址和主機名經過/etc/hosts配置,主機名/etc/hostname進行配置。apache

以cm節點(172.31.2.159)爲例:centos

  • hostname配置

/etc/hostname文件以下:

| ip-172-31-2-159 |

|:----|

或者你能夠經過命令修改當即生效

| ec2-user@ip-172-31-2-159 ~$ sudo hostnamectl set-hostname ip-172-31-2-159 |

|:----|

注意:這裏修改hostname跟REDHAT6的區別

  • hosts配置

/etc/hosts文件以下:

| 172.31.2.159 ip-172-31-2-159172.31.12.108 ip-172-31-12-108172.31.5.236 ip-172-31-5-236172.31.7.96 ip-172-31-7-96 |

|:----|

以上兩步操做,在集羣中其它節點作相應配置。

2.2 禁用SELinux

在全部節點執行sudo setenforce 0 命令,此處使用批處理shell執行:

| ec2-user@ip-172-31-2-159 ~$ sh ssh_do_all.sh node.list "sudo setenforce 0" |

|:----|

集羣全部節點修改/etc/selinux/config文件以下:

| SELINUX=disabledSELINUXTYPE=targeted |

|:----|

2.3 關閉防火牆

集羣全部節點執行 sudo systemctl stop命令,此處經過shell批量執行命令以下:

2.4 集羣時鐘同步

在CentOS7.2的操做系統上,已經默認的安裝了chrony,配置chrony時鐘同步,將cm(172.31.2.159)服務做爲本地chrony服務器,其它3臺服務器與其保持同步,配置片斷:

  • 172.31.2.159配置與本身同步

  • 集羣其它節點:在註釋下增長以下配置

  • 重啓全部機器的chrony服務

| ec2-user@ip-172-31-2-159 ~$ sh ssh_do_all.sh node.list "sudo systemctl restart chronyd" |

|:----|

  • 驗證始終同步,在全部節點執行chronycsources命令,以下使用腳本批量執行

| ec2-user@ip-172-31-2-159 ~$ sh ssh_do_all.sh node.list "chronyc sources" |

|:----|

2.5 配置操做系統repo

  • 掛載操做系統iso文件

  • 配置操做系統repo

2.6 安裝http服務

  • 安裝httpd服務

| ec2-user@ip-172-31-2-159 ~$ sudo yum -y install httpd |

|:----|

  • 啓動或中止httpd服務

| ec2-user@ip-172-31-2-159 ~$ sudo systemctl start httpdec2-user@ip-172-31-2-159 ~$ sudo systemctl stop httpd |

|:----|

  • 安裝完httpd後,從新制做操做系統repo,換成http的方式方便其它服務器也能夠訪問

2.7 安裝MariaDB

MariaDB-10.2.1-centos7-x86\_64-client.rpm
MariaDB-10.2.1-centos7-x86\_64-common.rpm
MariaDB-10.2.1-centos7-x86\_64-compat.rpm
MariaDB-10.2.1-centos7-x86\_64-server.rpm

將包下載到本地,放在同一目錄,執行createrepo命令生成rpm元數據。

此處使用apache2,將上述mariadb10.2.1目錄移動到/var/www/html目錄下, 使得用戶能夠經過HTTP訪問這些rpm包。

  • 啓動並配置MariaDB
[ec2-user@ip-172-31-2-159 ~]$ sudo systemctl  start mariadb

[ec2-user@ip-172-31-2-159 ~]$ sudo /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 fo

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 fa

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!
  • 創建CM和Hive須要的表

  • 安裝jdbc驅動

3 Cloudera Manager安裝

3.1 配置本地repo源

將Cloudera Manager安裝須要的7個rpm包下載到本地,放在同一目錄,執行createrepo命令生成rpm元數據。

  • 配置Web服務器

此處使用apache2,將上述cdh5.10.0/cm5.10.0目錄移動到/var/www/html目錄下, 使得用戶能夠經過HTTP訪問這些rpm包。

| ec2-user@ip-172-31-2-159 ~$ sudo mv cdh5.10.0/ cm5.10.0/ /var/www/html/ |

|:----|

3.2 安裝Cloudera Manager Server

  • 經過yum安裝ClouderaManager Server

| ec2-user@ip-172-31-2-159 ~$ sudo yum -y install cloudera-manager-server |

|:----|

  • 初始化數據庫

  • 啓動ClouderaManager Server

| ec2-user@ip-172-31-2-159 ~$ sudo systemctl start cloudera-scm-server |

|:----|

  • 檢查端口是否監聽

| ec2-user@ip-172-31-2-159 ~$ sudo netstat -lnpt | grep 7180tcp 0 0 0.0.0.0:7180 0.0.0.0:* LISTEN 6890/java |

|:----|

4 CDH安裝

4.1 CDH集羣安裝嚮導

  1. admin/admin登陸到CM
  2. 贊成license協議,點擊繼續

3.選擇60試用,點擊繼續

4.點擊「繼續」

5.輸入主機ip或者名稱,點擊搜索找到主機後點擊繼續

6.點擊「繼續」

7.使用parcel選擇,點擊「更多選項」,點擊「-」刪除其它全部地址,輸入

http://172.31.2.159/cm5.10.0/點擊「保存更改」

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

9.點擊「繼續」,進入下一步安裝jdk

10.點擊「繼續」,進入下一步,默認多用戶模式

11.點擊「繼續」,進入下一步配置ssh帳號密碼

12.點擊「繼續」,進入下一步,安裝Cloudera Manager相關到各個節點

13.點擊「繼續」,進入下一步安裝cdh到各個節點

14.點擊「繼續」,進入下一步主機檢查,確保全部檢查項均經過

點擊完成進入服務安裝嚮導。

4.2 集羣設置安裝嚮導

  1. 選擇須要安裝的服務

2.點擊「繼續」,進入集羣角色分配

3.點擊「繼續」,進入下一步,測試數據庫鏈接

4.測試成功,點擊「繼續」,進入目錄設置,此處使用默認默認目錄,根據實際狀況進行目錄修改

5.點擊「繼續」,進入各個服務啓動

6.安裝成功

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

「醉酒鞭名馬,少年多浮誇! 嶺南浣溪沙,嘔吐酒肆下!摯友不願放,數據玩的花!」

相關文章
相關標籤/搜索