其他分享
首页 > 其他分享> > cdh 6.2.1部署

cdh 6.2.1部署

作者:互联网

环境准备

此次部署为5台服务器,hadoop1有公网,其他均为内网

角色划分方面,由于演示集群的总节点数很少,不可避免有大量角色合设。最终分配方案如下(CM:Cloudera Manager;NN:NameNode;RM:ResourceManager;ZK: ZooKeeper;SNN:SecondaryNameNode;HS2:HiveServer2;DN:DataNode;NM: NodeManager;M:HBase Master;RS:RegionServer):

hadoop1(2核8G):CM、NN、RM、Hue   hadoop2:SNN、HS2、M   hadoop3:DN、NM、ZK、RS   hadoop4:DN、NM、ZK、RS   hadoop5:DN、NM、ZK、RS
 vim /etc/hosts
 192.168.0.206   hadoop1
 192.168.0.209   hadoop2
 192.168.0.208   hadoop3
 192.168.0.210   hadoop4
 192.168.0.207   hadoop5
 vim /etc/rc.d/rc.local
 # 最下面添加以下代码
 if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
 echo never > /sys/kernel/mm/transparent_hugepage/enabled
 fi
 if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
 echo never > /sys/kernel/mm/transparent_hugepage/defrag
 fi
 ​
 chmod +x /etc/rc.d/rc.local
 ​
 重启服务器reboot 生效配置
 上传 jdk-mysql-connector 我放在root下了 内包含jdk-8u181-linux-x64.rpm   mysql-connector-java-5.1.41-bin.jar
 scp -r jdk-mysql-connector/ hadoop2:`pwd`
 ​
 # 进入目录
 cd /root/jdk-mysql-connector/
 ​
 # 安装rpm包
 yum -y install *.rpm 
 ​
 #配置环境变量
 cd ~
 vi .bash_profile
 ​
 # 增加一行
 export JAVA_HOME=/usr
 cd ~
 source .bash_profile
 ​
 # 查看JDK版本信息
 java -version
 ​
 # 把jar包创建软连接
 ​
 mkdir -p /usr/share/java/
 cd ~/jdk-mysql-connector
 cp mysql-connector-java-5.1.41-bin.jar /usr/share/java/
 cd /usr/share/java/
 ln -s mysql-connector-java-5.1.41-bin.jar mysql-connector-java.jar

单机hadoop1部署 只在hadoop1配即可

 # 安装http服务
 yum -y install httpd
 systemctl start httpd
 systemctl enable httpd  #检查一下是否开启了http服务
 mv cdh/ /var/www/html/     
 # cdh目录包含以下内容
 -rw-r--r-- 1 root root 2093332003 Feb 20 10:50 CDH-6.2.1-1.cdh6.2.1.p0.1425774-el7.parcel
 -rw-r--r-- 1 root root         40 Feb 20 10:35 CDH-6.2.1-1.cdh6.2.1.p0.1425774-el7.parcel.sha1
 -rw-r--r-- 1 root root         64 Feb 20 10:35 CDH-6.2.1-1.cdh6.2.1.p0.1425774-el7.parcel.sha256
 -rw-r--r-- 1 root root       4825 Feb 20 10:35 index.html
 -rw-r--r-- 1 root root      33875 Feb 20 10:35 manifest.json
 ​
 mv cm/ /var/www/html/  
 # cm包含以下内容
 -rw-r--r-- 1 root root      14041 Feb 20 12:02 allkeys.asc
 -rw-r--r-- 1 root root   10215608 Feb 20 10:35 cloudera-manager-agent-6.2.1-1426065.el7.x86_64.rpm
 -rw-r--r-- 1 root root 1199718256 Feb 20 10:44 cloudera-manager-daemons-6.2.1-1426065.el7.x86_64.rpm
 -rw-r--r-- 1 root root       9988 Feb 20 10:44 cloudera-manager-server-6.2.1-1426065.el7.x86_64.rpm
 -rw-r--r-- 1 root root      10996 Feb 20 10:44 cloudera-manager-server-db-2-6.2.1-1426065.el7.x86_64.rpm
 -rw-r--r-- 1 root root   14200072 Feb 20 10:44 enterprise-debuginfo-6.2.1-1426065.el7.x86_64.rpm
 -rw-r--r-- 1 root root       3493 Feb 20 10:44 index.html
 -rw-r--r-- 1 root root  184988341 Feb 20 10:45 oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
 ​
 mv flink/ /var/www/html/
 # flink 包含以下内容
 -rw-r--r-- 1 root root 130962403 Feb 20 10:46 FLINK-1.9.0-csa1.0.0.0-cdh6.3.0-el7.parcel
 -rw-r--r-- 1 root root        41 Feb 20 10:46 FLINK-1.9.0-csa1.0.0.0-cdh6.3.0-el7.parcel.sha
 -rw-r--r-- 1 root root     12407 Feb 20 10:46 FLINK-1.9.0-csa1.0.0.0-cdh6.3.0.jar
 -rw-r--r-- 1 root root      4421 Feb 20 10:46 manifest.json
 ​
 cd /var/www/html/cm/
 ​
 yum -y install createrepo
 createrepo .
 vi /etc/yum.repos.d/cm.repo

 [cmrepo]
 name=Cloudera Manager 6.2
 baseurl=http://192.168.0.206/cm
 gpgcheck=false
 enable=true

 # 查看一下yum源内是否有了
 yum search cloudera-manager-server
cd ~/mysql-5.7.27
 yum -y install mysql*.rpm
 systemctl start mysqld
 # 查看随机密码
 grep 'temporary password' /var/log/mysqld.log
 mysql -uroot -p
 ​
 # 修改数据库密码
 set password for root@'localhost'=password('Mqaz820826!@');
 ​
 #创建对应服务的库,设置密码
 create database scm default character set utf8;
 CREATE USER 'scm'@'%' IDENTIFIED BY 'Mqaz820826!@';
 GRANT ALL PRIVILEGES ON scm.* TO 'scm'@'%';
 create database rman default character set utf8;
 CREATE USER 'rman'@'%' IDENTIFIED BY 'Mqaz820826!@';
 GRANT ALL PRIVILEGES ON rman.* TO 'rman'@'%';
 create database hive default character set utf8;
 CREATE USER 'hive'@'%' IDENTIFIED BY 'Mqaz820826!@';
 GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%';
 create database oozie default character set utf8;
 CREATE USER 'oozie'@'%' IDENTIFIED BY 'Mqaz820826!@';
 GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';
 create database hue default character set utf8;
 CREATE USER 'hue'@'%' IDENTIFIED BY 'Mqaz820826!@';
 GRANT ALL PRIVILEGES ON hue.* TO 'hue'@'%';
 create database sentry default character set utf8;
 CREATE USER 'sentry'@'%' IDENTIFIED BY 'Mqaz820826!@';
 GRANT ALL PRIVILEGES ON sentry.* TO 'sentry'@'%';
 ​
 flush privileges;
yum -y install cloudera-manager-daemons cloudera-manager-server
 ​
 /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm 'Mqaz820826!@'
 ​
 systemctl start cloudera-scm-server
 tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log  #查看日志有Started Jetty server 就说明成功了

 

 

 

 

 

 

 

 

 

 

 

 

标签:10,rw,Feb,部署,cdh,--,6.2,20,root
来源: https://blog.csdn.net/qq_41961206/article/details/121537466