这次搭建我使用的机器 os 是 Centos7.4 RH 系的下面以流的方式纪录搭建过程以及注意事项

Step1:

配置域名相关,因为只有三台机器组集群,所以直接使用了 hosts 的方法:

  1. 修改主机名
  2. hostnamectl set-hostname ryze-.bigdata.com
  3.  
  4. 然后在 /etc/hosts 文件中配置相关机器的域名 域名简写
  5. x.x.x.x ryze-.bigdata.com ryze-
  6. x.x.x.x zed-.bigdata.com zed-
  7. x.x.x.x zed-.bigdata.com zed-
  8. 并且测试其能互通
  9.  
  10. 配置 /etc/sysconfig/network
  11. HOSTNAME=foo-.example.com
  12.  
  13. 验证配置
  14. uname -a 需要和 hostname 得到一致的域名

Step2:

关闭防火墙

  1. # 防火墙关闭
  2. iptables-save > /root/firewall.rules
  3. sudo chkconfig iptables off
  4. sudo service iptables stop

Step3:

启动 NTP 服务

  1. yum install ntp
  2.  
  3. 设置一个同步时间服务器
  4. /etc/ntp.conf
  5.  
  6. # 笔者使用的 aliyun 这里应该是可以跳过的,我检查了安装 ntp 之后,里面配置了非常多 aliyun 的相关节点。
  7. server .pool.ntp.org
  8. server .pool.ntp.org
  9. server .pool.ntp.org
  10.  
  11. # 开启 NTP 服务
  12. sudo systemctl start ntpd
  13.  
  14. # 配置 NTP 服务自启动
  15. sudo systemctl enable ntpd
  16.  
  17. # 向某个服务器同步时间
  18. ntpdate -u <ntp_server>
  19.  
  20. # 同步系统时间
    hwclock --systohc

所有机器完成上面配置之后,我们开始进入安装的步骤。

Step1:

首先 Cloudera 为用户已经准备好了专用的程序仓库,我们需要将其下载下来

  1. wget https://archive.cloudera.com/cm6/6.0.1/redhat7/yum/cloudera-manager.repo -P /etc/yum.repos.d/
  2.  
  3. # Import the repository signing GPG key
  4. sudo rpm --import https://archive.cloudera.com/cm6/6.0.0/redhat7/yum/RPM-GPG-KEY-cloudera

Step2: 安装 为 CDH 6.0.x 安装 jdk1.8

  1. # yum 安装
  2. sudo yum install oracle-j2sdk1.
  3.  
  4. # 自己下载包安装
  5. tar xvfz /path/to/jdk-8u<update_version>-linux-x64.tar.gz -C /usr/java/
  6. 注意不能更换路径
  7.  
  8. 这里如果使用 yum 安装 cloudera 的源的话会安装 1.8u141 并且会补充一个文件
  • The RHEL-compatible and Ubuntu operating systems supported by Cloudera Enterprise 6 all use AES-256 encryption by default for tickets. To support AES-256 bit encryption in JDK versions lower than 1.8u161, you must install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy File on all cluster and Hadoop user machines. Cloudera Manager can automatically install the policy files, or you can install them manually. For JCE Policy File installation instructions, see the README.txt file included in the jce_policy-x.zip file. JDK 1.8u161 and higher enable unlimited strength encryption by default, and do not require policy files.
  • On SLES platforms, do not install or try to use the IBM Java version bundled with the SLES distribution. CDH does not run correctly with that version.
  1. 需要注意一下,Java1.8u161 以上的版本似乎不受影响。

Step3:

安装 cloudera manager 到目标机 和 配置 TLS

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

  2. 警告如果没有证书,就不要配这个否则后面会出现 agent 无法上报的问题。
  3. 然后配置 auto TSL
  4. sudo JAVA_HOME=/usr/java/jdk1..0_141-cloudera /opt/cloudera/cm-agent/bin/certmanager setup --configure-services
  5.  
  6. That's it! When you start Cloudera Manager Server, it will have TLS enabled, and all hosts that you add to the cluster, as well as any supported services, will automatically have TLS configured and enabled.

