码迷,mamicode.com
首页 > 其他好文 > 详细

CDH5.13.3安装手册

时间:2019-06-20 09:15:59      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:emctl   文件下载   stack   微软雅黑   art   装包   pat   zip   word   

 

Server端需要打开端口 7180 7182

选址正确的版本,cdh版本不要高于cm版本

 

 

CM下载地址

http://archive.cloudera.com/cm5/cm/5/cloudera-manager-centos7-cm5.13.3_x86_64.tar.gz

CDH下载地址

http://archive.cloudera.com/cdh5/parcels/5.13.3/CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel

http://archive.cloudera.com/cdh5/parcels/5.13.3/CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1

http://archive.cloudera.com/cdh5/parcels/5.13.3/manifest.json

 

 

 

安装JAVA环境

 

 

关闭防火墙以及selinux

 

 

配置NTP服务

 

 

设置swap空间

Cloudera建议将交换空间设置为0,过多的交换空间会引起GC耗时的激增,所以还是关闭的为好。)

执行命令 (所有节点)

echo "vm.swappiness = 0" >> /etc/sysctl.conf

执行命令 (所有节点)

echo never > /sys/kernel/mm/transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/defrag

 

安装mysql

安装文件下载目录:/opt/software/mysql

数据库保存位置:/opt/software/mysql/datamysql

日志保存位置:/opt/software/mysql/logmysql

Mysql 下载 https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.25-el7-x86_64.tar

解压缩到/usr/local/ 目录下

tar -xf mysql-5.7.25-el7-x86_64.tar  /usr/local/

cd /usr/local

tar -zxvf ./mysql-5.7.25-el7-x86_64.tar.gz

 mv ./mysql-5.7.25-el7-x86_64 ./mysql

7.2 创建mysql用户用户组及目录

Groupadd mysql

 useradd -r -s /sbin/nologin -g mysql mysql -d /usr/local/mysql

该用户禁止shell登录,同时修改用户目录权限

 cd /usr/local/mysql

 chown -R mysql

 chgrp -R mysql .

chown -R mysql:mysql /opt/software/mysql/datamysql 

chown -R mysql:mysql /opt/software/mysql/logmysql

7.3 初始化MYSQL

 /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/opt/software/mysql/datamysql

 有报错

这是因为缺少安装包libaio和libaio-devel导致的不用紧张yum来帮忙

 yum install libaio*

再次报错

 


这是却少numactl这个时候如果是Centosyum -y install numactl就可以解决这个问题了

 

 

安装成功 初始 密码:r/TYl;FqW2Ll

 

再次执行

 /usr/local/mysql/bin/mysql_ssl_rsa_setup  --datadir=/opt/software/mysql/datamysql

有报错先跳过

修改/etc/my.cnf

[client]

port = 3306

socket = /usr/local/mysql/mysql.sock

 

[mysql]

no-auto-rehash

default-character-set=utf8

 

[mysqld]

socket = /usr/local/mysql/mysql.sock

basedir = /usr/local/mysql

max_allowed_packet = 64M

datadir = /data/mysql

explicit_defaults_for_timestamp = true

skip-ssl

secure-file-priv = NULL

lower_case_table_names = 1

back_log = 300

max_connections = 3000

max_connect_errors = 100

table_open_cache = 4096

external-locking = FALSE

max_allowed_packet = 64M

sort_buffer_size = 32M

join_buffer_size = 32M

thread_cache_size = 16

query_cache_size = 128M

query_cache_limit = 4M

thread_stack = 512K

transaction_isolation = REPEATABLE-READ

tmp_table_size = 128M

max_heap_table_size = 128M

 

character-set-server=utf8

 

long_query_time = 6

slow_query_log_file=/opt/software/mysql/logmysql/slow.log

 

[mysqld_safe]

open-files-limit = 8192

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 

拷贝修改启动文件

cp /usr/local/mysql/support-files/mysql.server  /etc/init.d/mysql

修改

 

 

7.4 运行mysql

启动mysql /etc/init.d/mysql restart

有报错可以看

/opt/software/mysql/datamysql/presto4.err

 

/usr/local/mysql/bin/mysql --user=root -p

r/TYl;FqW2Ll

 

7.5

依次输入以下命令:

mysql> set password=password(‘N$nIpms1’);  --修改密码

mysql>grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘N$nIpms1‘;--允许远程访问

mysql> flush privileges;--刷新授权表

创建CM用的数据库:

--hive数据库 

create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci ;

--集群监控数据库

create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci ;

--hue数据库

create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

-- oozie数据库

create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;


7.5 配置文档以便启动

Vim /etc/profile

export PATH=/usr/local/mysql/bin:$PATH

 

Source /etc/profile

 systemctl  enable  mysql

 

