[关闭]
@zhangyy 2021-06-02T18:27:07.000000Z 字数 5661 阅读 230

大数据平台CDH6.3.2部署

大数据运维专栏


  • 一: 环境初始化
  • 二: 安装CDH6.3.2

一:环境初始化

1.1 环境介绍

  1. 系统:CentOS7.5X64
  2. cat /etc/hosts
  3. ----
  4. 192.168.11.160 dev01.lanxintec.cn
  5. 192.168.11.161 dev02.lanxintec.cn
  6. 192.168.11.162 dev03.lanxintec.cn
  7. ----

1.2:无密钥登录配置

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

image.png-72kB

1.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.png-31.1kB

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

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

image.png-47.4kB

2.5 时间同步:

  1. 所有机器 yum install chrony*
  2. 1. dev01.lanxintec.cn---dev03.lanxintec.cn 同步阿里云的时间服务器:
  3. vim /etc/chrony.conf 增加
  4. ----
  5. 注释掉相关默认的server
  6. server ntp1.aliyun.com iburst
  7. service chronyd start
  8. chkconfig chronyd on
  9. service chronyd stop
  10. service chronyd start
  11. chkconfig chronyd on

image.png-55.4kB

image.png-23.1kB

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

  1. cdh6.3.2 离线包:
  2. CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel
  3. CDH-6.3.2-1.cdh6.3.2.p0.1605554-el6.parcel.sha256
  4. manifest.json
  5. 下载: https://archive.cloudera.com/cdh6/6.3.2/parcels/
  6. cdh6.3.1 CM 包:
  7. cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
  8. cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm
  9. cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
  10. cloudera-manager-server-db-2-6.3.1-1466458.el7.x86_64.rpm
  11. enterprise-debuginfo-6.3.1-1466458.el7.x86_64.rpm
  12. oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
  13. 下载地址:
  14. https://archive.cloudera.com/cm6/6.3.1/redhat7/yum/RPMS/x86_64/
  15. jdbc 驱动:
  16. http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.46/mysql-connector-java-5.1.46.jar
  17. http://archive.cloudera.com/gplextras/misc/ext-2.2.zip

2.7:安装jdk

  1. 所用大数据节点都要配置:jdk
  2. rpm -ivh oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
  3. vim /etc/profile
  4. ---
  5. export JAVA_HOME=/usr/java/jdk1.8.0_181-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.png-10.5kB

image.png-19.1kB

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 -pflyfish225

image.png-65.2kB


  1. mariadb 优化文件:
  2. vim /etc/my.cnf
  3. ----
  4. key_buffer = 32M
  5. # (deprecated) key_buffer_size = 32M
  6. max_allowed_packet = 32M
  7. thread_stack = 256K
  8. thread_cache_size = 64
  9. query_cache_limit = 8M
  10. query_cache_size = 64M
  11. query_cache_type = 1
  12. max_connections = 550
  13. #expire_logs_days = 10
  14. #max_binlog_size = 100M
  15. #log_bin should be on a disk with enough free space.
  16. #Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your
  17. #system and chown the specified folder to the mysql user.
  18. log_bin=/var/lib/mysql/mysql_binary_log
  19. #In later versions of MariaDB, if you enable the binary log and do not set
  20. #a server_id, MariaDB will not start. The server_id must be unique within
  21. #the replicating group.
  22. server_id=1
  23. binlog_format = mixed
  24. read_buffer_size = 2M
  25. read_rnd_buffer_size = 16M
  26. sort_buffer_size = 8M
  27. join_buffer_size = 8M
  28. # InnoDB settings
  29. innodb_file_per_table = 1
  30. innodb_flush_log_at_trx_commit = 2
  31. innodb_log_buffer_size = 64M
  32. innodb_buffer_pool_size = 4G
  33. innodb_thread_concurrency = 8
  34. innodb_flush_method = O_DIRECT
  35. innodb_log_file_size = 512M
  36. [mysqld_safe]
  37. log-error=/var/log/mariadb/mariadb.log
  38. pid-file=/var/run/mariadb/mariadb.pid
  39. #
  40. # include all files from the config directory
  41. #
  42. !includedir /etc/my.cnf.d
  43. ----

2.9配置 httpd 分发服务器

  1. pre01.lanxintec.cn:
  2. yum install -y httpd

image.png-48.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 on

image.png-48kB

  1. CM6.3.1 分发源
  2. cd /var/www/html/cdh6.3.2
  3. createrepo.

image.png-50.3kB

  1. vim /etc/yum.repos.d/cloduera-manger.repo
  2. ------
  3. [cmrepo]
  4. name = cm_repo
  5. baseurl =http://192.168.100.11/cdh6
  6. enable = 1
  7. gpgcheck = 0
  8. -----
  9. yum makecache fast

image.png-36.4kB

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

image.png-40.9kB

2.10 配置mysql-jdbc

  1. cd /usr/share/java/
  2. cp -p mysql-connector-java-8.0.15.jar mysql-connector-java.jar

image.png-33.7kB

三: 安装CDH6.3.2所需环境

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.png-145.6kB

3.2 安装cloudera-server

  1. yum install -y cloudera-manager-server

image.png-58.9kB

image.png-72kB

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

  1. # mysql -uroot -pflyfish225
  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'@'dev01.lanxintec.cn' identified by 'cmf_1234' with grant option;
  5. mysql> flush privileges;

image.png-52.3kB

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

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

image.png-46.2kB

四: 配置CDH6.3.2的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.png-65.4kB

五: 打开web 安装:

image.png-103.5kB

image.png-155.3kB

image.png-122.9kB

image.png-102.5kB

image.png-93.8kB

image.png-78.4kB

image.png-35.2kB

image.png-169.9kB

image.png-87.8kB


image.png-72kB

  1. echo 10 > /proc/sys/vm/swappiness
  2. echo never > /sys/kernel/mm/transparent_hugepage/defrag
  3. echo never > /sys/kernel/mm/transparent_hugepage/enabled

  1. echo "vm.swappiness = 10" >> /etc/sysctl.conf
  2. sysctl -p

  1. vim /etc/rc.local
  2. ----
  3. echo never > /sys/kernel/mm/transparent_hugepage/defrag
  4. echo never > /sys/kernel/mm/transparent_hugepage/enabled
  5. ---

image.png-79kB

image.png-120.3kB

image.png-147.2kB

  1. create database cdh_hive default character set latin1;
  2. grant all privileges on cdh_hive.* to 'hive'@'%' identified by 'Hive_123' with grant option;
  3. create database cdh_oozie default character set utf8;
  4. grant all privileges on cdh_oozie.* to 'oozie'@'%' identified by 'Oozie_123' with grant option;
  5. create database cdh_hue default character set utf8;
  6. grant all privileges on cdh_hue.* to 'hue'@'%' identified by 'Hue_123' with grant option;
  7. create database cdh_rm default character set utf8;
  8. grant all privileges on cdh_rm.* to 'rm'@'%' identified by 'Rm_123' with grant option;
  9. flush privileges;

image.png-71.3kB

image.png-126kB


image.png-89.3kB

image.png-167.2kB

image.png-51.2kB

image.png-69.3kB

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