[关闭]
@zhangyy 2020-05-18T15:45:44.000000Z 字数 5835 阅读 169

大数据平台 CDH6.1.0 安装配置

大数据平台构建


  • 一: 关于CDH6.1.0 的介绍
  • 二: 系统环境初始化
  • 三: 安装CDH6.1.0所需环境
  • 四: 配置CDH6.1.0的cloudera-manager安装

一:关于CDH6.1.0 的介绍

  1. Cloudera在前天1219日,对外宣布正式发布Cloudera Enterprise 6.1包含大数据生态版本如下:
  2. 1.组件版本:Kafka 2.0, Spark 2.4, HBase 2.1.1, Accumulo 1.9.2, SOLR 7.4
  3. 2.CDH免费版限制100个节点内
  4. 3.HDFS的纠删码完全支持,包括HiveNavigator(auditing),BDRMRSpark
  5. 4.对象存储支持:On-prem (Ceph), Cloud (ADLS gen 2)
  6. 5.Impala的多个distinct语句支持
  7. 6.SqoopHiveServer2与导入Parquet文件支持
  8. 7.OpenJDK支持

image_1d3o63jmt12s6vo1le2crr1ut816.png-136.3kB

二:系统环境初始化

2.1: 系统环境介绍

  1. 系统:CentOS7.5X64
  2. cat /etc/hosts
  3. 192.168.20.111 NN01.yl.com NN01
  4. 192.168.20.112 SN01.yl.com SN01
  5. 192.168.20.113 NN01.yl.com DN01
  6. 192.168.20.114 NN02.yl.com DN02

image_1d3o665kq4p31k7u136k1uo4o741j.png-216.9kB

2.2:无密钥登录配置

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

image_1d3o6853p1c6i1o1v31514sn1vl620.png-284.2kB

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_1d3o69af717ffri61cc6k2o1hl62t.png-196.7kB

2.4:所有机器更改CentOS7.5x64的文件句柄数

  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

image_1d3o6een8ugb155ravd1lm06833a.png-137.8kB

  1. 在其它 节点上面执行命令:
  2. rsync -arvzP root@192.168.20.111:/etc/security/limits.conf /etc/security/
  3. 同步limits.conf 文件

image_1d3o6h9tkj9ukn01sbv1mubv0n3n.png-197.5kB

image_1d3o6hqdl1dqg4hvgs1j3jnfs44.png-204.7kB

image_1d3o6icrnaqq15ekp841rqt1ahe4h.png-292.1kB

2.5 时间同步:

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

image_1d3o74iuktqp1u7g1vj219851kkf4u.png-379.1kB

image_1d3o757q68e51hf38mk9c9183i5b.png-368.4kB

2.6: cdh6.1.0 安装所需文件下载

  1. cdh6.1.0 离线包:
  2. CDH-6.1.0-1.cdh6.1.0.p0.770702-el7.parcel
  3. CDH-6.1.0-1.cdh6.1.0.p0.770702-el7.parcel.sha256
  4. manifest.json
  5. 下载: https://archive.cloudera.com/cdh6/6.1.0/parcels/
  6. cdh6 CM 包:
  7. cloudera-manager-agent-6.1.0-769885.el7.x86_64.rpm
  8. cloudera-manager-daemons-6.1.0-769885.el7.x86_64.rpm
  9. cloudera-manager-server-6.1.0-769885.el7.x86_64.rpm
  10. cloudera-manager-server-db-2-6.1.0-769885.el7.x86_64.rpm
  11. oracle-j2sdk1.8-1.8.0+update141-1.x86_64.rpm
  12. allkeys.asc
  13. 下载地址:
  14. https://archive.cloudera.com/cm6/6.1.0/redhat7/yum/RPMS/x86_64/
  15. jdbc 驱动:
  16. mysql-connector-java-8.0.15-1.el7.noarch.rpm
  17. 下载:mysql官网下载

2.7:安装jdk

  1. 所用大数据节点都要配置:jdk
  2. rpm -ivh oracle-j2sdk1.8-1.8.0+update141-1.x86_64.rpm
  3. vim /etc/profile
  4. ---
  5. export JAVA_HOME=/usr/java/jdk1.8.0_141-cloudera
  6. export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
  7. PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
  8. ---
  9. source /etc/profile
  10. java -version

image_1d3o5i49ijrsh9b142na6mvgn9.png-222.6kB

2.8 安装mariadb-server

  1. yum install -y mariadb-server
  2. service mariadb start
  3. chkconfig mariadb on
  4. mysql_secure_installation
  5. mysql -uroot -pQingchun123.com

image_1d3o7rl3t18tlfiv1surdg75n6o.png-961.2kB

