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环境

CDH5.13.3安装手册-LMLPHP

三 关闭防火墙以及selinux

四 配置NTP服务(云主机一般不用管 除非配置单独的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

有报错

CDH5.13.3安装手册-LMLPHP

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

yum install libaio*

再次报错

CDH5.13.3安装手册-LMLPHP

这是却少numactl这个时候如果是Centos

yum -y install numactl

就可以解决这个问题了.

CDH5.13.3安装手册-LMLPHP

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

再次执行

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

有报错先跳过

修改/etc/my.cnf

[client]

port =

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 =

back_log =

max_connections =

max_connect_errors =

table_open_cache =

external-locking = FALSE

max_allowed_packet = 64M

sort_buffer_size = 32M

join_buffer_size = 32M

thread_cache_size =

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 =

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

[mysqld_safe]

open-files-limit =

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

拷贝修改启动文件

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

修改

CDH5.13.3安装手册-LMLPHP

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

CDH5.13.3安装手册-LMLPHP

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

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

CDH5.13.3安装手册-LMLPHP

Server和server也要做免密

Cd /opt/cdh

Tar -zcvf cm-5.13.3.gz cm-5.13.3 (这里注意 一定要先考过到其他主机才能启动,因为启动(agent)会生成一个uuid,如果先启动再来拷贝就会出现 界面安装的时候只能识别到一台主机,并且这个主机的IP hostname一直在变化的情况,因为三台主机公用一个UUID造成的,不过不小心先启动了agent  需要的目录里面cd /opt/cm-5.13.3/lib/cloudera-scm-agent  删除这下面的所有然后重启)

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

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

CDH5.13.3安装手册-LMLPHP

启动成功但是又2个报错

mkdir /var/lib/cloudera-scm-server

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

重启

CDH5.13.3安装手册-LMLPHP

正常

启动agent

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

有报错

CDH5.13.3安装手册-LMLPHP

打开7180 7182端口

8.5 页面配置

账号密码默认为admin

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

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

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

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

点击更多选项

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

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

集群安装

CDH5.13.3安装手册-LMLPHP

CDH5.13.3安装手册-LMLPHP

安装HIVE有报错

CDH5.13.3安装手册-LMLPHP

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也报错

CDH5.13.3安装手册-LMLPHP

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

CDH5.13.3安装手册-LMLPHP

Hue报错

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

CDH5.13.3安装手册-LMLPHP

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.'

CDH5.13.3安装手册-LMLPHP

yum install rpcbind.x86_64

启动

systemctl start rpcbind

集群配置

CDH5.13.3安装手册-LMLPHP

报错:如果出现 服务通信正常 但是主机异常

不良 : 该主机已与 Cloudera Manager Server 建立联系。 该主机未与 Host Monitor 建立联系。

很有可能是hosts 有某个主机没有配置对,centos6.x的主机需要配置、/etc/sysconfig/network

另外推荐一个6.1.0的安装博客  https://blog.51cto.com/wzlinux/2321433

05-11 22:52