[关闭]
@zhangyy 2020-08-09T11:05:46.000000Z 字数 6145 阅读 203

如何在Redhat7.7中安装CDP DC7.0.3

大数据平台构建


  • 一:关于CDP DC 7.0.3 概述
  • 二: 系统环境初始化
  • 三: 构建CDP DC 7.0.3

一: 关于CDP DC 7.0.3 概述

1.1 CDP dc 7.0.3

  1. CDP DC7.0.3ClouderaHortonworks合并后,第一个融合CDHHDP所有组件的on-premise版本,CDP Data Center主要由Cloudera Runtime构成,Cloudera Runtime由超过35个开源项目组成,当然CDP Data Center还包括其它功能如管理功能Cloudera ManagerKey Management,专业支持等,如下图所示:

image_1e3mfkh9g13vi13c8a0a5prrmc9.png-748.6kB

1.2 Cloudera Runtime的主要组件版本如下图所示:

image_1e3mfuobeatb1935jb99io17orm.png-146.7kB

二: 系统环境初始化

2.1 系统环境介绍

  1. OS: rhel7.7x64
  2. cat /etc/hosts
  3. ---
  4. 192.168.100.21 rhel01.flyfish
  5. 192.168.100.22 rhel02.flyfish
  6. 192.168.100.23 rhel03.flyfish
  7. 192.168.100.24 rhel04.flyfish
  8. 192.168.100.25 rhel05.flyfish
  9. 192.168.100.26 rhel06.flyfish
  10. ---
  11. 本次采用 前四台 机器

image_1e3mg7g6gtf41ieafiuh61qut1g.png-39.7kB

image_1e3mg5npfrblloc1ja4acn19u813.png-40.8kB

2.2 无密钥登录配置

  1. root用户无密钥认证
  2. ssh-keygen ---一直敲回车到最后
  3. cat id_rsa.pub >> authorized_keys
  4. 将所有的公钥导入authorized_keys 分发到 所有的 机器的.ssh/ 下面
  5. 然后测试

image_1e3mgsn6s213cl4175l1odjnjj1t.png-115.9kB


2.3关闭 firewalld,iptables 与 selinux

  1. 所有节点都要配置:
  2. yum install -y firewall* iptable*
  3. (1) 关闭firewalld
  4. systemctl stop firewalld.service
  5. systemctl disable firewalld.service
  6. firewall-cmd --state
  7. (2) 关闭iptables
  8. iptables -F
  9. systemctl stop iptables.service
  10. service iptables save
  11. systemctl disable iptables.service
  12. (3) 禁用 selinux
  13. sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
  14. setenforce 0
  15. getenforce 0
  16. sestatus
  17. 重启机器
  18. reboot

image_1e3mh5q0f1qgi1vjm8c61604sng2q.png-216.5kB


2.4 所有机器更改RHEL7.7X64的文件句柄数

  1. vim /etc/security/limits.conf
  2. ---
  3. * soft nofile 65535
  4. * hard nofile 1029345
  5. * soft nproc unlimited
  6. * hard nproc unlimited
  7. * soft memlock unlimited
  8. * hard memlock unlimited
  9. ---

image_1e3mhnvi91l92no1kogsbh1er837.png-98.3kB

  1. ansible cdh7 -m copy -a "src=/etc/security/limits.conf dest=/etc/security/"

image_1e3muuec7ivqaad1oftl0hif893.png-133.2kB

image_1e3muv02o12601fu51c5i4tc1b459g.png-135.9kB


2.5 时间同步:

  1. 所有机器 yum install chrony*
  2. 1. rhel01.flyfish:
  3. vim /etc/chrony.conf 增加
  4. ----
  5. 注释掉相关默认的server
  6. server ntp1.aliyun.com iburst
  7. allow 192.168.100.0/24
  8. service chronyd start
  9. chkconfig chronyd on
  10. 2. rhel02.flyfish----rhel04.flyfish 同步rhel01.flyfish
  11. vim /etc/chrony.conf
  12. ----
  13. 注释掉默认的server
  14. server 192.168.100.21 iburst
  15. ----
  16. service chronyd stop
  17. service chronyd start
  18. chkconfig chronyd on

image_1e3mjvngm1i9c1vgg256o9q19ac4r.png-193.9kB

image_1e3mk79o01b3610gjie1ul14p66s.png-113.5kB

image_1e3mk162i1up21fru9r1ng81nhj58.png-92kB

image_1e3mk5gevaql1tq912dmulalnf5l.png-147.8kB

image_1e3mk5tt319m39mg1eq0hkq1r0t62.png-93.4kB

image_1e3mk6g5250316dqderc35u1m6f.png-103.8kB


