[关闭]
@zhangyy 2018-12-17T10:46:57.000000Z 字数 7057 阅读 169

大数据平台CDH5.14.2 的安装配置

大数据平台构建


  • 一:系统环境初始化
  • 二:安装CDH5.14.2 平台
  • 三:分配主机与分配角色

一: 系统环境初始化

1.1: 系统环境介绍

  1. 系统: CentOS7.5X64
  2. cat /etc/hosts
  3. ---
  4. 172.17.100.11 node-01.flyfish
  5. 172.17.100.12 node-02.flyfish
  6. 172.17.100.13 node-03.flyfish
  7. 172.17.100.14 node-04.flyfish
  8. 172.17.100.15 kbs-01.flyfish
  9. 172.17.100.16 kbs-02.flyfish
  10. -----
  11. 本次 安装只配置其中三台机器: 172.17.100.11 172.17.100.13

image_1cfk2nlhohkr1gij12s3g1djh6m.png-52.1kB

1.2: 关闭 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. 重启机器
  17. reboot

image_1cfk2mh0a1ts11uju185810s71o539.png-98.8kB

1.3:无密钥登录配置

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

image_1cfk2qgsn1a8v13u11vv2b8m1aep13.png-99.1kB

1.4 配置jdk1.7环境 (所有机器都配置)

  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 oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm
  5. vim /etc/profile
  6. 最后增加:
  7. ### JDK ####
  8. export JAVA_HOME=/usr/java/jdk1.7.0_67-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. java -version

image_1cfk4ks6a108j1o8n9b419n5nle1t.png-81.9kB

image_1cfk4lk4k7du1ok713kt1ehm1rjf2a.png-43.7kB

image_1cfk4g7n49di1qgm1qhvpv61ia61g.png-54kB

1.5:chrony 时间同步服务器

  1. 所有机器 yum install chrony*
  2. 1. node-01.flyfish:
  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. node-02.flyfish---node-03.flyfish 同步node-01.flyfish
  11. vim /etc/chrony.conf
  12. ----
  13. 注释掉默认的server
  14. server 172.17.100.11 iburst
  15. ----
  16. service chronyd start
  17. chkconfig chronyd on

image_1cfk4tp0m17m033m1ij0vordq72q.png-155.6kB

image_1cfk5143p15qqbm01g13t2ka7k37.png-102.3kB

image_1cfk52aq0b48nevn0i15cftm544.png-176.2kB

image_1cfk54h8n1qc9hgsjlm1abunea4h.png-148.4kB

1.6: 安装maridb-server 数据库

  1. 1)安装mariadb-server
  2. yum install -y mariadb*
  3. 2) 启动 mariadb-server
  4. service mariadb start
  5. chkcofig mariadb on
  6. 3) 配置数据库密码:
  7. mysql_secure_installation
  8. 4 登录mariadb-server 数据库
  9. mysql -uroot -pflyfish225.com

image_1cfk5ddalrb810tn1p9rer60i5b.png-263.9kB

image_1cfk5clm611li14dr1pb7am72kv4u.png-98.3kB

image_1cfk5ev5v1q84g57h718tmqnd5o.png-92.8kB

image_1cfk5hsnk8r01834j5j4oa1vr565.png-146.2kB

image_1cfk5ij9ip0vcb1hq61h4019eh6i.png-152kB

image_1cfk5j82u1njs1u4v1kfkudb12da6v.png-79.3kB

image_1cfk5kg5h16q62ia1kk313sbc0i7c.png-128.2kB


1.8 关于系统参数配置

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

image_1cfk5ti4gimj1na614om1em1suj7p.png-84.8kB

1.7 修改文件句柄数

  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_1cfk61cq8efemoi7dc1o7l1tes86.png-44kB

二:安装CDH5.14.2 平台

2.1: 安装配置依赖包(全部节点都安装)

  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.14.3-1.cm5143.p0.4.el7.x86_64.rpm

image_1cfk6tui1s9i15gq5urngiqk8j.png-172.7kB

2.3:在mariadb-server 当中创建CM 的库

  1. mysql -uroot -pflyfish225.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'@'node-01.flyfish' identified by 'cmf_1234' with grant option;
  5. mysql> flush privileges;

image_1cfk7aqu2n4mbp4uaubea2hg9g.png-216.7kB

2.4:安装离线cdh parcel-repo

  1. #cd /root/software
  2. #cp -p CDH-5.14.2-1.cdh5.14.2.p0.3-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.14.2-1.cdh5.14.2.p0.3-el7.parcel.sha1 (去掉最后的1) CDH-5.14.2-1.cdh5.14.2.p0.3-el7.parcel.sha
  6. chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/ (所有主机都要执行这条命令)

image_1cfk82kl814h51uvvs1k1ctbmm6an.png-217.2kB

2.5 配置jdbc的驱动

  1. rpm -ivh mysql-connector-java-8.0.11-1.el7.noarch.rpm
  2. cd /usr/share/java
  3. cp -p mysql-connector-java-8.0.11.jar mysql-connector-java.jar
  4. chmod 777 mysql-connector-java.jar

