前置条件

  1. ntp服务安装
  2. 防火墙关闭

执行以下优化代码

systemctl stop firewalld.service
echo  "* soft    nofile  128000" >>/etc/security/limits.conf
echo  "* hard    nofile  128000" >>/etc/security/limits.conf
echo  "* soft    nproc  128000" >>/etc/security/limits.conf
echo  "* hard    nproc  128000" >>/etc/security/limits.conf
cat /etc/security/limits.conf
sed -i 's/4096/unlimited/' /etc/security/limits.d/20-nproc.conf
cat /etc/security/limits.d/20-nproc.conf
sed -i 's/4096/unlimited/' /etc/security/limits.d/90-nproc.conf
cat /etc/security/limits.d/90-nproc.conf
ulimit -SHn 128000
ulimit -SHu 128000echo  "vm.swappiness=10" >>/etc/sysctl.conf
sysctl -p
sysctl -a|grep swappiness
echo  "net.core.somaxconn = 32768 " >>/etc/sysctl.conf
sysctl -p
sysctl -a|grep somaxconn
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled

CDH6.2 下载信息

https://www.cloudera.com/documentation/enterprise/6/release-notes/topics/rg_cdh_62_download.html
yum安装:https://archive.cloudera.com/cdh6/6.2.0/redhat7/yum/
parcel安装:https://archive.cloudera.com/cdh6/6.2.0/parcels/

这里我们讲解使用 parcel 方式安装

ClouderaManager 安装包下载

https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPMS/x86_64/cloudera-manager-agent-6.2.0-968826.el7.x86_64.rpm
https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPMS/x86_64/cloudera-manager-daemons-6.2.0-968826.el7.x86_64.rpm
https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPMS/x86_64/cloudera-manager-server-6.2.0-968826.el7.x86_64.rpm
https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPMS/x86_64/cloudera-manager-server-db-2-6.2.0-968826.el7.x86_64.rpm
https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPMS/x86_64/enterprise-debuginfo-6.2.0-968826.el7.x86_64.rpm
https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPMS/x86_64/oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
https://archive.cloudera.com/cm6/6.2.0/allkeys.asc

CDH 安装包下载

https://archive.cloudera.com/cdh6/6.2.0/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel
https://archive.cloudera.com/cdh6/6.2.0/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha1
https://archive.cloudera.com/cdh6/6.2.0/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha256
https://archive.cloudera.com/cdh6/6.2.0/parcels/manifest.json

安装 createrepo

作用:createrepo 命令用于创建yum源(软件仓库),即为存放于本地特定位置的众多rpm包建立索引,描述各包所需依赖信息,并形成元数据。

yum install -y createrepo

在CM目录下执行 createrepo . 生成rpm源

[root@cdh01 CM]# createrepo .
Spawning worker 0 with 1 pkgs
Spawning worker 1 with 1 pkgs
Spawning worker 2 with 1 pkgs
Spawning worker 3 with 1 pkgs
Spawning worker 4 with 1 pkgs
Spawning worker 5 with 1 pkgs
Spawning worker 6 with 0 pkgs
Spawning worker 7 with 0 pkgs
Spawning worker 8 with 0 pkgs
Spawning worker 9 with 0 pkgs
Spawning worker 10 with 0 pkgs
Spawning worker 11 with 0 pkgs
Spawning worker 12 with 0 pkgs
Spawning worker 13 with 0 pkgs
Spawning worker 14 with 0 pkgs
Spawning worker 15 with 0 pkgs
Spawning worker 16 with 0 pkgs
Spawning worker 17 with 0 pkgs
Spawning worker 18 with 0 pkgs
Spawning worker 19 with 0 pkgs
Spawning worker 20 with 0 pkgs
Spawning worker 21 with 0 pkgs
Spawning worker 22 with 0 pkgs
Spawning worker 23 with 0 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

安装 httpd 服务

yum install -y httpd

启动服务

 systemctl start httpdsystemctl status httpd

将CM 与 CDH 目录移动到目录 /var/www/html/ 下

mv CM/ CDH/ /var/www/html/

验证是否安装成功,访问 http://ip/CM ,http://ip/CDH

显示如下即可

提示以下内容说明没有成功,原因是 SELinux 未禁用成功,在所有服务器执行 setenforce 0  即可

配置安装源

vim /etc/yum.repos.d/cm.repo
[cmrepo]
name = cm_repo
baseurl = http://ip/CM
enable = true
gpgcheck = false

安装JDK

yum install oracle-j2sdk1.8-1.8.0+update181-1.x86_64

安装 Cloudera Manager Server

yum install -y cloudera-manager-server

到这里CM服务端安装完成,先不要启动,安装数据库

安装MariaDB

MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。在存储引擎方面,使用XtraDB(英语:XtraDB)来代替MySQL的InnoDB。 MariaDB由MySQL的创始人Michael Widenius(英语:Michael Widenius)主导开发,他早前曾以10亿美元的价格,将自己创建的公司MySQL AB卖给了SUN,此后,随着SUN被甲骨文收购,MySQL的所有权也落入Oracle的手中。MariaDB名称来自Michael Widenius的女儿Maria的名字。

MariaDB基于事务的Maria存储引擎,替换了MySQL的MyISAM存储引擎,它使用了Percona的 XtraDB,InnoDB的变体,分支的开发者希望提供访问即将到来的MySQL 5.4 InnoDB性能。这个版本还包括了 PrimeBase XT (PBXT) 和 FederatedX存储引擎。

yum -y install mariadb
yum -y install mariadb-server

启动、配置MariaDB

systemctl start mariadb
[root@cdh01 ~]# /usr/bin/mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.Enter current password for root (enter for none):
OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.Set root password? [Y/n] y #设置root密码
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..... Success!By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.Remove anonymous users? [Y/n] y #是否禁止匿名登录... Success!Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] n #是否禁止远程登录... skipping.By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.Remove test database and access to it? [Y/n] y #删除测试数据库- Dropping test database...... Success!- Removing privileges on test database...... Success!Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.Reload privilege tables now? [Y/n] y #加载最新设置... Success!Cleaning up...All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.Thanks for using MariaDB!

登录mysql 创建数据库

mysql -uroot -p123456 create database metastore default character set utf8;  #创建数据库名称为metastore,默认编码utf-8
CREATE USER 'hive'@'%' IDENTIFIED BY '123456';    #创建用户名为hive的用户,密码为123456,可以在任何机器上访问
GRANT ALL PRIVILEGES ON metastore. * TO 'hive'@'%';   #授权hive用户metastore所有权限
FLUSH PRIVILEGES;   #刷新配置create database cm default character set utf8;
CREATE USER 'cm'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON cm. * TO 'cm'@'%';
FLUSH PRIVILEGES;  create database hue default character set utf8;
CREATE USER 'hue'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON hue. * TO 'hue'@'%';
FLUSH PRIVILEGES;create database oozie default character set utf8;
CREATE USER 'oozie'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON oozie. * TO 'oozie'@'%';
FLUSH PRIVILEGES;create database sentry default character set utf8;
CREATE USER 'sentry'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON sentry. * TO 'sentry'@'%';
FLUSH PRIVILEGES;

安装Mysql驱动

此处不安装,服务无法找到mysql驱动,会导致服务失败,集群所有服务都安装,避免以后遇到问题

[root@cdh01 cdh]# mkdir  /usr/share/java
[root@cdh01 cdh]# mv mysql-connector-java-5.1.30.jar /usr/share/java/
[root@cdh01 cdh]# chmod 777 /usr/share/java/mysql-connector-java-5.1.30.jar
[root@cdh01 cdh]# ln -s /usr/share/java/mysql-connector-java-5.1.30.jar /usr/share/java/mysql-connector-java.jar
[root@cdh01 cdh]# ll /usr/share/java/
总用量 932
-rwxrwxrwx. 1 root root 954038 6月  19 11:28 mysql-connector-java-5.1.30.jar
lrwxrwxrwx. 1 root root     47 9月   1 13:59 mysql-connector-java.jar -> /usr/share/java/mysql-connector-java-5.1.30.jar

Cloudera Manager Server 初始化数据库

注意这里 123456 是我们上一步创建的数据库密码

[root@cdh01 ~]# /opt/cloudera/cm/schema/scm_prepare_database.sh mysql cm cm 123456
JAVA_HOME=/usr/local/java/jdk1.8.0_191
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing:  /usr/local/java/jdk1.8.0_191/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!

启动Cloudera Manager Server 服务

systemctl start cloudera-scm-server
systemctl status cloudera-scm-server

启动可能需要半分钟左右,可以查看日志启动状态,提示如下内容就启动成功了

日志目录:/var/log/cloudera-scm-server

2019-09-01 14:05:02,994 INFO WebServerImpl:org.eclipse.jetty.server.AbstractConnector: Started ServerConnector@534fca49{HTTP/1.1,[http/1.1]}{0.0.0.0:7180}
2019-09-01 14:05:02,995 INFO WebServerImpl:org.eclipse.jetty.server.Server: Started @95217ms
2019-09-01 14:05:02,995 INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.

浏览器访问,提示登录,默认账号密码均为 admin

http://ip:7180/cmf/login

接受继续

这里选择免费版本(也可以选择试用版,到期后自动恢复成免费版本)

开始安装集群

选择我们刚刚安装的httpd服务链接

agent 安装成功,下一步

安装 parcel ,这个过程可能要等一段时间

这里我们看下检查结果

有两处异常,根据提示修改配置:

sysctl vm.swappiness=10 修改CDH建议值,重新检测。

解决了第一个问题

设置一下两个配置

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

再次查看,全部正常

 

根据需求自己分配角色

安装成功

Centos7.x 安装 CDH 6.x相关推荐

  1. CentOS7下安装CDH,clouderamanager,hadoop

    一.实验背景 我们是四台电脑一起搭建Hadoop集群 A,B,C,D四个人个有一台电脑,分别在各自的电脑上安装虚拟机,虚拟机装centOS7.(我们建议主机namenode内存大一点8g,硬盘最好10 ...

  2. CentOS7安装CDH 第三章:CDH中的问题和解决方法

    CentOS7安装CDH 第三章:CDH中的问题和解决方法 参考文章: (1)CentOS7安装CDH 第三章:CDH中的问题和解决方法 (2)https://www.cnblogs.com/yang ...

  3. CentOS7安装CDH(五):CDH的安装和部署-CDH5.7.0

    目录 0. 相关文章链接 1. CDH的下载 1.1. cm的tar包下载 1.2. parcels包下载 2. 安装CDH的准备工作(所有节点都要执行) 2.1. 安装好JDK 2.2. 更改主机名 ...

  4. 【Centos7.6安装CDH6.1.0】第二节 JDK、Mysql配置

    [Centos7.6安装CDH6.1.0]手把手教你搭建CDH6.1.0 JDK(已安装者跳过) mysql配置 安装jdbc 建库.建用户.设置用户访问权限 跳转 JDK(已安装者跳过) 下载lin ...

  5. CentOS7下安装使用HBase

    目录 背景 数据结构 安装 启动hadoop.kafka.ZooKeeper 解压hbase压缩包 配置HBase 启动hbase 关闭hbase 进入hbase命令行 命令 创建表,指定列族 插入数 ...

  6. Centos7.4安装Nginx

    Centos7.4安装Nginx 使用yum命令 一.安装准备 首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.open ...

  7. Centos7下安装Docker

    Centos7下安装Docker(详细的新手装逼教程) 参考: https://www.cnblogs.com/qgc1995/archive/2018/08/29/9553572.html 早就听说 ...

  8. Centos7.4安装kvm虚拟机(使用virt-manager管理)

    2019独角兽企业重金招聘Python工程师标准>>> Centos7.4安装kvm虚拟机(使用virt-manager管理) 之前介绍了使用WebVirtMgr或Openstack ...

  9. Centos7上安装oracle11g/12c的安装教程推荐及注意事项

    Centos7上安装oracle11g的安装教程推荐及注意事项 历时一天半,终于在今天中午安装完oracle11g,成功后喜悦的心情自是溢于言表.总有些疑问,比如为何如此复杂的数据库为何还会有如此之多 ...

最新文章

  1. 小程序web开发框架-weweb介绍
  2. 眼见为实?其实是“脑补”!华人数学家解开视觉奥秘:一切都是大脑假装让人看见...
  3. 一步一步搞定InfoPath(02)--配置VSTA
  4. java线程栅栏_Java 多线程基础 - CyclicBarrier
  5. 函授计算机与科学论文,函授计算机科学与技术论文
  6. 在Ubuntu 18.04中安装JDK 8
  7. UNICODE字符集
  8. Java - 用数组求出斐波那契数列的前20项值
  9. ASP.NET 页面对象模型
  10. 存款100万能退休了吗?
  11. 大众mpv_最便宜的大众MPV来啦!1.4T6AT,空间比宝骏730还宽裕
  12. paramiko获取远程主机的环境变量
  13. Itext对pdf模板进行电子签名
  14. MacBooster CleanMyMac CCleaner三款Mac清理工具该如何选择
  15. 微信令人头疼的文件自动下载功能终于不用默认了
  16. doris报错:too many filtered rows
  17. easyUI打开tab页面
  18. 微信小程序生命周期和路由传参详解
  19. plantuml绘制UML图
  20. Apple Catching经典dp

热门文章

  1. python求一元三次方程的根_初中数学专题复习-方程与方程组
  2. 怎么实现注解_通透!一口气搞懂注解到底怎么用
  3. c语言putchar_C语言实现变色的心!连机器都会变心,呵,男人!
  4. 计算机英语A卷答案,计算机专业英语试题及答案A卷.doc
  5. Java基础之this关键字和super关键字区别
  6. plc控制可调节阀流程图_PLC五大主流编程语言你会几种?
  7. js立即执行函数_《JS 函数的执行时机》
  8. pythonsort函数时间复杂度_合并排序算法——时间复杂度详解和python代码实现
  9. 【LeetCode笔记】347. 前K个高频元素(Java、优先队列、小顶堆、HashMap)
  10. 【学习笔记】网络层——无分类编址CIDR、ARP协议、DHCP协议和ICMP协议