2.7 cdp dc 7.0.3 安装所需文件下载

  1. CM rpm包:
  2. ---
  3. cloudera-manager-agent-7.0.3-1635136.el7.x86_64.rpm
  4. cloudera-manager-daemons-7.0.3-1635136.el7.x86_64.rpm
  5. cloudera-manager-server-7.0.3-1635136.el7.x86_64.rpm
  6. cloudera-manager-server-db-2-7.0.3-1635136.el7.x86_64.rpm
  7. enterprise-debuginfo-7.0.3-1635136.el7.x86_64.rpm
  8. openjdk8-8.0+232_9-cloudera.x86_64.rpm
  9. allkeys.asc
  10. 下载地址:
  11. http://archive.cloudera.com/cm7/7.0.3/redhat7/yum/RPMS/x86_64/
  12. http://archive.cloudera.com/cm7/7.0.3/allkeys.asc
  13. ----
  14. cdh7.0.3 parcel
  15. --
  16. CDH-7.0.3-1.cdh7.0.3.p0.1635019-el7.parcel
  17. CDH-7.0.3-1.cdh7.0.3.p0.1635019-el7.parcel.sha256
  18. manifest.json
  19. 下载地址:
  20. http://archive.cloudera.com/cdh7/7.0.3.0/parcels/
  21. ---

image_1e3mpiorp1js68b15m61ti3a8c7c.png-171.6kB

2.8 设置swap

  1. 将所有的swap1,并即时生效
  2. ansible cdh7 -m shell -a "echo '1' > /proc/sys/vm/swappiness"
  3. ansible cdh7 -m shell -a "sysctl -a | grep vm.swappiness"

image_1e3muoi8h3l61t758mr7rq1r0289.png-54.1kB

image_1e3mupfkd1bvr1epk1m61oms1nh98m.png-256.7kB

  1. vim /etc/sysctl.conf
  2. ----
  3. 最后加上:
  4. vm.swappiness = 1
  5. ----
  6. sysctl -p

image_1e3mv57c91gu4bl6199g9rl7toad.png-145.1kB

image_1e3mv60io1a0ecu01qlrko312cba.png-167.9kB

image_1e3o6k4ij1jkk10l1o02dpp1calbn.png-177.2kB

2.8 设置最大透明数

  1. ansible cdh7 -m shell -a "echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag"
  2. ansible cdh7 -m shell -a "echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled"
  3. ansible cdh7 -m shell -a "cat /sys/kernel/mm/transparent_hugepage/enabled"
  4. ansible cdh7 -m shell -a "cat /sys/kernel/mm/transparent_hugepage/defrag"

image_1e3o6s5g7oc01qn11kvdp72nrac4.png-221.7kB


  1. 修改所有节点的/etc/rc.d/rc.local文件的权限以实现开机执行
  2. ansible cdh7 -m shell -a "chmod +x /etc/rc.d/rc.local"
  3. vim /etc/rc.d/rc.local
  4. ---
  5. 最后加上:
  6. if test -f /sys/kernel/mm/transparent_hugepage/enabled;
  7. then
  8. echo never > /sys/kernel/mm/transparent_hugepage/enabled
  9. fi
  10. if test -f /sys/kernel/mm/transparent_hugepage/defrag;
  11. then
  12. echo never > /sys/kernel/mm/transparent_hugepage/defrag
  13. fi
  14. ---
  15. ansible cdh7 -m copy -a "src=/etc/rc.d/rc.local dest=/etc/rc.d/"
  16. ansible cdh7 -m shell -a "tail -f /etc/rc.d/rc.local"

image_1e3o7hup21an49u315meark13akch.png-178.6kB

image_1e3o7if7prj49jr13t6rio18alcu.png-155.1kB

image_1e3o7ivnhv13ha51gudgp31pqldb.png-125.8kB


2.9 配置httpd 服务器

  1. ansible rhel01.flyfish -m yum -a "state=present name=httpd"
  2. ansible rhel01.flyfish -m service -a "name=httpd state=started"
  3. ansible rhel01.flyfish -m shell -a "ps -ef |grep httpd"

image_1e3o87uq31vpp1iie11tr1b0216hido.png-53.9kB

image_1e3o88s3jbs91svfvhjro6uqbe5.png-158kB

image_1e3o89gtkskqq1etqb1o721l2rei.png-138.6kB


  1. 修改 /etc/httpd/conf/httpd.conf 在<IfModule mime_module>中修改以下内容
  2. vim /etc/httpd/conf/httpd.conf
  3. ---
  4. AddType application/x-compress .Z
  5. AddType application/x-gzip .gz .tgz .parcel
  6. ---
  7. service httpd restart

image_1e3o8ddst58bcds1j4h1o3a18ejev.png-121.6kB

image_1e3o8fu1tek114sm1h7pa06365fc.png-50.2kB

