使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)

目录

一、CDH和Cloudera Manager简介

1.CDH:(官网简介)

2.Cloudera Manager:(官网简介)

二、安装前环境配置(官方教程)

1.安装环境

2.配置网络名

3.禁用防火墙

4.设置SElinux

5.使能NTP服务

6.安装Python 2.7

三、本地仓库建立

1.配置Cloudera Manager Package 和CDH Package 本地仓库(官方教程)

2.配置 本地 CDH Parcel  仓库

四、安装过程(官网教程)

1.配置yum仓库源(以RHEL 7 系统为例)

2.安装JDK

3.安装Cloudera Manager Server

4.安装数据库(这里使用Mysql数据库)

5.设置Cloudera Manager Database

6.安装CDH和其它服务

7.设置集群

五、安装问题整理

问题一:

问题二:

问题三:

六、参考:


一、CDH和Cloudera Manager简介

1.CDH:(官网简介)

CDH is Cloudera's software distribution containing Apache Hadoop and related projects. 

CDH is the most complete, tested, and popular distribution of Apache Hadoop and related projects. CDH delivers the core elements of Hadoop – scalable storage and distributed computing – along with a Web-based user interface and vital enterprise capabilities. CDH is Apache-licensed open source and is the only Hadoop solution to offer unified batch processing, interactive SQL and interactive search, and role-based access controls.

  • Flexibility—Store any type of data and manipulate it with a variety of different computation frameworks including batch processing, interactive SQL, free text search, machine learning and statistical computation.
  • Integration—Get up and running quickly on a complete Hadoop platform that works with a broad range of hardware and software solutions.
  • Security—Process and control sensitive data.
  • Scalability—Enable a broad range of applications and scale and extend them to suit your requirements.
  • High availability—Perform mission-critical business tasks with confidence.
  • Compatibility—Leverage your existing IT infrastructure and investment.

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第1张图片

2.Cloudera Manager:(官网简介)

Cloudera Manager is an end-to-end application for managing CDH clusters. Cloudera Manager sets the standard for enterprise deployment by delivering granular visibility into and control over every part of the CDH cluster—empowering operators to improve performance, enhance quality of service, increase compliance and reduce administrative costs. With Cloudera Manager, you can easily deploy and centrally operate the complete CDH stack and other managed services. The application automates the installation process, reducing deployment time from weeks to minutes; gives you a cluster-wide, real-time view of hosts and services running; provides a single, central console to enact configuration changes across your cluster; and incorporates a full range of reporting and diagnostic tools to help you optimize performance and utilization. 

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第2张图片

The Cloudera Manager Server works with several other components:

  • Agent - installed on every host. The agent is responsible for starting and stopping processes, unpacking configurations, triggering installations, and monitoring the host.
  • Management Service - a service consisting of a set of roles that perform various monitoring, alerting, and reporting functions.
  • Database - stores configuration and monitoring information. Typically, multiple logical databases run across one or more database servers. For example, the Cloudera Manager Server and the monitoring roles use different logical databases.
  • Cloudera Repository - repository of software for distribution by Cloudera Manager.
  • Clients - are the interfaces for interacting with the server:
    • Admin Console - Web-based UI with which administrators manage clusters and Cloudera Manager.
    • API - API with which developers create custom Cloudera Manager applications.

二、安装前环境配置(官方教程)

1.安装环境

本教程安装的主机系统为CentOS 7 X86_64: 7.3.1611、 7.6.1810 ,

安装版本信息:Cloudera Manager 6.1.0 + Cloudera Manager Agent 6.1.0 + CDH 6.1.0 

CDH 安装服务及版本信息:安装 Zookeeper3.4.5+ Kafka2.0.0

2.配置网络名

2.1将hostname 设置为唯一的名字

sudo hostnamectl set-hostname foo-1.example.com

2.2编辑 /etc/hosts 文件,设置集群中每一台主机的IP地址和全称域名

1.1.1.1  foo-1.example.com  foo-1
2.2.2.2  foo-2.example.com  foo-2
3.3.3.3  foo-3.example.com  foo-3
4.4.4.4  foo-4.example.com  foo-4

2.3编辑 /etc/sysconfig/network ,设置全称域名

HOSTNAME=foo-1.example.com

2.4验证每台主机在网络中一致的标识

uname -a

3.禁用防火墙

RHEL 7 compatible:

sudo systemctl disable firewalld
sudo systemctl stop firewalld

4.设置SElinux

4.1 检查SElinux 状态

