本篇简单介绍下CDH6.3 集群搭建过程,环境准备可参加HDP版本,基本一致。
【大数据搭建HDP3.x】Ambari2.7.4 HDP3.1.4离线搭建教程(上)
1、介质下载
代码语言:javascript复制#下载cm及cdh的yum源nohup wget -c -r -np -nc -L -p https://archive.cloudera.com/cm6/6.3.1/redhat7/ 2>&1 >cm6.log &snohup wget -c -r -np -nc -L -p https://archive.cloudera.com/cdh6/6.3.2/redhat7/ 2>&1 >cdh6.log &snohup wget -c -r -np -nc -L -p https://archive.cloudera.com/cdh6/6.3.2/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel 2>&1 >parcels.log &snohup wget -c -r -np -nc -L -p https://archive.cloudera.com/cdh6/6.3.2/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha1 2>&1 >parcels.log &snohup wget -c -r -np -nc -L -p https://archive.cloudera.com/cdh6/6.3.2/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha256 2>&1 >parcels.log &snohup wget -c -r -np -nc -L -p https://archive.cloudera.com/cdh6/6.3.2/parcels/manifest.json 2>&1 >parcels.log &s
CM & CDH 对应版本依据
2、搭建集群节点
代码语言:javascript复制#搭建节点10.172.54.58 dn58.hadoop54.unicom dn5810.172.54.59 dn59.hadoop54.unicom dn5910.172.54.60 dn60.hadoop54.unicom dn6010.172.54.61 dn61.hadoop54.unicom dn61
3、配置httpyum源,repo文件如下:
#注意:url中需要拷贝下目录,不要有操作系统的版本号目录,如redhat7
代码语言:javascript复制[root@dn58 6.3.1]# more /etc/yum.repos.d/cm.repo[cloudera-manager]name=Cloudera Manager 6.3.1baseurl=http://10.172.54.58/yumdir/archive.cloudera.com/cm6/6.3.1/yum/gpgkey=http://10.172.54.58/yumdir/archive.cloudera.com/cm6/6.3.1/yum/RPM-GPG-KEY-clouderagpgcheck=1enabled=1autorefresh=0type=rpm-md
[root@dn58 6.3.1]# more /etc/yum.repos.d/cdh.repo[cloudera-CDH]name=CDH 6.3.2baseurl=http://10.172.54.58/yumdir/archive.cloudera.com/cdh6/6.3.2/yum/gpgkey=http://10.172.54.58/yumdir/archive.cloudera.com/cdh6/6.3.2/yum/RPM-GPG-KEY-clouderagpgcheck=1enabled=1autorefresh=0type=rpm-md
4、安装CM
代码语言:javascript复制#安装CMsudo yum install cloudera-manager-daemons cloudera-manager-agent cloudera-manager-server
5、安装数据库及配置
安装数据库,mariadb安装忽略,注意版本兼容性
MariaDB10.1
代码语言:javascript复制#创建数据库、用户并赋权MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Admin@2020' WITH GRANT OPTION;Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create user 'scm'@'%' identified by 'scm_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'scm_2020';Query OK, 0 rows affected (0.00 sec)
#初始化数据库连接注意:使用rds5.6及mariadb10.2及以上版本时启动server报错,数据库版本兼容性问题,具体rds是可以通过设置参数现使用mariadb10.1版本无问题,当前具体版本号为mariadb-10.1.46-linux-systemd-x86_64.tar.gz。rds错误:ERROR main:com.cloudera.enterprise.dbutil.SqlFileRunner: Exception while executing ddl scripts.java.sql.SQLException: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.解决方案:可配置GLOBAL.ENFORCE_GTID_CONSISTENCY = 0尝试。#本机使用本地数据库,如使用远程数据库, 参考/opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h 10.172.54.38 -P 3323 --scm-host dn58.hadoop54.unicom scm scm[root@dn58 mysql]# /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scmEnter SCM password:JAVA_HOME=/usr/local/java/jdk1.8.0_141Verifying that we can write to /etc/cloudera-scm-serverCreating SCM configuration file in /etc/cloudera-scm-serverExecuting: /usr/local/java/jdk1.8.0_141/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/opt/cloudera/cm/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.[ main] DbCommandExecutor INFO Successfully connected to database.All done, your SCM database is configured correctly!
6、启动CM
代码语言:javascript复制[cuadmin@dn58 mysql]$sudo systemctl start cloudera-scm-server
#查看日志
代码语言:javascript复制[cuadmin@dn58 mysql]$sudo tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log当日志出现:INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.,表示CM Console已准备好。
7、登录CM
代码语言:javascript复制#登录CMhttp://10.172.54.58:7180/cmf/loginadmin/admin
welcome~
8、条款许可
9、选择版本,选择社区免费版,如已购买企业版可上传许可证。
10、集群安装
集群名称
扫描 hosts 地址使用 FQDN 来标识,填写之后进行扫描
11、选择存储库
代码语言:javascript复制1.cm agent:选择本地库,注意url中不要存在操作系统的目录,原下载目录需调整,将Redhat7目录结构移除。http://10.172.54.58/yumdir/archive.cloudera.com/cm6/6.3.1/
wget https://archive.cloudera.com/cm6/6.3.1/allkeys.asc
[root@dn58 6.3.1]# cp /home/cuadmin/allkeys.asc /var/www/html/yumdir/archive.cloudera.com/cm6/6.3.1/
2.cdh及其他软件:使用Parcel建议,配置,介质参见第一步。更多选择https://archive.cloudera.com/cdh5/parcels/5.16/
12、jdk选项
13、填写ssh登录凭证,后期使用此权限进行集群组件分发安装
14、agent安装
15、安装parcels
16、验证网络状态
由于本次机器是由原hdp集群退服后手动清理的,部分hdp数据残余需要处理,这里cm给出了具体的问题及应对方案。处理下即可。
代码语言:javascript复制#解决方法useradd -G hadoop,yarn -d /var/lib/hadoop-yarn -s /sbin/nologin yarn
代码语言:javascript复制#临时生效:sysctl -w vm.swappiness=10
echo never > /sys/kernel/mm/transparent_hugepage/defragecho never > /sys/kernel/mm/transparent_hugepage/enabled#永久生效echo "vm.swappiness=10" >> /etc/sysctl.confecho "echo never > /sys/kernel/mm/transparent_hugepage/defrag" >> /etc/rc.localecho "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local
验证无误;
17、选择安装组件,此处可多选组件安装,也选择逐个组件进行安装(如首次安装简易后者,避免多组件安装出现较多问题。)当然,出现问题无法回退的话,也可以通过卸载CM&CDH进行环境初始化。
18、选择各组件中server节点的分配
19、确认角色分配
20、涉及相应组件的元数据库需要创建及赋权
代码语言:javascript复制MariaDB [(none)]> CREATE DATABASE hive DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user 'hive'@'%' identified by 'hive_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON hive.* TO 'hive'@'%' IDENTIFIED BY 'hive_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> CREATE DATABASE am DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user 'am'@'%' identified by 'am_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON am.* TO 'am'@'%' IDENTIFIED BY 'am_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user 'oozie'@'%' identified by 'oozie_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user 'hue'@'%' identified by 'hue_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'hue_2020';Query OK, 0 rows affected (0.00 sec)
#类似ranger,元数据权限管理
MariaDB [(none)]> CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user 'sentry'@'%' identified by 'sentry_2020';Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'sentry_2020';Query OK, 0 rows affected (0.00 sec)
20、配置元数据库及验证jdbc连接测试
代码语言:javascript复制CMS
[root@dn58 parcels]# mkdir -p /var/lib/cloudera-host-monitor[root@dn58 parcels]# mkdir -p /var/lib/cloudera-service-monitor[root@dn58 parcels]# chown -R cloudera-scm:cloudera-scm /var/lib/cloudera-host-monitor[root@dn58 parcels]# chown -R cloudera-scm:cloudera-scm /var/lib/cloudera-service-monitor
21、添加CMS,用于运维CDH的服务组件
安装完毕界面
参考:
https://docs.cloudera.com/documentation/enterprise/6/latest/topics/installation.html