2.10 安装maridb 数据库

  1. yum install mariadb*
  2. service mariadb start
  3. chkonfig mariadb on
  4. mysql_secure_installation

image_1e3o8md7cuo8je115pl13191nt4fp.png-182kB

image_1e3o8niqoudh516beejjt1t2fgm.png-195.9kB

2.11 创建CM,Hive等需要的表

  1. vim cm.sql
  2. ----
  3. create database metastore default character set utf8;
  4. CREATE USER 'hive'@'%' IDENTIFIED BY 'password';
  5. GRANT ALL PRIVILEGES ON metastore. * TO 'hive'@'%';
  6. FLUSH PRIVILEGES;
  7. create database cm default character set utf8;
  8. CREATE USER 'cm'@'%' IDENTIFIED BY 'password';
  9. GRANT ALL PRIVILEGES ON cm. * TO 'cm'@'%';
  10. FLUSH PRIVILEGES;
  11. create database rm default character set utf8;
  12. CREATE USER 'rm'@'%' IDENTIFIED BY 'password';
  13. GRANT ALL PRIVILEGES ON rm. * TO 'rm'@'%';
  14. FLUSH PRIVILEGES;
  15. create database hue default character set utf8;
  16. CREATE USER 'hue'@'%' IDENTIFIED BY 'password';
  17. GRANT ALL PRIVILEGES ON hue. * TO 'hue'@'%';
  18. FLUSH PRIVILEGES;
  19. create database oozie default character set utf8;
  20. CREATE USER 'oozie'@'%' IDENTIFIED BY 'password';
  21. GRANT ALL PRIVILEGES ON oozie. * TO 'oozie'@'%';
  22. FLUSH PRIVILEGES;
  23. create database ranger default character set utf8;
  24. CREATE USER 'rangeradmin'@'%' IDENTIFIED BY 'password';
  25. GRANT ALL PRIVILEGES ON ranger. * TO 'rangeradmin'@'%';
  26. FLUSH PRIVILEGES;
  27. ----
  28. mysql -uroot -pflyfish225
  29. source cm.sql

image_1e3o93pdi52pa29inm1ipms21h3.png-198.6kB

image_1e3o948evds31h9e18rm1vb014l5hg.png-148.6kB

image_1e3o94qbsrri12onb4bivu9r5ht.png-55.1kB

2.12 安装JDBC驱动

  1. mkdir -p /usr/share/java/
  2. tar -zxvf mysql-connector-java-5.1.44.tar.gz
  3. mv mysql-connector-java-5.1.44-bin.jar /usr/share/java
  4. cd /usr/share/java/
  5. mv mysql-connector-java-5.1.44-bin.jar mysql-connector-java.jar
  6. chmod 777 mysql-connector-java.jar

image_1e3o99mbfv3e1beh1u08edf1preia.png-74.6kB

image_1e3o9dt0f1ais1khb11e61m75et0j7.png-248.6kB

image_1e3o9eak130phkg1d9j9u1368jk.png-45.8kB

三: 构建CDP DC 7.0.3

3.1 安装 jdk

  1. 所有节点 卸载系统自带jdk
  2. rpm -qa |grep jdk
  3. rpm -e java-1.8.0-openjdk-1.8.0.222.b03-1.el7.x86_64 copy-jdk-configs-3.3-10.el7_5.noarch java-1.8.0-openjdk-headless-1.8.0.222.b03-1.el7.x86_64 --nodeps
  4. yum -y install openjdk8-8.0+232_9-cloudera
  5. vim /etc/profile
  6. ---
  7. 到最后加上jdk 的环境变量
  8. export JAVA_HOME=/usr/java/jdk1.8.0_232-cloudera
  9. export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
  10. PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
  11. ----
  12. source /etc/profile
  13. java -version

image_1e3ob7je7194mb9v1m2p17ot1jj8m2.png-53.3kB

image_1e3ob8a74mt21bnham31ofao5tmf.png-59kB

image_1e3ob8od91e2l1rdk1l3rtld11mbms.png-52.3kB

image_1e3ob9607hp3kh91nct113u17osn9.png-55.8kB

3.2 配置cdh7.0.3 的源

  1. mv cdh7.0.3 cdh7
  2. cd cdh7
  3. createrepo .
  4. cd ..
  5. mv cdh7 /var/www/html/

image_1e3o9mqtmsiokhepp3op16gek1.png-166.6kB

image_1e3o9nb8q30pgfkm4pg2h1o9eke.png-221.8kB

