Cloudera Manager(CDH)入門系列之三 (安裝)

請輸入圖片描述

操做系統: CentOs6.4 虛擬機(4核 3G)java

主機: cdh01(server & agent) + cdh02( agent )mysql

CDH版本:cdh5.7.1linux

jdk8sql


準備工做

關閉防火牆

在兩臺主機上都運行一下命令shell

service iptables stop
複製代碼

設置主機名

vim /etc/sysconfig/network
複製代碼

將HOSTNAME 分別改爲cdh01和cdh02:json

NETWORKING=yes
HOSTNAME=cdh01
複製代碼

重啓生效 service network restartvim

修改/etc/hosts

vim /etc/hosts
複製代碼

加上以下兩行(兩臺主機一樣操做):bash

192.168.132.140 cdh01
192.168.132.141 cdh02
複製代碼

設置ssh免密登錄

兩臺主機上均一下運行,出現提示一直回車便可微信

ssh-keygen
複製代碼

在cdh01主機上運行:ssh

ssh-copy-id cdh02
複製代碼

在cdh02主機上運行:

ssh-copy-id cdh01
複製代碼

開啓時間同步(每臺)

service ntpd start
複製代碼

jdk安裝

[root@localhost opt]# rpm -ivh jdk-8u45-linux-x64.rpm
[root@localhost opt]# java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
複製代碼

CM安裝

Server端安裝

建立目錄

mkdir /opt/cloudera-manager
複製代碼

解壓CM到/opt/cloudera-manager目錄

tar -zxvf cloudera-manager-el6-cm5.7.1_x86_64.tar.gz -C /opt/cloudera-manager
複製代碼

建立cloudera-scm用戶

useradd --system --home=/opt/cloudera-manager/cm-5.7.1/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
複製代碼

建立本地元數據存放目錄

mkdir /var/cloudera-scm-server
複製代碼

修改文件夾所屬用戶

chown cloudera-scm:cloudera-scm /var/cloudera-scm-server/
chown cloudera-scm:cloudera-scm /opt/cloudera-manager/
複製代碼

修改配置文件,設置CM server host

vim /opt/cloudera-manager/cm-5.7.1/etc/cloudera-scm-agent/config.ini
複製代碼
# Hostname of the CM server.
server_host=cdh01
複製代碼

建立parcel-repo倉庫目錄

mkdir -p /opt/cloudera/parcel-repo
複製代碼

將 CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel, CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel.sha, manifest.json 三個文件拷到/opt/cloudera/parcel-repo下

建立parcels目錄並改變所屬用戶

mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
複製代碼

mysql安裝及配置

安裝並啓動mysql

yum -y install mysql mysql-server mysql-devel
service mysql start
複製代碼

登錄、設置root密碼、開放遠程登錄權限

mysql -u root
mysql> use mysql;
mysql> update user set password='你的密碼' where user='root';
mysql> grant all privileges on *.* to 'root'@'%' identified by '你的密碼' with grant option;
複製代碼

mysql driver包

mysql-connector-java-5.1.35.jar放到/opt/cloudera-manager/cm-5.7.1/share/cmf/lib目錄下

初始化mysql

/opt/cloudera-manager/cm-5.7.1/share/cmf/schema/scm_prepare_database.sh mysql -hcdh02 -uroot -p你的密碼 --scm-host cdh02 scmdbn root 你的密碼
複製代碼

啓動Server、Agent

/opt/cloudera-manager/cm-5.7.1/etc/init.d/cloudera-scm-server start
/opt/cloudera-manager/cm-5.7.1/etc/init.d/cloudera-scm-agent start
複製代碼

驗證

訪問 http://ip:7180

Agent端安裝

建立目錄

mkdir /opt/cloudera-manager
複製代碼

解壓CM到/opt/cloudera-manager目錄

tar -zxvf cloudera-manager-el6-cm5.7.1_x86_64.tar.gz -C /opt/cloudera-manager
複製代碼

建立cloudera-scm用戶

useradd --system --home=/opt/cloudera-manager/cm-5.7.1/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
複製代碼

修改配置文件,設置CM server host

vim /opt/cloudera-manager/cm-5.7.1/etc/cloudera-scm-agent/config.ini
複製代碼
# Hostname of the CM server.
server_host=cdh01
複製代碼

建立parcels目錄並改變所屬用戶

mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
複製代碼

Agent啓動

/opt/cloudera-manager/cm-5.7.1/etc/init.d/cloudera-scm-agent start
複製代碼

關注微信公衆號 "Kooola大數據" 聊人生|聊技術
相關文章
相關標籤/搜索