getenforce

4.2 如果输出是 Permissive 或者 Disabled, 则不用配置SElinux,如果输出是enforcing 执行下面步骤设置SElinux

4.3 打开 /etc/selinux/config 文件 (在某些系统下是  /etc/sysconfig/selinux 文件)

4.4 将 SELINUX=enforcing 改为 SELINUX=permissive

4.5 保存并且关闭文件

4.6 重启系统或者运行下面的命令立即禁用SElinux

setenforce 0

5.使能NTP服务

RHEL 7 系统使用 chronyd 代替 ntpd 服务,因此不需要安装ntpd ;如果系统运行chronyd ,Cloudera Manager使用chronyd监测主机时钟是否同步。

6.安装Python 2.7

CDH 6 需要 Python 2.7,RHEL 7系统包含Python 2.7,因此不要安装。查看pyhton 版本

python -V

三、本地仓库建立

说明:由于在线安装Cloudera Manager和CDH 受网速影响比较大,很容易下载失败,建议建立本地仓库,这样可以提升安装速度,本地仓库包含Cloudera Manager Pecket、CDH 安装包和CDH Parcel 3个部分,关于 Parcel 的介绍详见官方说明。

1.配置Cloudera Manager Package 和CDH Package 本地仓库(官方教程)

1.1设置web 服务器(这里使用Apache HTTP Server)

a.安装Apache HTTP Server

sudo yum install httpd

b.启动Apache HTTP Server

sudo systemctl start httpd

1.2.下载并发布安装包本地仓库

  • Cloudera Manager 6
# Create directory
sudo mkdir -p /var/www/html/cloudera-repos
# Download CM
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cm6/6.1.0/redhat7/ -P /var/www/html/cloudera-repos
# Download key
sudo wget https://archive.cloudera.com/cm6/6.1.0/allkeys.asc -P /var/www/html/cloudera-repos/cm6/6.1.0/
# Change permission mode
sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cm6

如果需要下载其它版本的Cloudera Manager6,将6.1.0  替换为你需要安装的版本,Cloudera Manager版本信息参考。

  • CDH 6
# Create directory
sudo mkdir -p /var/www/html/cloudera-repos
# Download CDH
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.1.0/redhat7/ -P /var/www/html/cloudera-repos 
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/gplextras6/6.1.0/redhat7/ -P /var/www/html/cloudera-repos
# Change permission mode
sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cdh6
sudo chmod -R ugo+rX /var/www/html/cloudera-repos/gplextras6

如果需要下载其它版本的CDH6,将6.1.0  替换为你需要安装的版本,CDH版本信息参考。

1.3 下载完安装包之后,在浏览器输入URL http:///cloudera-repos/ ,验证你下载的文件是否存在。

1.4 在将要安装Cloudera Manager的主机配置yum仓库的配置文件,使用本地搭建Cloudera Manager和CDH库。

创建/etc/yum.repos.d/cloudera-repo.repo文件,内容设置如下:web_server 是Web 服务器的主机名。

[cloudera-repo]
name=cloudera-repo
baseurl=http:///cloudera-repos/cm6/6.1.0/redhat7/yum
enabled=1
gpgcheck=0

2.配置 本地 CDH Parcel  仓库

2.1 安装Apache HTTP Server

sudo yum install httpd

2.2 配置服务器配置文件,防止从本地库下载parcel 文件出现Hash verification failed 错误信息

编辑Apache HTTP Server 配置文件/etc/httpd/conf/httpd.conf   在 模块中添加下面内容:

    AddType application/x-gzip .gz .tgz .parcel

如果没有 ,添加该内容如下(这个配置是在 RHEL 7 系统安装Apache HTTP Server 后的默认配置):


    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig /etc/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz .parcel

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

2.3 启动Apache HTTP Server

sudo systemctl start httpd

2.4 下载并发布 Parcel 仓库

CDH 6(这里下载6.1.0版本)

sudo mkdir -p /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.1.0/parcels/ -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/gplextras6/6.1.0/parcels/ -P /var/www/html/cloudera-repos
sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cdh6
sudo chmod -R ugo+rX /var/www/html/cloudera-repos/gplextras6

2.5 使用本地Parcel  库(在安装好Cloudera Manager 后,安装CDH的过程中需要用到)

在安装完成Cloudera Manager 打开控制台,安装CDH的时候选择使用Parcel ,然后配置本地Parcel仓库路径。

a.打开Cloudera Manager 管理控制台,在安装CDH界面配置Parcel仓库路径。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第3张图片