Step4: 安装 CM 使用的数据库

  1. # 安装数据库大礼包
  2. wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
  3. sudo rpm -ivh mysql-community-release-el7-.noarch.rpm
  4. sudo yum update
  5. sudo yum install mysql-server
  6. sudo systemctl start mysqld
  7.  
  8. # 然后开始数据库配置
  9. sudo systemctl stop mysqld
  10.  
  11. # 拷贝日志文件
  12. Move old InnoDB log files /var/lib/mysql/ib_logfile0 and /var/lib/mysql/ib_logfile1 out of /var/lib/mysql/ to a backup location
  13.  
  14. # 配置数据库文件 /etc/my.conf
  15. [mysqld]
  16. datadir=/var/lib/mysql
  17. socket=/var/lib/mysql/mysql.sock
  18. transaction-isolation = READ-COMMITTED
  19. # Disabling symbolic-links is recommended to prevent assorted security risks;
  20. # to do so, uncomment this line:
  21. symbolic-links =
  22.  
  23. key_buffer_size = 32M
  24. max_allowed_packet = 32M
  25. thread_stack = 256K
  26. thread_cache_size =
  27. query_cache_limit = 8M
  28. query_cache_size = 64M
  29. query_cache_type =
  30.  
  31. max_connections =
  32. #expire_logs_days =
  33. #max_binlog_size = 100M
  34.  
  35. #log_bin should be on a disk with enough free space.
  36. #Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your
  37. #system and chown the specified folder to the mysql user.
  38. log_bin=/var/lib/mysql/mysql_binary_log
  39.  
  40. #In later versions of MySQL, if you enable the binary log and do not set
  41. #a server_id, MySQL will not start. The server_id must be unique within
  42. #the replicating group.
  43. server_id=
  44.  
  45. binlog_format = mixed
  46.  
  47. read_buffer_size = 2M
  48. read_rnd_buffer_size = 16M
  49. sort_buffer_size = 8M
  50. join_buffer_size = 8M
  51.  
  52. # InnoDB settings
  53. innodb_file_per_table =
  54. innodb_flush_log_at_trx_commit =
  55. innodb_log_buffer_size = 64M
  56. innodb_buffer_pool_size = 4G
  57. innodb_thread_concurrency =
  58. innodb_flush_method = O_DIRECT
  59. innodb_log_file_size = 512M
  60.  
  61. [mysqld_safe]
  62. log-error=/var/log/mysqld.log
  63. pid-file=/var/run/mysqld/mysqld.pid
  64.  
  65. sql_mode=STRICT_ALL_TABLES
  66.  
  67. # 添加到自启动项
  68. sudo systemctl enable mysqld
  69.  
  70. # 重新将 MySQL 启动起来
  71. sudo systemctl start mysqld

安装 JDBC 驱动

  1. # Download the MySQL JDBC driver from http://www.mysql.com/downloads/connector/j/5.1.html (in .tar.gz format). As of the time of writing, you can download version 5.1.46 using wget as follows:
  2. wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz
  3.  
  4. # Extract the JDBC driver JAR file from the downloaded file. For example:
  5. tar zxvf mysql-connector-java-5.1..tar.gz
  6.  
  7. # Copy the JDBC driver, renamed, to /usr/share/java/. If the target directory does not yet exist, create it. For example:
  8. sudo mkdir -p /usr/share/java/
  9. cd mysql-connector-java-5.1.
  10. sudo cp mysql-connector-java-5.1.-bin.jar /usr/share/java/mysql-connector-java.jar

使用 utf8 编码规则创建新的数据库服务于需要使用到数据库的服务:

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

这里我们会使用的服务:

Cloudera Manager Server

Reports Manager

Hue

Hive Metastore Server

Cloudera Navigator Audit Server

Cloudera Navigator Metadata Server

但是我打算全部都建起来,后面再来看

  1. CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  2. CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  3. CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  4. CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  5. CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  6. CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  7. CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  8. CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  9. CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  10.  
  11. GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'scm';
  12. GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'amon';
  13. GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'rman';
  14. GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'hue';
  15. GRANT ALL ON metastore.* TO 'metastore'@'%' IDENTIFIED BY 'metastore';
  16. GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'sentry';
  17. GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'nav';
  18. GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'navms';
  19. GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie';

Step5: setup database

由于我们的数据库搭建在远端 所以我们使用:

  1. Example : Running the script when MySQL or MariaDB is installed on another host
  2. This example demonstrates how to run the script on the Cloudera Manager Server host (cm01.example.com) and connect to a remote MySQL or MariaDB host (db01.example.com):
  3.  
  4. sudo /opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h db01.example.com --scm-host cm01.example.com scm scm
  5. Enter database password:
  6. JAVA_HOME=/usr/java/jdk1..0_141-cloudera
  7. Verifying that we can write to /etc/cloudera-scm-server
  8. Creating SCM configuration file in /etc/cloudera-scm-server
  9. Executing: /usr/java/jdk1..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.
  10. [ main] DbCommandExecutor INFO Successfully connected to database.
  11. All done, your SCM database is configured correctly!

Step6: 安装 CDH 和 其他的组件

  1. # start cloudera-scm-server
  2. sudo systemctl start cloudera-scm-server
  3.  
  4. # 通过该命令观察启动流程
  5. sudo tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
  6. 当看到
  7. INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
  8. the Cloudera Manager Admin Console is ready
  9.  
  10. 然后就可以通过 ip: 上去了

