CDH6.2.0安装(三)
Step10: 上传安装文件
Step11: 检查文件是否正确
- 确保cloudera-manager.repo文件放入/etc/yum.repos.d/目录
- 确保parcel目录下文件完整
Step12: 安装jdk&CM
- 验证repo文件是否起效
yum list | grep cloudera
#如果列出的不是待安装的版本,执行下面命令重试
yum clean all
yum list | grep cloudera
- 切换到jdk&cm目录下,执行
yum -y install *.rpm
- 设置java路径:
vi /etc/profile# 在该文件末尾添加以下行
export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera/
export PATH=$JAVA_HOME/bin:$PATH
- 检查安装:
java -version
Step13: 安装数据库(mysql)
需要用到数据库的组件:
Cloudera Manager Server
Cloudera Management Service roles:
Activity Monitor
Reports Manager
Cloudera Navigator Audit Server
Cloudera Navigator Metadata Server
Hue
Each Hive metastore
Oozie
参考
- 安装mysql数据库服务器(master)
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo yum update
sudo yum -y install mysql-server
sudo systemctl start mysqld
- 数据库设置:
停止服务:sudo systemctl stop mysqld
修改配置:sudo vi /etc/my.cnfTo prevent deadlocks, set the isolation level to READ-COMMITTED.Configure the InnoDB engine
设置自动启动:sudo systemctl enable mysqld
启动服务:sudo systemctl start mysqld
设置启动密码:sudo /usr/bin/mysql_secure_installation
- 安装JDBC驱动(所有节点):
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz
tar zxvf mysql-connector-java-5.1.46.tar.gz
sudo mkdir -p /usr/share/java/
cd mysql-connector-java-5.1.46
sudo cp mysql-connector-java-5.1.46-bin.jar /usr/share/java/mysql-connector-java.jar
4、根据下表组件中的信息运行如下语句为组件创建用户
CREATE DATABASE <database> DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON <database>.* TO '<user>'@'%' IDENTIFIED BY '<password>’;
初始化数据库sql
CREATE DATABASE scm CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'scm';CREATE DATABASE amon CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'amon';CREATE DATABASE rman CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'rman';CREATE DATABASE hue CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'hue';CREATE DATABASE metastore CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON metastore.* TO 'hive'@'%' IDENTIFIED BY 'hive';CREATE DATABASE sentry CHARACTER SET utf8 COLLATE utf8_general_ci;
RANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'sentry';CREATE DATABASE nav CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'nav';CREATE DATABASE navms CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'navms';CREATE DATABASE oozie CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie';
5、运行如下脚本配置scm server数据库:
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm
Step14: 安装CDH(只在master节点)
1.启动scm server:
sudo systemctl start cloudera-scm-server
- 查看日志,检查是否启动完成:
sudo tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
--查看到【WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.】日志表示启动完成
- 登录主页(账号/密码:admin/admin):
http://master:7180
- 初始化CDH,建立Cluster
CDH启动与关闭
CM Portal 地址:
http://master:7180/cmf/home
关闭步骤:
在CM portal上关闭 cluster
在所有节点关闭CM agent: sudo systemctl stop cloudera-scm-agent
在master节点关闭CM server: sudo systemctl stop cloudera-scm-server
启动步骤:
在所有节点启动CM agent: sudo systemctl start cloudera-scm-agent
在master节点启动CM server: sudo systemctl start cloudera-scm-server
在CM portal上启动 cluster
查看启动日志:
/var/log/cloudera-scm-server/cloudera-scm-server.log