点击更多选项后,显示下面界面,默认路径是/opt/cloudera/parcel-repo ,移除不需要的所有远程Parcel库,如下图所示。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第4张图片

点击保存更改后如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第5张图片

b.将需要安装Pcrcel文件从本地Pcrcel库(/var/www/html/cloudera-repos/cdh6/6.1.0/parcels),copy到你指定的目录(这里使用默认目录/opt/cloudera/parcel-repo)。这里拷贝的文件四 ,CDH-6.1.0-1.cdh6.1.0.p0.770702-el7.parcel

c.进入Pcrcel 本地库目录/opt/cloudera/parcel-repo ,创建Parcel 文件的SHA1 哈希文件,命名为parcel_name.parcel.sha.

sha1sum CDH-6.1.0-1.cdh6.1.0.p0.770702-el7.parcel | awk '{ print $1 }' > CDH-6.1.0-1.cdh6.1.0.p0.770702-el7.parcel.sha

d. 更改Parcel 文件和hash 文件的所有权

sudo chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/*

e. 在 Cloudera Manager 管理员控制台,导航进入Parcels页面,选好Parcels本地库路径,如果配置成功,下面页面显示Parcels版本信息。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第6张图片

四、安装过程(官网教程)

1.配置yum仓库源(以RHEL 7 系统为例)

【注:这里不建议按照下面的步骤使用官方的yum源,因为下载速度满很容易安装失败,建议按照上面教程配置本地仓库】

1.1下载系统对应的 cloudera-manager.repo 文件,放到Cloudera Manager Server主机的 /etc/yum.repos.d/ 这个目录下。

点击选择Cloudera Manager 版本和下载信息。

sudo wget  -P /etc/yum.repos.d/
# Cloudera Manager 6.1.0
sudo wget https://archive.cloudera.com/cm6/6.1.0/redhat7/yum/cloudera-manager.repo -P /etc/yum.repos.d/

1.2导入库签名GPG 密钥

sudo rpm --import https://archive.cloudera.com/cm6/6.1.0/redhat7/yum/RPM-GPG-KEY-cloudera

2.安装JDK

2.1Cloudera Manager 对JDK的需求(官方需求):

  • The JDK must be 64-bit. Do not use a 32-bit JDK.
  • The installed JDK must be a supported version as documented in Java Requirements.
  • The same version of the JDK must be installed on each cluster host.
  • The JDK must be installed at  /usr/java/jdk-version.

2.2 手动安装Oracle JDK

a.去Oracle官网下载 64-bit 的java SE 8版本的.tar.gz 文件。

b.将文件解压到/usr/java/jdk-version目录

tar xvfz /path/to/jdk-8u-linux-x64.tar.gz -C /usr/java/

c.在集群的每台主机重复此步骤,安装JDK

3.安装Cloudera Manager Server

运行下面命令安装Cloudera Manager,建议参考第三步配置本地仓库,安装比较快。

sudo yum install cloudera-manager-daemons cloudera-manager-agent cloudera-manager-server

4.安装数据库(这里使用Mysql数据库)

4.1安装 Mysql

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 install mysql-server
sudo systemctl start mysqld

4.2 配置并启动Mysql服务器

a.在配置Mysql前先关闭Mysql服务

sudo systemctl stop mysqld

b.将/var/lib/mysql/ib_logfile0 和 /var/lib/mysql/ib_logfile1文件 从/var/lib/mysql/ 目录移除,移动到一个自己备份的目录下。

c.打开并修改/etc/my.cnf 文件,修改内容如下:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
transaction-isolation = READ-COMMITTED
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
symbolic-links = 0

key_buffer_size = 32M
max_allowed_packet = 32M
thread_stack = 256K
thread_cache_size = 64
query_cache_limit = 8M
query_cache_size = 64M
query_cache_type = 1

max_connections = 550
#expire_logs_days = 10
#max_binlog_size = 100M

#log_bin should be on a disk with enough free space.
#Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your
#system and chown the specified folder to the mysql user.
log_bin=/var/lib/mysql/mysql_binary_log

#In later versions of MySQL, if you enable the binary log and do not set
#a server_id, MySQL will not start. The server_id must be unique within
#the replicating group.
server_id=1

binlog_format = mixed

read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M

# InnoDB settings
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit  = 2
innodb_log_buffer_size = 64M
innodb_buffer_pool_size = 4G
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_log_file_size = 512M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

sql_mode=STRICT_ALL_TABLES

d.将Mysql设置为开机自启动

sudo systemctl enable mysqld

e.启动Mysql 服务

sudo systemctl start mysqld

f.找到安装后的临时密码(具体参考此文章)

sudo grep 'temporary password' /var/log/mysqld.log

 注:如果无法找到临时密码,说明没有成功安装,参考此文章 ,重新卸载Mysql 删除Mysql 相关目录后重新安装。

g.运行 /usr/bin/mysql_secure_installation 设置新的root密码,并配置安全相关的设置,这里需要用到上面找到的临时密码。

sudo /usr/bin/mysql_secure_installation

按照提示输入相应的字母,如下所示:

[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] N
[...]
Remove test database and access to it [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
All done!

4.3.安装JDBC

在集群的每台需要连接数据库的主机上面安装JDBC,(MySQL 5.6 需要 5.1.26以上的JDBC, Cloudera 建议使用5.1版本的JDBC )

a.下载“.tar.gz” 格式的Mysql JDBC 驱动(官网)

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

b.解压JDBC 的jar 文件

tar zxvf mysql-connector-java-5.1.46.tar.gz

c.将JDBC 驱动文件 重命名,并copy 到 /usr/share/java/目录下。

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.4 创造  Cloudera 软件需要的数据库

a.登录数据库,输入密码后登录

mysql -u root -p

b.通过下面的命令给部署在集群上需要使用数据库的每个服务创建数据库,

CREATE DATABASE  DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON .* TO ''@'%' IDENTIFIED BY '';

Cloudera 相关软件需要使用数据库的服务如下:

Databases for Cloudera Software
Service Database User
Cloudera Manager Server scm scm
Activity Monitor amon amon
Reports Manager rman rman
Hue hue hue
Hive Metastore Server metastore hive
Sentry Server sentry sentry
Cloudera Navigator Audit Server nav nav
Cloudera Navigator Metadata Server navms navms
Oozie oozie oozie

依次给每个服务创建数据库,并给相应的用户授予权限,这里所有用户使用统一的密码(Root@2019),在登录Mysql后运行如下命令:

 CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON metastore.* TO 'metastore'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'Root@2019';

 CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'Root@2019';

c.确定数据库是否创建成功

SHOW DATABASES;

d.记录刚才使用的每个服务使用的数据库名、用户名和密码,在后面安装Cloudera Manager 的过程中,需要正确的输入这些信息来让每个服务连接上对应的数据库。

5.设置Cloudera Manager Database

Cloudera Manager Server 提供一个脚本(scm_prepare_database.sh)可以创建并配置数据库,从而可以将数据库与Cloudera Manager相关的服务连接起来。

脚本使用语法参考:

sudo /opt/cloudera/cm/schema/scm_prepare_database.sh   

具体使用举例:

a. Mysql和 Cloudera Manager Server 运行在同一台主机(这里假设之前已经创建数据库名和用户名都为scm的mysql数据库)

sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm

输入密码后输出如下:

Enter SCM password:
JAVA_HOME=/usr/java/jdk1.8.0_141-cloudera
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing:  /usr/java/jdk1.8.0_141-cloudera/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/opt/cloudera/cm/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
[                          main] DbCommandExecutor              INFO  Successfully connected to database.
All done, your SCM database is configured correctly!

b.Mysql和 Cloudera Manager Server 运行在不同的主机(这里假设Cloudera Manager Server host :cm01.example.com,Mysql host:db01.example.com)

sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h db01.example.com --scm-host cm01.example.com scm scm

输入密码确认。

c.如果Cloudera Manager各个服务的数据库名和用户名按照本教程前面的命名创建,则可以使用下面的命令将服务和数据库连接。如果Mysql服务和Cloudera Manager服务位于相同主机选择以下命令:

#MySQL or MariaDB is co-located with the Cloudera Manager Server:
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql amon amon
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql rman rman
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql hue hue
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql metastore metastore
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql sentry sentry
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql nav nav
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql navms navms
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql oozie oozie

如果Mysql服务和Cloudera Manager服务位于不同主机选择以下命令:

# MySQL or MariaDB is installed on another host,Mysql host:node33.example.com ;Cloudera Manager host:node36.example.com
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com scm scm
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com amon amon
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com rman rman
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com hue hue
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com metastore metastore
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com sentry sentry
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com nav nav
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com navms navms
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h node33.example.com --scm-host node36.example.com oozie oozie

6.安装CDH和其它服务

设置完成Cloudera Manager 数据库, 启动Cloudera Manager Server,登录Cloudera Manager 管理员控制台,配置CDH和其它服务。

6.1启动Cloudera Manager Server

sudo systemctl start cloudera-scm-server

6.2 启动服务后等几分钟等Cloudera Manager服务启动完成,在Cloudera Manager Server安装主机运行下面命令观察启动的过程,

sudo tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log

当看到下面的日志条目时,说明Cloudera Manager Server 启动完成。

INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.

6.3 在浏览器输入http://:7180 登录Cloudera Manager Server 控制台, 是 Cloudera Manager Server 运行主机的完整域名或者ip地址。(注:如果使能了 auto-TLS,链接重定向到https://:7183 并且显示安全警告,需要确认信任证书)

6.4 登录Cloudera Manager Admin Console,  默认用户名,密码,

Username: admin

Password: admin

6.5 登录成功后,将显示安装向导,如下所示:

第一步:同意License并 选择Cloudera Manager 版本

a.Welcome

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第7张图片

b.Accept License

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第8张图片

c.Select Edition

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第9张图片

第二步:配置集群安装Cloudera Manager Agent 和CDH

a.选择完版本后启动集群配置向导,配置集群主机,安装Cloudera Manager Agent 和CDH

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第10张图片

b.Setup Auto-TLS

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第11张图片

c.Specify Hosts

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第12张图片

d.Select Repository

由于之前已经建立了本地仓库,所以这里Cloudera Manager Agent 、CDH和其它软件的安装库都选本地库。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第13张图片

CDH和 other Software 点击更多选项后,选择配置如下:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第14张图片

配置完存储库后显示如下:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第15张图片

e.Accept JDK License

如果之前集群里的每台主机已经安装JDK,这里就不用勾选复选框,不需要再安装JDK了。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第16张图片

f.Enter Login Credentials

如果集群所有主机的root密码相同,可以选择“所有主机接受相同密码”,否则选择“所有主机接受相同私钥”(需要按照下面步骤建立免密登录)。

  • 在Cloudera Manager Server 主机生成密钥对,运行下面命令后,回发现在/root/.ssh/目录下生成, id_rsa 和 id_rsa.pub两个文件。
ssh-keygen -t rsa
  • 将公钥拷贝到集群的每个主机下面的/root/.ssh/目录下,集群主机名为foo-1.example.com --- foo-4.example.com
for num in `seq 1 4`;do ssh-copy-id -i /root/.ssh/id_rsa.pub root@foo-$.example.com;done
  • 测试免密登录是否成果,输入下面的命令,不需要输入密码,则可以连接上foo-2.example.com 这台主机。
ssh foo-2.example.com

选择“所有主机接受相同私钥” 配好免密登录之后,选择上传上面生成的私钥( id_rsa )文件。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第17张图片

g.Install Agents

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第18张图片

(注:如果安装失败或者安装很慢,可以点击“中止安装”,选择使用下面的手动安装过程,参考官网教程)

需要在集群的每台主机上,按照前面教程配置好 etc/yum.repos.d/cloudera-repo.repo文件(建议配置本地仓库)

  • 安装Cloudera Manager Agent
 sudo yum install cloudera-manager-agent cloudera-manager-daemons
  • 配置/etc/cloudera-scm-agent/config.ini 文件的server_host 和server_port , 
Property Description
server_host Name of the host where Cloudera Manager Server is running.
server_port Port on the host where Cloudera Manager Server is running.

   这里设置为:

  # Hostname of the CM server.
  server_host=172.16.18.36
  # Port that the CM server is listening on.
  server_port=7182

  • 启动Cloudera Manager Agent
sudo systemctl start cloudera-scm-agent

h.Install Parcels

安装完Cloudera Manager Agent 后,重新用浏览器打开或刷新 http://:7180 页面,登陆后进入CDH 安装向导,同之前一样,依次配置主机和选择存储库,进入安装Parcels 界面,如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第19张图片

这里需要等待一段时间安装,安装完后如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第20张图片

i.Inspect Cluster

安装完CDH后进行检查主机正确性,检查完后可以看到结果和CDH包含组件的版本信息,如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第21张图片

7.设置集群

完成集群配置、在集群的每台主机完成 Cloudera Manager Agent 和CDH安装之后,进入选择安装服务向导。

7.1Select Services

这里 选择自定义安装服务,安装Zookeeper3.4.5+ Kafka2.0.0,如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第22张图片

7.2Assign Roles

根据实际情况选择每个服务安装的主机,这里在集群的每台主机安装ZooKeeper和Kafka Broker, 在其中一台主机安装Cloudera Management Service, 如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第23张图片

7.3Setup Database

选择需要安装的服务和服务安装的主机之后,新添加的服务需要配置数据库。如果之前没有建立服务所需的数据库,需要和前面教程一样,建立数据库并给数据库用户授权:

 CREATE DATABASE activity_monitor DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON activity_monitor.* TO 'activity_monitor'@'%' IDENTIFIED BY 'Root@2019';

  CREATE DATABASE report_manager DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
 GRANT ALL ON report_manager.* TO 'report_manager'@'%' IDENTIFIED BY 'Root@2019';

创建数据库后给添加的服务配置数据库,使服务可以连接到数据库,配置如下图,配置完后可以点击“测试连接”,验证服务可以正确连接数据库:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第24张图片

7.4Review Changes

审核后,点击继续。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第25张图片

7.5Command Details

配置好服务后开始安装服务,安装过程如下图:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第26张图片

安装完成后如下图所示:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第27张图片

7.6Summary

安装完成后界面显示如下:

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第28张图片

安装完成后,重新登录http://:7180,显示如下界面: 安装完成。

使用本地仓库安装 Cloudera Manager 6 + Cloudera Manager Agent 6 + CDH 6 (Parcels)_第29张图片

五、安装问题整理

问题一:

描述:

在线安装Cloudera Manager Server 速度慢,或者安装失败

解决方案:

建立本地Cloudera Manager和CDH 仓库:https://www.cloudera.com/documentation/enterprise/6/latest/topics/cm_ig_create_local_package_repo.html#internal_package_repo

问题二:

描述:

安装Cloudera Manager Agents 出现 无法复制安装文件,提示:/usr/local/Cavium_Networks/OCTEON-SDK ~ 

/tmp/scm_prepare_node.FB1R9dAK 
Received unknown response code 

解决方案:

配置本地库,并本地手动安装Cloudera Manager Agents:https://www.cloudera.com/documentation/enterprise/6/latest/topics/install_cloudera_packages.html#id_mbl_1rd_cgb

问题三:

描述:

安装完Mysql 运行 sudo grep 'temporary password' /var/log/mysqld.log  无法找到初始密码

解决方案:

Mysql没有成功安装,卸载Mysql,删除Mysql 文件后,重新安装Mysql

Yum remove mysql-community-server
 rm  -rf  /var/lib/mysql
 yum install mysql-server

六、参考:

1.CDH官网简介:https://www.cloudera.com/documentation/enterprise/6/6.1/topics/cdh_intro.html

2.Cloudera Manager官网简介:https://www.cloudera.com/documentation/enterprise/6/6.1/topics/cm_intro_primer.html

3.Cloudera Manager框架官网简介:https://www.cloudera.com/documentation/enterprise/latest/topics/cm_intro_primer.html#concept_kmf_mss_vk

4.配置本地Cloudera Manager和CDH 仓库:https://www.cloudera.com/documentation/enterprise/6/latest/topics/cm_ig_create_local_package_repo.html#internal_package_repo

5.配置本地CDH Parcel库:https://www.cloudera.com/documentation/enterprise/6/latest/topics/cm_ig_create_local_parcel_repo.html#internal_parcel_repo

6.手动安装Cloudera Manager Agents:

https://www.cloudera.com/documentation/enterprise/6/latest/topics/install_cloudera_packages.html#id_mbl_1rd_cgb

7.手动安装CDH Packages:https://www.cloudera.com/documentation/enterprise/6/latest/topics/install_cloudera_packages.html#manual_install_cdh_packages

8.Cloudera Manager 6.1.0 Release Notes:https://www.cloudera.com/documentation/enterprise/6/release-notes/topics/rg_cm_610_release_notes.html#cm600_release_notes

9.CDH 6.1.0 Release Notes:https://www.cloudera.com/documentation/enterprise/6/release-notes/topics/rg_cdh_610_release_notes.html#cdh610_release_notes

10.Parcels 介绍:https://www.cloudera.com/documentation/enterprise/6/latest/topics/cm_ig_parcels.html

11.Mysql数据库安装:https://blog.csdn.net/abcdu1/article/details/87367656

12.安装Mysql后 mysqld.log文件没有临时密码 :https://stackoverflow.com/questions/40561251/no-temporary-password-in-mysqld-log

你可能感兴趣的:(经验,ZooKeeper,Kafka)