之后就是选择版本,选择完了之后进入到集群安装界面:

扫描 hosts 地址使用 FQDN 来标识,填写之后进行扫描。

  1. Range Definition Matching Hosts
  2. 10.1..[-] 10.1.1.1, 10.1.1.2, 10.1.1.3, 10.1.1.4
  3. host[-].example.com host1.example.com, host2.example.com, host3.example.com
  4. host[-].company.com host07.example.com, host08.example.com, host09.example.com, host10.example.com
  5. Note: Unqualified hostnames (short names) must be unique in a Cloudera Manager instance. For example, you cannot have both host01.example.com and host01.standby.example.com managed by the same Cloudera Manager Server.
  6. You can specify multiple addresses and address ranges by separating them with commas, semicolons, tabs, or blank spaces, or by placing them on separate lines. Use this technique to make more specific searches instead of searching overly wide ranges. Only scans that reach hosts running SSH will be selected for inclusion in your cluster by default. You can enter an address range that spans over unused addresses and then clear the nonexistent hosts later in the procedure, but wider ranges require more time to scan.

单机 serach 即可扫描,扫描到节点之后进行下一步。

Select Repository 使用默认选项直接选择下一步。

Accept JDK License 阅读协议☑️选择下一步。

ssh 设置,选择合适的选项下一步。

然后开始安装 agents 下载速度慢可以直接用 proxychain 或者 找快的地方在 https://archive.cloudera.com/cm6/6.0.1/redhat7/yum/RPMS/x86_64/ 下好之后上传。

然后开始安装 parcels 因为这个在国内安装下载速度也是超级慢所以推荐直接用网速快的地方去 https://archive.cloudera.com/cdh6/6.0.1/parcels/  下载对应的包。

然后上传到服务器放到 cm 机器的 /opt/cloudera/parcel-repo/ 目录下。要下包 sha1 文件和 manifest 文件。

按照提示解决 warning

  1. 已启用透明大页面压缩,可能会导致重大性能问题。请运行“echo never > /sys/kernel/mm/transparent_hugepage/defrag”和
    echo never > /sys/kernel/mm/transparent_hugepage/enabled”以禁用此设置,然后将同一命令添加到 /etc/rc.local 等初始化脚本中,以便在系统重启时予以设置。以下主机将受到影
  2.  
  3. Starting with CDH 6, PostgreSQL-backed Hue requires the Psycopg2 version to be at least 2.5.4, see the documentation for more information.
    This warning can be ignored if hosts will not run CDH 6, or will not run Hue with PostgreSQL. The following hosts have an incompatible Psycopg2 version of '2.5.1': 

Step7: Set Up a Cluster Using the Wizard

选择想要安装的服务

进行角色配置,master 集中在一台机器的话尽量让该机器的配置比较强。

比如我们的 ryze-1 的机器就比较强,所以承担了更多的 master 节点的角色。

设置要安装服务使用的数据库,之前我们 setup 了数据库信息,这里直接填写之前 setup 的信息

审计查看配置参数有没有需要修改的

命令详细信息执行相关操作,启动相关服务

summary 提示信息 -> 服务已安装、配置并在群集中运行 XD。

Reference:

https://www.cloudera.com/documentation/enterprise/6/6.0/topics/installation_reqts.html  Before You Install

https://www.cloudera.com/documentation/enterprise/6/6.0/topics/install_cm_cdh.html  Installing Cloudera Manager, CDH, and Managed Services

http://www.uuboku.com/444.html  mysql配置sql_mode中STRICT_TRANS_TABLES和STRICT_ALL_TABLES 区别

http://www.cnblogs.com/zhoujinyi/p/3179279.html  InnoDB O_DIRECT选项漫谈(一)【转】

https://www.cloudera.com/documentation/enterprise/6/6.0/topics/cm_ig_installing_configuring_dbs.html#cmig_topic_5_1  Required Databases

https://www.oschina.net/question/3964891_2287725  CDH6在安装agent时,提示安装失败 无法接收 Agent 发出的检测信号

https://archive.cloudera.com/cm6/6.0.1/redhat7/yum/RPMS/x86_64/  yum 包下载包地址

https://archive.cloudera.com/cdh6/6.0.1/parcels/  parcels 下载包地址

