Centos7搭建CDH6.0.1(單機版)

1、前言。java

學習大數據組件,最好的方式是直接參照官網。不過官網的教程也讓我吃了一坑,在此記錄一下。因在我的筆記本資源有限,在此安裝爲單機版安裝mysql

2、搭建。linux

 

1.1配置主機名sql

hostnamectl set-hostname cdhdocker

1.2配置hosts文件數據庫

vi /etc/hosts以後進行編輯,加入本機的ip映射關係(非單機時,有多個ip時,均加進來json

192.168.159.133 cdh瀏覽器

1.3關閉selinux服務器

setenforce 0ssh

1.4關閉防火牆

systemctl stop firewalld.service

systemctl disable firewalld.service

1.5配置免密登陸

ssh-keygen (後面一路回車就行)

ssh-copy-id cdh(cdh爲主機名,非單機時有多個ip時,則執行屢次進行免密配置)

1.6配置時間同步(時間服務器使用已有的,在此不介紹時間服務器的搭建1)yum install nt2)vi /etc/ntp.conf加入如下內容server 0.pool.ntp.org

3)sudo systemctl start ntpd
4)
sudo systemctl enable ntpd
5)
ntpdate -u 0.pool.ntp.org
6)hwclock --systohc

1.7安裝JDK
1)下載jdk
2)將jdk放至/usr/java/目錄下(必定要放至此目錄下,不然Clouder-Manager啓動會失敗!!!)
3)解壓並配置JAVA_HOME與PATH環境變量
4)導入TLS
1.8安裝Mysql(採用docker安裝)
1)安裝docker
 yum install docker
system enable docker
vi /etc/docker/daemons.json並加入加速鏡像地址
system start docker{"registry-mirrors": ["http://hub-mirror.c.163.com"]}
2)安裝mysql
docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -d --restart=always -p 3306:3306 mysql:5.6
3)建庫
CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'scm@123';
CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'rman@123';
CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'hue@123';
CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON metastore.* TO 'metastore'@'%' IDENTIFIED BY 'metastore@123';
CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'sentry@123';
CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'nav@123';
CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'navms@123';
CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie@123';
1.9設置數據庫
格式爲:/opt/cloudera/cm/schema/scm_prepare_database.sh [options] -h <hostname> <databaseType> <databaseName> <username> <password>
執行時:/opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h cdh  scm root root

2.0安裝Cloudera Manager
下載地址: https://archive.cloudera.com/cm6/6.0.1/redhat7/yum/RPMS/x86_64/
下載

  1.cloudera-manager-daemons-6.0.1-610811.el7.x86_64.rpm
  2.cloudera-manager-server-6.0.1-610811.el7.x86_64.rpm
  3.cloudera-manager-agent-6.0.1-610811.el7.x86_64.rpm
執行rpm安裝: rpm -ivh cloudera-*
導入STL:JAVA_HOME=/usr/java/${jdk名稱} /opt/cloudera/cm-agent/bin/certmanager setup --configure-services

單機版時執行:
  systemctl start cloudera-scm-server
  查看日誌:tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
  顯示以下表示服務已經正常起來:INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
  vi /etc/cloudera-scm-agent/config.ini,修改server_host=cdh
  啓動cloudera-scm-agent服務:systemctl start cloudera-scm-agent
  查看cloudera-scm-agent狀態:systemctl status cloudera-scm-agent
  查看cloudera-scm-agent日誌:tail -f /var/log/cloudera-scm-agent/cloudera-scm-agent.log
多機版時:
  在server端執行cloudera-scm-server與cloudera-scm-agent操做
  在agent端只執行cloudera-scm-agent操做

2.1配置CDH
Cloudera Manager Server啓動起來之後就能夠登陸Web界面進行CDH的安裝配置工做了。
在瀏覽器中輸入 http://192.168.1.101:7180,默認用戶名與密碼均爲:admin
2.2以後按本身的安裝須要去安裝大數據組件便可,就不一一介紹了。
相關文章
相關標籤/搜索