CDH安装

时钟对齐

代码语言:shell
复制
systemctl enable ntpd
systemctl start ntpd 
systemctl status ntpd

免密登录

代码语言:shell
复制
ssh-keygen -t rsa

ssh-copy-id node01
ssh-copy-id node02
ssh-copy-id node03

mysql安装

代码语言:txt
复制
# mysql安装包下载
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.16-1.el7.x86_64.rpm-bundle.tar

解压

tar -xvf mysql-5.7.16-1.el7.x86_64.rpm-bundle.tar

安装

rpm -ivh mysql-community-common-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.16-1.el7.x86_64.rpm

启动服务

systemctl start mysqld

查看初识密码

cat /var/log/mysqld.log | grep password

mysql登录

mysql -uroot -p

mysql数据初始化

create database cmf DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
set global validate_password_length=4;
set global validate_password_policy=0;
grant all privileges on cmf.* to 'cmf'@'%' identified by 'P@ssw0rd';
grant all privileges on amon.* to 'amon'@'%' identified by 'P@ssw0rd';

Hive数据库

create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

grant #auth on #databaseName.#table to '#userName'@'#host';

给test账号赋值权限

Oozie数据库

create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

Hue数据库

create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

flush privileges;
quit;

CM部署

安装依赖包

代码语言:shell
复制
yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb portmap httpd mod_ssl openssl-devel python-psycopg2 MySQL-python libpq.so.5

主节点安装

代码语言:shell
复制
rpm -ivh cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
rpm -ivh cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm
修改db.properties

vim /etc/cloudera-scm-server/db.properties

代码语言:text
复制
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.

This file describes the database connection.

The database type

Currently 'mysql', 'postgresql' and 'oracle' are valid databases.

com.cloudera.cmf.db.type=mysql

The database host

If a non standard port is needed, use 'hostname:port'

#com.cloudera.cmf.db.host=node01:3306

The database name

com.cloudera.cmf.db.name=cmf

The database user

com.cloudera.cmf.db.user=cmf

The database user's password

com.cloudera.cmf.db.password=P@ssw0rd

The db setup type

After fresh install it is set to INIT

and will be changed post config.

If scm-server uses Embedded DB then it is set to EMBEDDED

If scm-server uses External DB then it is set to EXTERNAL

com.cloudera.cmf.db.setupType= EXTERNAL

安装agent
代码语言:txt
复制
rpm -ivh cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm

vim /etc/cloudera-scm-agent/config.ini

代码语言:text
复制
[General]

Hostname of the CM server.

server_host=node01

初始化

代码语言:shell
复制
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql cmf cmf
启动server和agent

主节点启动serve

代码语言:shell
复制
systemctl start cloudera-scm-server

查看日志,出现7180说明启动成功,,有错误解决错误

代码语言:txt
复制
tail -F /var/log/cloudera-scm-server/cloudera-scm-server.log

子节点安装daemons agent

代码语言:shell
复制
rpm -ivh cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
rpm -ivh cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
代码语言:shell
复制
vi /etc/cloudera-scm-agent/config.ini
代码语言:text
复制
[General]

Hostname of the CM server.

server_host=node01

所有节点启动 agent
代码语言:shell
复制
systemctl start cloudera-scm-agent