CDH 6.0.1 集群搭建 「Process」的更多相关文章

  1. CDH 6.0.1 集群搭建 「Before install」

    从这一篇文章开始会有三篇文章依次介绍集群搭建 「Before install」 「Process」 「After install」 继上一篇使用 docker 部署单机 CDH 的文章,当我们使用 d ...

  2. CDH 6.0.1 集群搭建 「After install」

    集群搭建完成之后其实还有很多配置工作要做,这里我列举一些我去做的一些. 首先是去把 zk 的角色重新分配一下,不知道是不是我在配置的时候遗漏了什么在启动之后就有报警说目前只能检查到一个节点.去将 zk ...

  3. Redis 5.0.5集群搭建

    Redis 5.0.5集群搭建 一.概述 Redis3.0版本之后支持Cluster. 1.1.redis cluster的现状 目前redis支持的cluster特性: 1):节点自动发现 2):s ...

  4. java_redis3.0.3集群搭建

    redis3.0版本之后支持Cluster,具体介绍redis集群我就不多说,了解请看redis中文简介. 首先,直接访问redis.io官网,下载redis.tar.gz,现在版本3.0.3,我下面 ...

  5. Redis 3.0.2集群搭建以及相关问题汇总

    Redis3 正式支持了 cluster,是为了解决构建redis集群时的诸多不便 (1)像操作单个redis一样操作key,不用操心key在哪个节点上(2)在线动态添加.删除redis节点,不用停止 ...

  6. Hadoop2.0 HA集群搭建步骤

    上一次搭建的Hadoop是一个伪分布式的,这次我们做一个用于个人的Hadoop集群(希望对大家搭建集群有所帮助): 集群节点分配: Park01 Zookeeper NameNode (active) ...

  7. redis4.0.6集群搭建

    文件环境:CentOS7 + redis4.0.6 先去官网下载redis:https://redis.io/,然后上传到你的虚拟机,我上传到了/mysoft 先解压->然后进入主目录-> ...

  8. redis3.0.3集群搭建

    redis3.0版本之后支持Cluster,具体介绍redis集群我就不多说,了解请看redis中文简介. 首先,直接访问redis.io官网,下载redis.tar.gz,现在版本3.0.3,我下面 ...

  9. ubuntu18.04 flink-1.9.0 Standalone集群搭建

    集群规划 Master JobManager Standby JobManager Task Manager Zookeeper flink01 √ √ flink02 √ √ flink03 √ √ ...

随机推荐

  1. python subprocess.Popen 控制台输出 实时监控百度网ping值

    import subprocess file_out = subprocess.Popen('ping www.baidu.com', shell=True, stdout=subprocess.PI ...

  2. jenkins使用3----相关工具安装

    一.相关工具安装 a.git安装 #yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc-c++ ...

  3. node.js api文档生成

    ApiDoc官网地址为:http://apidocjs.com/在Java中有Swagger及其升级版的Swagger2+Springfox自动生成接口管理文档.而在Node.js中则可以利用ApiD ...

  4. JAVA Exception

    博客背景音乐设置 晴天博客(酷)

  5. Vue2.x源码学习笔记-从一个小例子查看vm实例生命周期

    学习任何一门框架,都不可能一股脑儿的从入口代码从上到下,把代码看完, 这样其实是很枯燥的,我想也很少有人这么干,或者这么干着干着可能干不下去了. 因为肯定很无聊. 我们先从一个最最简单的小例子,来查看 ...

  6. DES对称加密算法详解和c++代码实现(带样例和详细的中间数据)

    特点: 1.DES是对称性加密算法,即加密和解密是对称的,用的是同一个密钥 2.DES只处理二进制数据,所以需要将明文转换成为2进制数据 3.DES每次处理64位的数据,所以应该将明文切割成64位的分 ...

  7. keepalived+lvs子网掩码造成VIP切换故障 + vrrp_script+track_script

    keepalived+lvs子网掩码造成VIP切换故障 架构:keepalived+lvs ,前端调度器是双主模型 现象:keepalived手动停掉一台,但是虚拟IP不会切换 整体网络是24位 VI ...

  8. [SHOI2006]color 有色图[群论、组合计数]

    题意 用 \(m\) 种颜色,给 \(n\) 个点的无向完全图的 \(\frac{n(n-1)}{2}\) 条边染色,两种方案相同当且仅当一种方案交换一些点的编号后可以变成另一种方案.问有多少本质不同 ...

  9. Charles 抓包工具安装和采坑记录

    Charles 抓包工具安装和采坑记录 网络抓包是解决网络问题的第一步,也是网络分析的基础.网络出现问题,第一步肯定是通过抓包工具进行路径分析,看哪一步出现异常.做网络爬虫,第一步就是通过抓包工具对目 ...

  10. .Net Core 在 Linux-Centos上的部署实战教程(二)

    上篇我们说了 如何在Linux上部署.net core  但是有心的同学会发现你关闭掉终端网站就不能访问了,这个原因是因为直接 dotnet GetConfigFile.dll --server.ur ...