操做系統: 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
vim /etc/hosts
複製代碼
加上以下兩行(兩臺主機一樣操做):bash
192.168.132.140 cdh01
192.168.132.141 cdh02
複製代碼
兩臺主機上均一下運行,出現提示一直回車便可微信
ssh-keygen
複製代碼
在cdh01主機上運行:ssh
ssh-copy-id cdh02
複製代碼
在cdh02主機上運行:
ssh-copy-id cdh01
複製代碼
service ntpd start
複製代碼
[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)
複製代碼
mkdir /opt/cloudera-manager
複製代碼
tar -zxvf cloudera-manager-el6-cm5.7.1_x86_64.tar.gz -C /opt/cloudera-manager
複製代碼
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/
複製代碼
vim /opt/cloudera-manager/cm-5.7.1/etc/cloudera-scm-agent/config.ini
複製代碼
# Hostname of the CM server.
server_host=cdh01
複製代碼
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下
mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
複製代碼
安裝並啓動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-connector-java-5.1.35.jar放到/opt/cloudera-manager/cm-5.7.1/share/cmf/lib目錄下
/opt/cloudera-manager/cm-5.7.1/share/cmf/schema/scm_prepare_database.sh mysql -hcdh02 -uroot -p你的密碼 --scm-host cdh02 scmdbn root 你的密碼
複製代碼
/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
複製代碼
mkdir /opt/cloudera-manager
複製代碼
tar -zxvf cloudera-manager-el6-cm5.7.1_x86_64.tar.gz -C /opt/cloudera-manager
複製代碼
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
複製代碼
vim /opt/cloudera-manager/cm-5.7.1/etc/cloudera-scm-agent/config.ini
複製代碼
# Hostname of the CM server.
server_host=cdh01
複製代碼
mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
複製代碼
/opt/cloudera-manager/cm-5.7.1/etc/init.d/cloudera-scm-agent start
複製代碼
關注微信公衆號
"Kooola大數據"
聊人生|聊技術