[关闭]
@zhangyy 2018-06-10T13:14:03.000000Z 字数 7095 阅读 166

CDH5.12.2 安装部署

大数据平台构建


  • 一:初始化环境部署配置
  • 二: CDH 5.12.2 部署处理

一: 初始化环境部署处理

1.1 环境准备:

  1. Centos7.3x64 所有主机名配置 配置好 所有机器的无密钥登陆

1.2 主机名配置

  1. 172.17.100.131 node01.yangyang.com node01
  2. 172.17.100.132 node02.yangyang.com node02
  3. 172.17.100.133 node03.yangyang.com node03
  4. 172.17.100.134 node04.yangyang.com node04
  5. 172.17.100.135 node05.yangyang.com node05
  6. 172.17.100.136 node06.yangyang.com node06

1.3 无密钥登录配置

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

1.4 关闭 firewalld,iptables 与 selinux

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

1.4 所有机器更改centos7.3x64的文件句柄数

  1. vim /etc/security/limits.conf

  1. * soft nofile 65535
  2. * hard nofile 1029345
  3. * soft nproc unlimited
  4. * hard nproc unlimited
  5. * soft memlock unlimited
  6. * hard memlock unlimited

1.5 所有机器 配置好jdk环境 同步所有机器

  1. (1) 卸载原有jdk
  2. rpm -e java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.x86_64 java-1.6.0-openjdk-devel-1.6.0.41-1.13.13.1.el7_3.x86_64 java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64 java-1.7.0-openjdk-headless-1.7.0.141-2.6.10.5.el7.x86_64 copy-jdk-configs-2.2-3.el7.noarch java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64 java-1.7.0-openjdk-devel-1.7.0.141-2.6.10.5.el7.x86_64 java-1.8.0-openjdk-devel-1.8.0.131-11.b12.el7.x86_64 java-1.6.0-openjdk-1.6.0.41-1.13.13.1.el7_3.x86_64 tzdata-java-2017b-1.el7.noarch python-javapackages-3.4.1-11.el7.noarch javapackages-tools-3.4.1-11.el7.noarch --nodeps
  3. (2) 安装jdk环境
  4. rpm -ivh jdk-8u151-linux-x64.rpm

1.6 生产环境配置chrony 时间同步服务器

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

1.7 安装mysql5.7数据库主节点上面安装

  1. 卸载:mariadb-libs 的包:
  2. ----
  3. rpm -e mariadb-libs mariadb-devel --nodeps
  4. ---
  5. 安装mysql5.7 所需要依赖包
  6. # yum install -y perl-JSON libaio
  7. 解压 mysql 5.7.21 集成安装包
  8. tar -xvf mysql-5.7.21-1.el7.x86_64.rpm-bundle.tar
  9. 删掉一个包mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm 这个minimal包不然装不了mysql5.7
  10. # rm -rf mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm
  11. # rpm -ivh mysql-community-*
  12. # mysqld --initialize-insecure --user=mysql
  13. 注:上面的安装步骤是用忽略安装mysql包安装顺序,系统将自动识别安装顺序
  14. 启动mysql5.7
  15. #service mysqld start
  16. # chkconfig mysqld on

image_1c7e35kbh1q4rnhbu3n1bboulj9.png-472.2kB

image_1c7e362vhmlm1sc09321c4ct4om.png-83.8kB

image_1c7e36rqphuevg7963g3m6h13.png-233.7kB

  1. 注:初次使用mysql的时候,需要更改mysql 的密码,否则查询不了mysql数据库当中的数据。
  2. #mysql -uroot -p
  3. mysql > set password = password('Bigdata_1234');
  4. mysql> flush privileges;