chmod 755 /etc/init.d/mysql

 

 

 安装Cloudera Manager Server和 Agent

cd /opt/cdh

tar -zxvf cloudera-manager-centos7-cm5.13.3_x86_64.tar.gz

 

这里开始我们的cm需要与mysql进行交互,所以首先需要去MySql的官网下载JDBC驱动,http://dev.mysql.com/downloads/connector/j/,解压后找到mysql-connector-java-5.1.**-bin.jar,放到/opt/cm-5.12.1/share/cmf/lib/中,不多赘述。

 

  mv ./mysql-connector-java-5.1.40-bin.jar  /opt/cdh/cm-5.13.3/share/cmf/lib/



8.2 在主节点初始化CM5的数据库:

/opt/cdh/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -p’N$nIpms1’ --scm-host localhost scm scm scm

 

有报错 注意引号是中文得引号还是英文得

 

修改文件/opt/cdh/cm-5.13.3/etc/cloudera-scm-agent/config.ini

 

Serverserver也要做免密

 

Cd /opt/cdh

Tar -zcvf cm-5.13.3.gz cm-5.13.3

把包文件包拷贝到其他两台机器

Scp ./cm-5.13.3.gz presto2:/opt/cdh

Scp ./cm-5.13.3.gz presto3:/opt/cdh

解压

然后新增用户

useradd --system --home=/opt/cdh/cm-5.13.3/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm

修改文件属性

chown -R  cloudera-scm:cloudera-scm /opt/cdh/

 

 

 

8.3 准备Parcels,用以安装CDH5

将我们提前下载好的Parcels文件上传到主节点的/opt/cdh/cloudera/parcel-repo/目录中(如果没有parcel-repo需要手动创建,这里不需要分发到所有节点)。

 

注意!!最后一定要将CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha1,重命名为CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha,去掉末尾的1,否则系统会重新下载CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel文件,也就不是纯离线安装了。

Cd /opt/cdh

cp ./CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel* /opt/cdh/cloudera/parcel-repo/

cp ./manifest.json  /opt/cdh/cloudera/parcel-repo/

Cd /opt/cdh/cloudera/parcel-repo/

mv CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha1 CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel

 

8.4启动服务端客户端

通过/opt/cdh/cm-5.13.3/etc/init.d/cloudera-scm-server start启动服务端。

通过/opt/cdh/cm-5.13.3/etc/init.d/cloudera-scm-agent start启动Agent服务(所有Agent节点)。

以上我们是通过脚本来启动的,所以需要停止服务的时候,只需要把以上的start参数改为stop就可以啦。

service服务启动需要几分钟,取决于服务器的性能,此时我们可以使用

netstat -apn|grep 7180

 

启动成功但是又2个报错

mkdir /var/lib/cloudera-scm-server

chown -R cloudera-scm.cloudera-scm /var/lib/cloudera-scm-server

重启

 

正常

 

启动agent

/opt/cdh/cm-5.13.3/etc/init.d/cloudera-scm-agent start

有报错

打开7180 7182端口

 

8.5 页面配置

 

账号密码默认为admin

 

 

 

如果前面配置正确,这里应该有三台设备

 

 

 

 

对于图上的报错,是因为没有把parcels文件放在默认的目录下

点击更多选项

 

还是不行,直接重启server搞定(貌似必须重启)

 

 

 

 

 

 

 

 

 

集群安装

 

 

 

 

 

安装HIVE有报错

 

 wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.zip

unzip mysql-connector-java-5.1.46.zip

 

Cp ./mysql-connector-java-5.1.46.jar  /opt/cloudera/parcels/CDH-5.13.3-1.cdh5.13.3.p0.2/lib/hive/lib

注意一定还要拷贝到/usr/share/hive/mysql-connector-java.jar 下面,需要改名(去掉版本后缀)

Cp ./mysql-connector-java-5.1.46.jar  /usr/share/hive/mysql-connector-java.jar

 

 

Oozie也报错

 

 

 

Cp mysql-connector-java.jar  /var/log/oozie  这里位置不同。要注意

 

 

 

 

Hue报错

ImportError: libxslt.so.1: cannot open shared object file: No such file or directory

 

 

 

yum install libxslt

 

 

 

页面发现 报错

‘No portmap or rpcbind service is running on this host. Please start portmap or rpcbind service before attempting to start the NFS Gateway role on this host.‘

 

 

 yum install rpcbind.x86_64

启动

systemctl start rpcbind

 

 

 

 

 

集群配置

 

 

 

 

CDH5.13.3安装手册

标签:emctl   文件下载   stack   微软雅黑   art   装包   pat   zip   word   

原文地址:https://www.cnblogs.com/ZFBG/p/11056528.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!