image_1cfk8g6hrthveu382intcspqb4.png-80.7kB

image_1cfk8gn5s9badhqcpn6kd15dbh.png-51.8kB

image_1cfk8h4071lvai1h19jk16121m36bu.png-37.6kB

image_1cfke9mmc1sglc723tm14d6h0k93.png-50.4kB

2.6 配置数据的注册生成表

  1. 1)备份db生成表的文件
  2. cp /etc/cloudera-scm-server/db.properties /etc/cloudera-scm-server/db.propertiesbak
  3. 2)生成表
  4. /usr/share/cmf/schema/scm_prepare_database.sh mysql cmf cmf cmf_1234

image_1cfk9ui3a4m41jeut7q7jtpv49.png-111.6kB

2.7:修改config.ini 文件

  1. vim /etc/cloudera-scm-agent/config.ini
  2. ---
  3. server_host=172.17.100.11
  4. ---
  5. scp /etc/cloudera-scm-agent/config.ini node-02.flyfish:/etc/cloudera-scm-agent/
  6. scp /etc/cloudera-scm-agent/config.ini node-03.flyfish:/etc/cloudera-scm-agent/

image_1cfk8ktkjutqvd610qti7luraco.png-123.5kB

image_1cfk8nlcrh7bnv5k81nq2hnsd5.png-89.5kB

2.8: 启动CM-SERVER

  1. cd /etc/init.d/
  2. ./cloudera-scm-server start

image_1cfka3cs3197625g27uks75n9m.png-79.1kB

  1. 查看日志:
  2. cd /var/log/cloudera-scm-server
  3. tail -100f cloudera-scm-server.log
  4. 查看有7180 端口启动表示CM管理server启动
  5. netstat -nultp |grep 7180

image_1cfkacouq1l8vsgb10u91v1b11p81g.png-332.5kB

image_1cfkaa9bj1t577o3q4p1k261fmq13.png-62.2kB

  1. 使用浏览器web打开:
  2. http://node-01.flyfish:7180

image_1cfkah1derna1grs1ebd82l3k1t.png-187.5kB

image_1cfkahsd3u1i173nb51nhqp9j2a.png-372.1kB

image_1cfkaigmh80ca00e6h16mebkj2n.png-365.6kB

image_1cfkaj1ofs0418ffkvh90r1v5h34.png-345.9kB

  1. 启动agent 端:
  2. cd /etc/init.d/
  3. ./cloudera-scm-agent start

image_1cfkaltndl9sauc1ts81nn92554h.png-93.4kB

image_1cfkan2pn13fva9v6h31m324tq4u.png-84.9kB

image_1cfkaned3foamrobn81c6p19ki5b.png-74.3kB

三: 分配主机与分配角色

image_1cfkaq29p1gsmsfh4atqf2lp5o.png-354.8kB

image_1cfkar2741uf210ud1t6k15e7jqb65.png-303.6kB

image_1cfkas06v9679n15vi1h3i19n6i.png-347.4kB

image_1cfkasikho1iipl1q9s1un51snt6v.png-263kB

image_1cfkb1baqdjlu7lj5f1rjo18ol7c.png-204.7kB

image_1cfkbc5g3kk3154o1hjgkrfqia7p.png-236.9kB

image_1cfkbluv4132k1fl7mb1qdd1vc786.png-422.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_1cfkbu5mfbqb1681ini19tp9e116.png-222.6kB

image_1cfkbvvpt1rq16r61av11ker10uh1j.png-366.5kB

image_1cfkc2ohl199vk0ll3siqgkst20.png-638.1kB

image_1cfkca9vp99hsa685t1niv1li02d.png-392.1kB

image_1cfkcaqmt1r16dip1s9lu17138t2q.png-370kB

image_1cfkcepb7fjm15471j9h1efa5nv3n.png-419kB

  1. mysql 授权的配置
  2. 数据库授权:
  3. mysql -uroot -pflyfish225.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'@'node-01.flyfish' 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'@'node-01.flyfish' 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'@'node-01.flyfish' 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'@'node-01.flyfish' 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'@'node-01.flyfish' identified by 'Rm_123' with grant option;
  32. mysql >flush privileges;

image_1cfkcvc7s1j1i1ei71sos15tk1s5744.png-200.1kB

image_1cfkd01d1s2h14gh1jl1feai0i4h.png-180.7kB

image_1cfkd0f61dju4v2pgp54eke4u.png-128.2kB

image_1cfkd4vl01vmh9f317t41gai1a965b.png-462.9kB

image_1cfkd6de6h4sdmb80p1thu4f65o.png-380.6kB

image_1cfkd6uaqm1uo7m1frjk71ad765.png-439.7kB

image_1cfkd7njnf1t1tod34m1c3bmeu6i.png-372.4kB

image_1cfkdjtup2kes509t71klt134c6v.png-462.5kB

image_1cfkdl1er1gar1q01klhdjq1vj27s.png-207.3kB

image_1cfkdlqe41dben6umg1v011tl489.png-524.8kB

image_1cfke4i101op81o711asq5gaos28m.png-526.1kB

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