image_1d3o7sh85hbv1arp1lorh9kbs675.png-248.3kB

image_1d3o7uqehhinpb41v2h1sovv9a8i.png-339.6kB

image_1d3o8e5051qup4nanbf11766489f.png-240.4kB

2.9配置 httpd 分发服务器

  1. NN01.yl.com:
  2. yum install -y httpd

image_1d3o8h8q7vta1fse134gg81moq9s.png-257.4kB

image_1d3o8i19ipj39594m94jj1ao2a9.png-320.6kB

  1. vim /etc/httpd/conf/httpd.conf
  2. ----
  3. 修改/etc/httpd/conf/httpd.conf配置文件,在<IfModule mime_module>中修改以下内容
  4. AddType application/x-gzip .gz .tgz .parcel
  5. ----
  6. service httpd start
  7. chkconfig httpd start

image_1d3o8pebhftd1i8g76i1cd1u43am.png-143.4kB

image_1d3o8qm3i1sst64htqkh6qkk0b3.png-447.4kB

  1. CM6.1 分发源
  2. yum install -y createrepo
  3. cd /root/cm6.1/
  4. createrepo .
  5. mv /root/cm6.1/ /var/www/html/
  6. mv /root/cdh6.1/ /var/www/html/

image_1d3o95c9t1r7v1rmt164m74pidpbg.png-380.9kB

image_1d3o96huviig1mi81lef1d7u1ej4cd.png-178.6kB

image_1d3o970d44j0co5jpkjj0ibocq.png-107kB

image_1d3o9lbco14911amh1ctq12qn8a2d7.png-140.3kB

image_1d3o9lrd6cqp173hb5e1sedhmedk.png-106.3kB

  1. vim /etc/yum.repos.d/cm.repo
  2. ------
  3. [cmrepo]
  4. name = cm_repo
  5. baseurl =http://192.168.20.111/cm6.1
  6. enable = true
  7. gpgcheck = false
  8. -----
  9. yum makecache

image_1d3oa9snrrli16a71ar39p314hhf8.png-321.9kB

  1. 所有主机执行命令同步:
  2. rsync -avrzP root@192.168.20.111:/etc/yum.repos.d/cm.repo /etc/yum.repos.d/
  3. yum makecache

image_1d3oafknihe31g2a1rnt4sslm7fl.png-268.2kB

2.10 配置mysql-jdbc

  1. rpm -ivh mysql-connector-java-8.0.15-1.el7.noarch.rpm
  2. cd /usr/share/java/
  3. cp -p mysql-connector-java-8.0.15.jar mysql-connector-java.jar

image_1d3o9opjl1f9mtp21ton1n8lhree1.png-247.8kB

image_1d3o9tp5s1fj51p8sjj819h51nf5ee.png-193.9kB

image_1d3o9ur849askh61ekq19pi1v9ver.png-242.6kB

三: 安装CDH6.1所需环境

3.1:安装所需依赖包

  1. 所有大数据节点都要安装:
  2. yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb postgresql* portmap mod_ssl openssl-devel python-psycopg2 MySQL-python

image_1cmeofp0v16231gvkmp915s67omat.png-953.3kB

3.2 安装cloudera-server

  1. yum install -y cloudera-manager-server

image_1d3oan2aj19kd7lulrm1o983ddgf.png-417.8kB

3.3 在 mysql 当中创建 CM 需要的注册库

  1. # mysql -uroot -pQingchun123.com
  2. mysql> create database cmf character set utf8;
  3. mysql> grant all privileges on cmf.* to 'cmf'@'%' identified by 'cmf_1234' with grant option;
  4. mysql> grant all privileges on cmf.* to 'cmf'@'NN01.yl.com' identified by 'cmf_1234' with grant option;
  5. mysql> flush privileges;

image_1d3oausc92nd115vhoj1o5eu5ugs.png-437.9kB

3.4 注入CM-server库 与 CM-agent端的server

  1. /opt/cloudera/cm/schema/scm_prepare_database.sh mysql cmf cmf cmf_1234

image_1d3ob0ovf13f41ihd16md1idkl2rh9.png-324.5kB

四: 配置CDH6.1的cloudera-manager安装

4.1 安装启动CM

  1. service cloudera-scm-server start
  2. cd /var/log/cloudera-scm-server/
  3. tail -f cloudera-scm-server.log

image_1d3ob6pfl1vbpvf41ddjrfp1jr8im.png-554.9kB

image_1d3ob8mt010rfeg31orifav15r5j3.png-148.2kB

image_1d3obenr7dgsa1jhmd1195pqvjg.png-264.2kB