1.8 修改系统参数

  1. vim /etc/sysctl.conf
  2. ##内核默认参数
  3. kernel.sysrq = 0
  4. kernel.core_uses_pid = 1
  5. kernel.msgmnb = 65536
  6. kernel.msgmax = 65536
  7. kernel.shmmax = 68719476736
  8. kernel.shmall = 4294967296
  9. ##打开文件数参数(20*1024*1024)
  10. fs.file-max= 20971520
  11. ##WEB Server参数
  12. net.ipv4.tcp_tw_reuse=1
  13. net.ipv4.tcp_tw_recycle=1
  14. net.ipv4.tcp_fin_timeout=30
  15. net.ipv4.tcp_keepalive_time=1200
  16. net.ipv4.ip_local_port_range = 1024 65535
  17. net.ipv4.tcp_rmem=4096 87380 8388608
  18. net.ipv4.tcp_wmem=4096 87380 8388608
  19. net.ipv4.tcp_max_syn_backlog=8192
  20. net.ipv4.tcp_max_tw_buckets = 5000
  21. ##TCP补充参数
  22. net.ipv4.ip_forward = 0
  23. net.ipv4.conf.default.rp_filter = 1
  24. net.ipv4.conf.default.accept_source_route = 0
  25. net.ipv4.tcp_syncookies = 1
  26. net.ipv4.tcp_sack = 1
  27. net.ipv4.tcp_window_scaling = 1
  28. net.core.wmem_default = 8388608
  29. net.core.rmem_default = 8388608
  30. net.core.rmem_max = 16777216
  31. net.core.wmem_max = 16777216
  32. net.core.netdev_max_backlog = 262144
  33. net.ipv4.tcp_max_orphans = 3276800
  34. net.ipv4.tcp_timestamps = 0
  35. net.ipv4.tcp_synack_retries = 1
  36. net.ipv4.tcp_syn_retries = 1
  37. net.ipv4.tcp_mem = 94500000 915000000 927000000
  38. ##禁用ipv6
  39. net.ipv6.conf.all.disable_ipv6 =1
  40. net.ipv6.conf.default.disable_ipv6 =1
  41. ##swap使用率优化
  42. vm.swappiness=0
  43. ---
  44. 执行以下命令使参数生效:
  45. # sysctl -p
  46. 同步到所有机器

二: CDH5.12.2 安装与配置

2.1 安装CM 所依赖的包:(全部节点都安装)

  1. 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

2.2 安装cloudera-server 与更改配置 (节点全部安装)

  1. rpm -ivh cloudera-manager-*
  2. rpm -ivh enterprise-debuginfo-5.12.0-1.cm5120.p0.120.el7.x86_64.rpm

image_1c7e3ni54o0410941digmf71vb91g.png-272.2kB

  1. mysql 当中创建CM 的库
  2. # mysql -uroot -pBigdata_1234
  3. mysql> create database cmf character set utf8;
  4. mysql> grant all privileges on cmf.* to 'cmf'@'%' identified by 'cmf_1234' with grant option;
  5. mysql> grant all privileges on cmf.* to 'cmf'@'node01.yangyang.com' identified by 'cmf_1234' with grant option;
  1. 修改cm数据库
  2. #cp /etc/cloudera-scm-server/db.properties /etc/cloudera-scm-server/db.propertiesbak
  3. # vim /etc/cloudera-scm-server/db.properties

image_1c7j93pkt1lq21tve7fa6m114sm9.png-235.8kB

2.3 安装 离线cdh parcel-repo

  1. #cd /root/software
  2. #cp -ap CDH-5.12.2-1.cdh5.12.2.p0.4-el7.parcel* /opt/cloudera/parcel-repo/
  3. #cp -p manifest.json /opt/cloudera/parcel-repo/
  4. #cd /opt/cloudera/parcel-repo
  5. mv CDH-5.11.1-1.cdh5.11.1.p0.4-el7.parcel.sha1 (去掉 这个 1) CDH-5.11.1-1.cdh5.11.1.p0.4-el7.parcel.sha
  6. chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/ (所有主机都要执行这条命令)

image_1c7e4qmep1a8p1jj11a501cvkvt947.png-690.5kB


2.4 jdbc 配置

  1. 拷贝jdbc java的目录
  2. tar -zxvf mysql-connector-java-5.1.44.tar.gz
  3. cd mysql-connector-java-5.1.44
  4. cp mysql-connector-java-5.1.44-bin.jar /usr/share/java/
  5. cd /usr/share/java/
  6. mv mysql-connector-java-5.1.44-bin.jar mysql-connector-java.jar

image_1c7e4vhpbnvv781rgo97tl1n4k.png-757.2kB

2.5 修改config.ini 文件

  1. #cp /etc/cloudera-scm-agent/config.ini /etc/cloudera-scm-agent/config.inibak
  2. #vim /etc/cloudera-scm-agent/config.ini
  3. 修改server_host 为主节点的IP 地址
  4. ---
  5. server_host=172.17.100.131
  6. ---
  7. 同步到所有主机节点
  8. scp /etc/cloudera-scm-agent/config.ini node02:/etc/cloudera-scm-agent/
  9. scp /etc/cloudera-scm-agent/config.ini node03:/etc/cloudera-scm-agent/

image_1c7e55cio9eh1o5j1jtu1ev31lh51.png-79kB
image_1c7e59rdcklsf5q2lf10f61vhh5e.png-142.6kB

2.6 启动CM-server与agent-server

  1. node01.yangyang.com 主机
  2. cd /etc/init.d
  3. ./cloudera-scm-server start

image_1c7e5g8k61lcr10491qt11bnnfr35r.png-207kB


  1. 查看启动日志
  2. 查看启动结果:
  3. 需要通过查看server的启动日志文件
  4. /var/log/cloudera-scm-server
  5. tail -f cloudera-scm-server.log
  6. 看到jetty 表示启动成功 会有 7180 端口启动:

image_1c7e5hvv41up5oegb3o1jp1qhp68.png-265.5kB

2.7打开web浏览器:

  1. http://172.17.100.131:7180

image_1c7e5kettqm0o4erj1l5c12256l.png-217.4kB

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

image_1c7e5m89t1j3eagc14b5qb43r672.png-348kB

  1. 启动 所有的agent 节点
  2. cd /etc/init.d/
  3. ./cloudera-scm-agent start

image_1c7e5pbee1a81rkcf8l6rgund7f.png-197kB

image_1c7e64o6f15mr1sv51mij2phs8v7s.png-355kB

image_1c7e65poo71p1n7o1iii1njj11c189.png-313.3kB

image_1c7e66oie1r1eudsfhg1ugt1ffv8m.png-384.8kB

image_1c7e68c5p6l0fmisce1tlp1vp8a3.png-166.9kB

  1. 一直到分发结束 -- 然后继续

image_1c7e76eea1d1o1sld32o184kuntag.png-94.1kB

image_1c7e77ki2jr11p674u61og410clat.png-381.9kB

  1. 所有节点执行:
  2. #echo never > /sys/kernel/mm/transparent_hugepage/defrag
  3. #echo never > /sys/kernel/mm/transparent_hugepage/enabled
  4. vim /etc/rc.local
  5. 在最下面增加:
  6. ---
  7. echo never > /sys/kernel/mm/transparent_hugepage/defrag
  8. echo never > /sys/kernel/mm/transparent_hugepage/enabled
  9. ---
  10. 同步所有机器

image_1c7e7bjm71lu710gd1sb0obl85eba.png-295.8kB

  1. 重新运行界面:

image_1c7e7dapi1rdd1f731gqq1oh1p8dbn.png-285.7kB

image_1c7e7eg2ms0h9ts16cs1uj369qc4.png-370.7kB

  1. 配置角色:

image_1c7e7hm2811eqo3m1ms6m4biguch.png-351.4kB

image_1c7e7ij031cth91g1ngf1l6j1a1fcu.png-265.4kB

  1. 数据库授权:
  2. mysql -uroot -pBigdata_1234
  3. ---
  4. 创建hive 所需要的库并授权:
  5. mysql >create database cdh_hive default character set latin1;
  6. 字符必须为拉丁(latin1),如果uft8可能会报错Specified key was too long; max key length is 767 bytes
  7. mysql >grant all privileges on cdh_hive.* to 'hive'@'%' identified by 'Hive_123' with grant option;
  8. mysql >grant all privileges on cdh_hive.* to 'hive'@'node01.yangyang.com' identified by 'Hive_123' with grant option;
  9. mysql >flush privileges;

image_1c7e8t4c4dvtgg51isc5lve0hev.png-222kB

  1. 创建oozie 所需要的库
  2. mysql >create database cdh_oozie default character set utf8;
  3. mysql >grant all privileges on cdh_oozie.* to 'oozie'@'%' identified by 'Oozie_123' with grant option;
  4. mysql >grant all privileges on cdh_oozie.* to 'oozie'@'node01.yangyang.com' identified by 'Oozie_123' with grant option;
  5. mysql >flush privileges;

image_1c7e8ufqvspdl8i1nup1oojdvfc.png-241.3kB

  1. 创建hue所需要的库:
  2. mysql >create database cdh_hue default character set utf8;
  3. mysql >grant all privileges on cdh_hue.* to hue’@'%' identified by 'Hue_123' with grant option;
  4. mysql >grant all privileges on cdh_hue.* to 'hue'@'node01.yangyang.com' identified by 'Hue_123' with grant option;
  5. mysql >flush privileges;

image_1c7e8vurmv6g1t0v1i0lg4t1q41fp.png-228.5kB

  1. 创建CM 监控端Activity Monitor 的库
  2. Activity Monitor:
  3. mysql >create database cdh_am default character set utf8;
  4. mysql >grant all privileges on cdh_am.* to am’@'%' identified by 'Am_123' with grant option;
  5. mysql >grant all privileges on cdh_am.* to 'am'@'node01.yangyang.com' identified by 'Am_123' with grant option;
  6. mysql >flush privileges;

image_1c7e95pvdlvn15h713b21uuo1d13gj.png-280.9kB

image_1c7e96lu71vq7sge71vv3i1speh0.png-345.5kB

image_1c7e98c5m4mj1rg7v4s1enh18i3hd.png-328.4kB

image_1c7e9io911qqrkkr8aq1r66o1hq.png-365.2kB

image_1c7e9jj2t1ca2eva1qqf36r1a6ni7.png-203.6kB

image_1c7e9kar33up9lg1gvra7ckqjik.png-399.4kB

image_1c7e9nto5tk644l1vl11ehb1k7j1.png-409.8kB

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