centos7安装CDH6文档

Posted aitwhite

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7安装CDH6文档相关的知识,希望对你有一定的参考价值。

1、准备工作

1.1 环境

centos7、jdk8、mysql5.7、python2.7

1.2文件下载

1.2.1 cloudmanger地址

https://archive.cloudera.com/cm6/6.0.0/redhat7/yum/RPMS/x86_64/ 
  • cloudera-manager-agent-6.0.0-530873.el7.x86_64.rpm
  • cloudera-manager-daemons-6.0.0-530873.el7.x86_64.rpm
  • cloudera-manager-server-6.0.0-530873.el7.x86_64.rpm

    1.2.2 资源下载地址

    https://archive.cloudera.com/cdh6/6.0.0/parcels/
  • CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel
  • CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel.sha256
  • manifest.json

2、开始安装

2.1 服务器配置

2.1.1 修改HOST和主机名

  1. vim /etc/hosts修改host,例如

    198.168.12.1 cdh1

    192.168.12.2 cdh2

    192.168.12.3 cdh3

    不能有大写字母和下划线
  2. vim /etc/hostname修改主机名,修改完后三台机器分别执行hostname ***(当前节点的主机名)

    2.1.2 配置免密登录

  3. ssh-keygen -t rsa -P ‘‘ -f ~/.ssh/id_rsa b、ssh-copy-id 每台服务器地址

    2.1.3 关闭防火墙

  4. 临时关闭 systemctl stop firewalld
  5. 禁止开机启动 systemctl disable firewalld

    2.1.4 安装jdk,配置环境变量

    这个大家都会,如果不会可以参考这个教程

    https://www.cnblogs.com/ocean-sky/p/8392444.html

    2.1.5 其他依赖

    每台服务器yum安装依赖包:redhat-lsb、portmap、httpd、mod_ssl、openssl-devel、python-psycopg2、MySQL-python、chkconfig、python、chkconfig、bind-utils、libxslt、zlib、sqlite、cyrus-sasl-plain、cyrus-sasl-gssapi、fuse、fuse-libs

    2.2 Mysql5.7安装(在主节点安装)

    2.2.1 安装

  6. wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
  7. yum -y install mysql57-community-release-el7-10.noarch.rpm
  8. yum -y install mysql-community-server
  9. 启动 systemctl start mysqld.service
  10. 查看运行状态 systemctl status mysqld.service
  11. 查看初始密码 grep "password" /var/log/mysqld.log
  12. 登录后修改密码(尽量复杂一点,太简单了验证不通过,也可以查看如何关闭mysql校验规则) ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘new password‘;
  13. 卸载yum源防止自动更新 yum -y remove mysql57-community-release-el7-10.noarch
  14. 安装MySQL-shared-compat或MySQL-shared软件包(这是Cloudera Manager Agent软件包安装所必需的)yum install MySQL-shared-advanced

    2.2.2 创建CDH相关数据库

  • create database scm default character set utf8 default collate utf8_general_ci;
  • grant all on scm.* to ‘scm‘@‘%‘ identified by ‘password‘;
  • create database amon default character set utf8 default collate utf8_general_ci;
  • grant all on amon.* to ‘amon‘@‘%‘ identified by ‘password‘;
  • create database rman default character set utf8 default collate utf8_general_ci;
  • grant all on rman.* to ‘rman‘@‘%‘ identified by ‘password‘;
  • create database hue default character set utf8 default collate utf8_general_ci;
  • grant all on hue.* to ‘hue‘@‘%‘ identified by ‘password‘;
  • create database metastore default character set utf8 default collate utf8_general_ci;
  • grant all on metastore.* to ‘hive‘@‘%‘ identified by ‘password‘;
  • create database sentry default character set utf8 default collate utf8_general_ci;
  • grant all on sentry.* to ‘sentry‘@‘%‘ identified by ‘password‘;
  • create database nav default character set utf8 default collate utf8_general_ci;
  • grant all on nav.* to ‘nav‘@‘%‘ identified by ‘password‘;
  • create database oozie default character set utf8 default collate utf8_general_ci;
  • grant all on oozie.* to ‘oozie‘@‘%‘ identified by ‘password‘;

    2.3 CDH安装

  1. mkdir /opt/cloudera-manager
  2. 将cloudera-manager-agent-6.0.0-530873.el7.x86_64.rpm、cloudera-manager-daemons-6.0.0-530873.el7.x86_64.rpm 、cloudera-manager-server-6.0.0-530873.el7.x86_64.rpm
    复制到/opt/cloudera-manager文件夹中
  3. 按 daemons、server、agent顺序解压
  4. 修改文件/etc/cloudera-scm-agent/config.ini中serverhost指定server节点
  5. 下载mysql-connector-java-5.1.47.jar包并复制为/usr/share/java/mysql-connector-java.jar
  6. 在主节点执行
    /opt/cloudera/cm/schema/scmpreparedatabase.sh mysql -h 主节点ip --scm-host 主节点ip scm scm
  7. mkdir -p /opt/cloudera/parcel-repo
  8. 将CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel、CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel.sha256、manifest.json复制到/opt/cloudera/parcel-repo
  9. 将CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel.sha256 重命名为 CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel.sha
  10. 在manifest.json文件中,找到对应版本的秘钥,复制到CDH-6.0.0-1.cdh6.0.0.p0.537114-el7.parcel.sha文件中。
    11.启动systemctl start cloudera-scm-agent、systemctl start cloudera-scm-server

    2.4 集群配置

    2.4.1 禁用透明大页面压缩

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

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

    2.4.1 分配组件

    访问http://192.168.1.1:7180开始配置集群组件
    因为是先安装集群后编写文档,没有截图就没有详细些。


以上是关于centos7安装CDH6文档的主要内容,如果未能解决你的问题,请参考以下文章

Centos7 安装CDH6.3.2 集群

CentOS7 Cloudera Manager6 完全离线安装 CDH6 集群

CDH6安装配置和使用LZO压缩

CentOS7部署CDH6.0.1大数据平台

03 - CDH 6.3.x 安装

CDH6.3.2 开启Kerberos 认证