image_1e3o9pagm18bu7c51002157q1i8gkr.png-349.9kB


  1. 制作Cloudera Managerrepo
  2. cd /etc/yum.repos.d/
  3. vim cdh.repo
  4. ---
  5. [cmrepo]
  6. name = cm_repo
  7. baseurl = http://192.168.100.21/cdh7/
  8. enable = true
  9. gpgcheck = false
  10. ---
  11. ansible cdh7 -m copy -a "src=/etc/repos.d/cdh7.repo dest=/etc/repos.d/"
  12. yum repolist

image_1e3oai2k41afg1qvl1ljj7m1visll.png-167.9kB

image_1e3oah4kck128publgeai6gkl8.png-98kB

3.3 安装Cloudera Manager Server

  1. yum -y install cloudera-manager-server

image_1e3obm7sqkk141m1kf6ntnp31nm.png-173.6kB

  1. 初始化数据库
  2. /opt/cloudera/cm/schema/scm_prepare_database.sh mysql cm cm password

image_1e3obprog1f3l5o1kn8ligc35o3.png-134.8kB

  1. 启动Cloudera Manager Server
  2. systemctl start cloudera-scm-server
  3. systemctl status cloudera-scm-server
  4. cd /var/log/cloudera-scm-server
  5. tail -100f cloudera-scm-server.log
  6. netstat -nultp |grep 7180

image_1e3oc1q9b71u6a4uns3d9djkp0.png-164.9kB

image_1e3oc2qkn1dil18jq19821pfsbgrpd.png-55.7kB

image_1e3oc5r9me94r901uf5omo4vtpq.png-587.8kB

3.4 通过http://192.168.100.21:7180/cmf/login访问CM

  1. 用户名:admin
  2. 密码: admin

image_1e3occj24ior1osr12dh1jlb1uu8q7.png-336.7kB

  1. 登录到CM,选择60天试用,点击继续

image_1e3oce7te1qlo1bjhocfdbg1c7mqk.png-818kB

  1. 集群安装:

image_1e3ocfhr71bevcs81ilkns51879r1.png-884.8kB

  1. 集群名字

image_1e3ocgp70v31ho5ad5ed7upnre.png-762kB

  1. 识别集群的主机

image_1e3ochvp31855qma14bb8e918ivrr.png-534kB

image_1e3ocjj4a15uf65k1vorj6j1umos8.png-838.4kB

image_1e3ocomcq146duc11qdhdv91v38sl.png-1020kB

  1. Parcel Repository & Network Settings

image_1e3oct5ou1hprg2d1pf51fk4cvnt2.png-410.8kB

image_1e3ocv1el1akvvnr8i4a1jfgtf.png-515.9kB

image_1e3od0mnrrqhcm0r901cdmfhpts.png-785.1kB


image_1e3od1qrq1jk354e1oekj9d1dbmu9.png-848kB

image_1e3od3kbisa51j7soevg1n1f4eum.png-684.3kB

  1. 安装 cloudera-scm-agent

image_1e3odh4it1loffv19ep1aib8i8v3.png-793.5kB

image_1e3oe7dn77e117q0f0t1ri515ksvg.png-715.8kB

image_1e3oe935jgc0imhnei5pvk72vt.png-527kB

  1. 分配parcel

image_1e3oefr61n333ct1o70ajc2610a.png-734.4kB

image_1e3ogbr8s4nehsj1u2u1hk171g10n.png-752.1kB

  1. 点击Inspect Network PerformanceInspect Hosts,检查主机

image_1e3oghhnc1mo3t8c1jr81tag1hus114.png-786.2kB

  1. 定义服务:

image_1e3ogj69kmlkefa1trvq7drir11h.png-1023.6kB

image_1e3ogucel1qcu2statsdfp16bk11u.png-950.9kB

image_1e3ogvc6dhf0uss7lfapk1k6812b.png-855.1kB

  1. 点击“继续”,进入下一步,测试数据库连接

image_1e3ogvtt9fkb54b1pne16in18an12o.png-874kB

image_1e3oh0riqrntgm3pm01vqb15nc13h.png-864.6kB

image_1e3oh5pvfh8m1pt81ksu1a0c1ved13u.png-848.9kB

  1. 首先输入CM的用户名和密码admin/admin
  2. 以下4个密码,都需要包含至少一个字母与一个数字,为了安装方便都输入admin@123

image_1e3oha6t51cke9v1t1h16ej3en9.png-977.8kB

image_1e3oialnj1tok1tun1km91j4c1b4jm.png-195.8kB

image_1e3oib7rv1501mh018jo1e2qhec13.png-405.9kB

image_1e3oic57d4o8nfe1evd1rgq1pac1g.png-339.4kB

  1. 安装服务初始化

image_1e3ohkldq13s61fec1gsha7jg1o9.png-973.4kB

image_1e3qusolt1c2t18lhvkj1gfb1vhp9.png-591.3kB

image_1e3ojrrg9vk41roe1t9v8q4lh1t.png-1082.2kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注