image_1d3obf82t1l7k1h541lrr1db01c7ljt.png-394.3kB

image_1d3obh66o1daiphrg9s12v717t1lq.png-198.4kB

image_1d3obi0rp9rmu8a1i96ege1vaqmn.png-197.9kB

image_1d3obkgn77j118m01fa8u141asan4.png-246.3kB

  1. 选择更多parcel

image_1d3obp9tv1srd1qp393g126h1uejnu.png-175.4kB

image_1d3obqhhbnql1dni1ohlac8hlcob.png-155kB

image_1d3obrirksjb1dp7v1s1v1afl7oo.png-210kB

image_1d3obtn2u2jm1usn1bhgfen132dpi.png-324.8kB

image_1d3obu7q015ve1dkf1d9t1mt14mjpv.png-337.3kB

image_1d3oc9rbfqhj1gf01sf41gtr1hajqc.png-270.8kB

image_1d3ocb3vmtqi4qe1g2n1eov5hsqp.png-243.9kB

  1. 所有节点执行:
  2. echo vm.swappiness = 10 >> /etc/sysctl.conf
  3. echo 10 > /proc/sys/vm/swappiness
  4. echo never > /sys/kernel/mm/transparent_hugepage/defrag
  5. echo never > /sys/kernel/mm/transparent_hugepage/enabled
  6. 将下面 两条命令

image_1d3och0t44fh1gh51la2ahjjklr6.png-154.1kB

image_1d3ohgr8f1av27s10sht801c4vrj.png-354.4kB

image_1d3ohhs301k2mcacbvp1g4e17hls0.png-296.4kB

image_1d3ohij1g14cc67m9dvu7g18c1sd.png-424.3kB

  1. mysql 授权的配置
  2. 数据库授权:
  3. mysql -uroot -pQingchun123.com
  4. ---
  5. 创建hive 所需要的库并授权:
  6. mysql >create database cdh_hive default character set latin1;
  7. 字符必须为拉丁(latin1),如果uft8可能会报错Specified key was too long; max key length is 767 bytes
  8. mysql >grant all privileges on cdh_hive.* to 'hive'@'%' identified by 'Hive_123' with grant option;
  9. mysql >grant all privileges on cdh_hive.* to 'hive'@'NN01.yl.com' identified by 'Hive_123' with grant option;
  10. mysql >flush privileges;
  11. 创建oozie 所需要的库
  12. mysql >create database cdh_oozie default character set utf8;
  13. mysql >grant all privileges on cdh_oozie.* to 'oozie'@'%' identified by 'Oozie_123' with grant option;
  14. mysql >grant all privileges on cdh_oozie.* to 'oozie'@'NN01.yl.com' identified by 'Oozie_123' with grant option;
  15. mysql >flush privileges;
  16. 创建hue所需要的库:
  17. mysql >create database cdh_hue default character set utf8;
  18. mysql >grant all privileges on cdh_hue.* to 'hue'@'%' identified by 'Hue_123' with grant option;
  19. mysql >grant all privileges on cdh_hue.* to 'hue'@'NN01.yl.com' identified by 'Hue_123' with grant option;
  20. mysql >flush privileges;
  21. 创建CM 监控端Activity Monitor 的库
  22. Activity Monitor:
  23. mysql >create database cdh_am default character set utf8;
  24. mysql >grant all privileges on cdh_am.* to 'am'@'%' identified by 'Am_123' with grant option;
  25. mysql >grant all privileges on cdh_am.* to 'am'@'NN01.yl.com' identified by 'Am_123' with grant option;
  26. mysql >flush privileges;
  27. 创建RM 监控端 Reports Manager 的库
  28. Reports Manager
  29. mysql >create database cdh_rm default character set utf8;
  30. mysql >grant all privileges on cdh_rm.* to 'rm'@'%' identified by 'Rm_123' with grant option;
  31. mysql >grant all privileges on cdh_rm.* to 'rm'@'NN01.yl.com' identified by 'Rm_123' with grant option;
  32. mysql >flush privileges;

image_1d3oi8gu3rbqvrk16fl13m46kisq.png-276.2kB

image_1d3oi98jb1uov1ca78g5sqpdg7t7.png-283kB

image_1d3oi9vbi15kh1lgk1p3h13v015s7tk.png-277.6kB
image_1d3oihdrsodi1p3vif0f8sh68u1.png-336.4kB

image_1d3oij4v7u7es9d44r18ts3e7ue.png-327.1kB

image_1d3oilirq1u9j10ihqat1lug1e2s101.png-397.3kB

image_1d3ojbfr5qqjg3c16is1kte1ud810e.png-385.1kB

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