CENTOS6.5 install CDH5.12.1 (1)

Reminder: To see the high-definition uncoded set of pictures, please use your mobile phone to open and click the picture to enlarge it.

1. Overview

This document mainly describes the process of deploying CDH5.12.1 Enterprise Edition with CentOS6.5 operating system in an offline environment. This installation document is mainly divided into 4 steps:

  1. Preliminary preparation (including hostname, turn off firewall, turn off SELinux, clock synchronization, etc.)

  2. Install Cloudera Manager Server

  3. Install CDH cluster

  4. Cluster integrity check (including whether services such as HDFS file system, MapReduce, Hive, etc. can run normally)

This document will focus on the installation of Cloudera Manager and CDH, and is based on the following assumptions:

  1. Operating system version: CentOS6.5

  2. MySQL version: 5.1.73

  3. CM version: CM 5.12.1

  4. CDH version: CDH 5.12.1

  5. Use root to deploy the cluster

  6. You have downloaded the installation packages of CDH and CM (CDH uses parcels package to install)

2. Preliminary preparation

2.1 hostname and hosts configuration

Each node in the cluster can communicate with each other using static IP addresses. The IP address and host name are configured through /etc/hosts, and the host name is configured in /etc/hostname (it is recommended that hostname be configured using FQDN full domain name).

Take the server (172.31.6.148) as an example:

Modify the /etc/sysconfig/network file:

[ root@ip-172-31-6-148~]# vim /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=ip-172-31-6-148.fayson.com

Note: You need to restart the server after modifying the hostname.

Check whether the hostname is successfully modified:

[ root@ip-172-31-6-148~]# hostname

[ root@ip-172-31-6-148 ~]#

The /etc/hosts file is as follows:

[ root@ip-172-31-6-148~]# more /etc/hosts

127.0.0.1 localhost.localdomain localhost

::1 localhost6.localdomain6 localhost6

172.31.6.148 ip-172-31-6-148.fayson.com

172.31.5.190 ip-172-31-5-190.fayson.com

172.31.10.118 ip-172-31-10-118.fayson.com

172.31.9.33 ip-172-31-9-33.fayson.com

[ root@ip-172-31-6-148 ~]#

For the above two steps, configure the other nodes in the cluster accordingly.

2.2 Disable SELinux

Execute the sudo setenforce 0 command on all nodes

[ root@ip-172-31-6-148~]# sudo setenforce 0

Modify the /etc/selinux/config file of all nodes in the cluster, the content is as follows:

[ root@ip-172-31-6-148~]# vim /etc/selinux/config

This file controls the state ofSELinux on the system.

SELINUX= can take one of these three values:

enforcing - SELinux security policyis enforced.

permissive - SELinux printswarnings instead of enforcing.

disabled - No SELinux policy isloaded.

SELINUX=disabled

SELINUXTYPE= can take one of these twovalues:

targeted - Targeted processes areprotected,

mls - Multi Level Securityprotection.

SELINUXTYPE=targeted

2.3 Turn off the firewall

Perform the following operations on all nodes in the cluster and permanently turn off the firewall

[ root@ip-172-31-6-148~]# service iptables stop

[ root@ip-172-31-6-148 ~]# chkconfig iptables off

[ root@ip-172-31-6-148 ~]#

2.4 Configure OS local yum source

[ root@ip-172-31-6-148~]# mkdir /mnt/iso

[ root@ip-172-31-6-148 ~]# mount -o loop CentOS-6.5-x86_64-minimal.iso/mnt/iso/

[ root@ip-172-31-6-148 ~]# df -h

[ root@ip-172-31-6-148 ~]#

[ root@ip-172-31-6-148~]# vim /etc/yum.repos.d/os.repo

name=CentOS6.5

baseurl=file:///mnt/iso

gpgcheck=false

enabled=true

Check if there is a new localrepo in the yum source list

[ root@ip-172-31-6-148~]# yum repolist

*** base: mirror.0x.sg

*** extras: mirror.0x.sg

*** updates: mirror.0x.sg

[ root@ip-172-31-6-148 ~]#

2.5 Install http service

To install the http service on one of the nodes in the cluster, execute the following command:

[ root@ip-172-31-6-148~]# yum -y install httpd

As shown in the figure above, the installation is successful.

[ root@ip-172-31-6-148~]# chkconfig --add httpd

[ root@ip-172-31-6-148 ~]# chkconfig httpd on

[ root@ip-172-31-6-148 ~]# chkconfig --list |grep httpd

[ root@ip-172-31-6-148 ~]#

[ root@ip-172-31-6-148~]# service httpd start

2.6 Redo operating system yum source

After installing the httpd service in 2.5, remake the yum source of the operating system, using http, the operation is as follows:

_ root@ip-172-31-6-148_html# mkdir centos6.5

[ root@ip-172-31-6-148 html]# ll

[ root@ip-172-31-6-148 html]#

_ root@ip-172-31-6-148_html# scp -r /mnt/iso/*/var/www/html/centos6.5/

[ root@ip-172-31-6-148~]# vim /etc/yum.repos.d/os.repo

name=CentOS6.5

baseurl=http://ip-172-31-6-148.fayson.com/centos6.5

gpgcheck=false

enabled=true

Synchronize the /etc/yum.repo.d/os.repo configuration file to the /etc/yum.repo.d/ directory of all nodes in the cluster

2.7 Cluster clock synchronization

Install the ntp service on all servers in the cluster for cluster clock synchronization. Here, the ip-172-31-6-148.fayson.com server is selected as the local NTP server, and other nodes in the cluster are synchronized with it. The configuration is as follows:

[ root@ip-172-31-6-148~]# yum -y install ntp

As shown in the figure above, the installation is successful.

Perform the following operations on all nodes:

[ root@ip-172-31-6-148~]# chkconfig --add ntpd

[ root@ip-172-31-6-148 ~]# chkconfig ntpd on

[ root@ip-172-31-6-148~]# vim /etc/ntp.conf

...

Use public servers from thepool.ntp.org project.

Please consider joining the pool (http://www.pool.ntp.org/join.html).

server 0.centos.pool.ntp.org iburst

server 1.centos.pool.ntp.org iburst

server 2.centos.pool.ntp.org iburst

server 3.centos.pool.ntp.org iburst

[ root@ip-172-31-5-190~]# vim /etc/ntp.conf

...

Use public servers from thepool.ntp.org project.

Please consider joining the pool (http://www.pool.ntp.org/join.html).

server 0.centos.pool.ntp.org iburst

server 1.centos.pool.ntp.org iburst

server 2.centos.pool.ntp.org iburst

server 3.centos.pool.ntp.org iburst

[ root@ip-172-31-6-148~]# service ntpd restart

[ root@ip-172-31-6-148 ~]#

[ root@ip-172-31-6-148~]# ntpq -p

==============================================================================

*LOCAL(0) .LOCL. 10 l 15 64 7 0.000 0.000 0.001

[ root@ip-172-31-6-148 ~]# ssh -i fayson.pem.txtip-172-31-5-190.fayson.com "ntpq-p"

==============================================================================

*ip-172-31-6-148 LOCAL(0) 11 u 68 128 377 0.274 1.005 0.243

[ root@ip-172-31-6-148 ~]# ssh -i fayson.pem.txtip-172-31-10-118.fayson.com "ntpq-p"

==============================================================================

*ip-172-31-6-148 LOCAL(0) 11 u 75 128 377 0.285 1.214 0.213

[ root@ip-172-31-6-148 ~]# ssh -i fayson.pem.txt ip-172-31-9-33.fayson.com"ntpq -p"

==============================================================================

*ip-172-31-6-148 LOCAL(0) 11 u 1 64 367 0.294 -9.249 1.511

[ root@ip-172-31-6-148 ~]#

Note: In the marked part, "*" shows that the synchronization is successful.

2.8 Install MySQL

[ root@ip-172-31-6-148~]# yum -y install mysql mysql-server

The screenshot above indicates that MySQL is successfully installed.

[ root@ip-172-31-6-148~]# chkconfig --add mysqld

[ root@ip-172-31-6-148 ~]# chkconfig mysqld on

[ root@ip-172-31-6-148~]# service mysqld start

...

[ OK ]

[ root@ip-172-31-6-148~]# mysql_secure_installation

password for the root user. If you've just installed MySQL, and

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 MySQL

root user without the proper authorisation.

Set root password? Y/n y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL 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 removethem 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, MySQL comes with a database named 'test' that anyone can

access. This is also intended only fortesting, and should be removed

before moving into a production environment.

Remove test database and access to it? Y/n y

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 MySQL

[ root@ip-172-31-6-148 ~]#

Note: The parts marked in red are input items. If "Thanks for using MySQL!" appears, the initialization is successful.

Library statement:

The command line operation is as follows:

[ root@ip-172-31-6-148~]# mysql -uroot -p

...

mysql*> CREATE USER* 'hive'@'%' IDENTIFIEDBY 'password';

mysql*> GRANT ALL* PRIVILEGES ON metastore. * TO 'hive'@'%';

mysql*> FLUSH PRIVILEGES*;

mysql*>*

mysql*> CREATE USER* 'cm'@'%' IDENTIFIEDBY 'password';

mysql*> GRANT ALL* PRIVILEGES ON cm. * TO 'cm'@'%';

mysql*> FLUSH PRIVILEGES*;

mysql_> create database_am default character set utf8;

mysql*> CREATE USER* 'am'@'%' IDENTIFIEDBY 'password';

mysql*> GRANT ALL* PRIVILEGES ON am. * TO 'am'@'%';

mysql*> FLUSH PRIVILEGES*;

mysql*>*

mysql*> CREATE USER* 'rm'@'%' IDENTIFIEDBY 'password';

mysql*> GRANT ALL* PRIVILEGES ON rm. * TO 'rm'@'%';

mysql*> FLUSH PRIVILEGES*;

mysql*>*

mysql*> CREATE USER* 'hue'@'%' IDENTIFIEDBY 'password';

mysql*> GRANT ALL* PRIVILEGES ON hue. * TO 'hue'@'%';

mysql*> FLUSH PRIVILEGES*;

mysql*>*

mysql*> CREATE USER* 'oozie'@'%' IDENTIFIEDBY 'password';

mysql*> GRANT ALL* PRIVILEGES ON oozie. * TO 'oozie'@'%';

mysql*> FLUSH PRIVILEGES*;

mysql*>*

[ root@ip-172-31-6-148~]# mkdir -p /usr/share/java

[ root@ip-172-31-6-148 ~]# mv mysql-connector-java-5.1.34.jar/usr/share/java/

[ root@ip-172-31-6-148 ~]# cd /usr/share/java/

[ root@ip-172-31-6-148 java]# ln -s mysql-connector-java-5.1.34.jar mysql-connector-java.jar

[ root@ip-172-31-6-148 java]# ll

- rwxr-xr-x. 1 root root 960372 Aug 30 15:16 mysql-connector-java-5.1.34.jar

[ root@ip-172-31-6-148 java]#

3. Cloudera Manager installation

3.1 Configure CM local repo source

CM5.12.1 download link:

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/cloudera-manager-agent-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm*

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/cloudera-manager-daemons-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm*

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/cloudera-manager-server-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm*

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/cloudera-manager-server-db-2-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm*

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/enterprise-debuginfo-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm*

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/jdk-6u31-linux-amd64.rpm*

* http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.12.1/RPMS/x86_64/oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm*

[ root@ip-172-31-6-148~]# mkdir -p /var/www/html/cm5.12.1

[ root@ip-172-31-6-148 ~]# cd /var/www/html/cm5.12.1/

[ root@ip-172-31-6-148 cm5.12.1]# ll

- rw-r--r-- 1 rootroot 9676820 Aug 30 14:45cloudera-manager-agent-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm

- rw-r--r-- 1 rootroot 709818804 Aug 30 14:45 cloudera-manager-daemons-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm

- rw-r--r-- 1 rootroot 8692 Aug 30 14:45cloudera-manager-server-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm

- rw-r--r-- 1 rootroot 10600 Aug 30 14:45cloudera-manager-server-db-2-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm

- rw-r--r-- 1 rootroot 31918952 Aug 30 14:45enterprise-debuginfo-5.12.1-1.cm5121.p0.6.el6.x86_64.rpm

- rw-r--r-- 1 rootroot 71204325 Aug 30 14:45jdk-6u31-linux-amd64.rpm

- rw-r--r-- 1 rootroot 142039186 Aug 30 14:45 oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm

[ root@ip-172-31-6-148 cm5.12.1]#

[ root@ip-172-31-6-148 cm5.12.1]# pwd

[ root@ip-172-31-6-148 cm5.12.1]#createrepo .

[ root@ip-172-31-6-148 cm5.12.1]#

[ root@ip-172-31-6-148~]# vim /etc/yum.repos.d/cm.repo

name=CM5.12.1

baseurl=http://ip-172-31-6-148.fayson.com/cm5.12.1

gpgcheck=false

enabled=true

[ root@ip-172-31-6-148~]# yum repolist

...

[ root@ip-172-31-6-148 ~]#yum -y install oracle-j2sdk1.7-1.7.0+update67-1

3.2 Configure http to access CDH Parcel package

CDH5.12.1 download address:

* http://archive.cloudera.com/cdh5/parcels/5.12.1/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel*

* http://archive.cloudera.com/cdh5/parcels/5.12.1/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha1*

* http://archive.cloudera.com/cdh5/parcels/5.12.1/manifest.json*

[ root@ip-172-31-6-148~]# mkdir -p /var/www/html/cdh5.12.1

[ root@ip-172-31-6-148 ~]# cd /var/www/html/cdh5.12.1/

[ root@ip-172-31-6-148 cdh5.12.1]# ll

- rw-r--r-- 1 rootroot 1620405492 Aug 30 19:09 CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel

- rw-r--r-- 1 rootroot 41 Aug 30 19:09 CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha1

- rw-r--r-- 1 rootroot 72312 Aug 30 19:11 manifest.json

[ root@ip-172-31-6-148 cdh5.12.1]#

3.3 Install Cloudera Manager Server

[ root@ip-172-31-6-148~]# yum -y installcloudera-manager-server

As shown in the figure above, the installation is successful.

[ root@ip-172-31-6-148~]#/usr/share/cmf/schema/scm_prepare_database.sh mysql cm cm password

JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera

[ main] DbCommandExecutor INFO Successfully connected to database.

All done, your SCM database is configured correctly!

[ root@ip-172-31-6-148 ~]#

[ root@ip-172-31-6-148~]# service cloudera-scm-server start

[ root@ip-172-31-6-148 ~]#

[ root@ip-172-31-6-148~]# netstat -lnpt | grep 7180

[ root@ip-172-31-6-148 ~]#

4. CDH installation

4.1 CDH cluster installation wizard

  1. admin/admin login to CM

  2. Agree to the license agreement, click continue

  1. Choose 60 trial, click continue

  1. Click "Continue"

  1. Enter the host ip or name, click search to find the host and click continue

  1. Click "Continue"

  1. Use parcel option, click "more options", click "-" to delete all other addresses, enter

http:// ip-172-31-6-148.fayson.com/cdh5.12.1/ Click "Save Changes"

  1. Select a custom repository and enter the http address of cm

  1. Click "Continue" to enter the next step to install jdk

  1. Click "Continue" to enter the next step, the default multi-user mode

  1. Click "Continue" to enter the next step to configure the ssh account password

  1. Click "Continue" to enter the next step, install Cloudera Manager related to each node

  1. Click "Continue" to enter the next step to install CDH to each node

  1. Click "Continue" to enter the next host check to ensure that all check items are passed

Click Finish to enter the service installation wizard.

4.2 Cluster Setup Installation Wizard

  1. Select the service to be installed

Custom service is used here, as shown below

  1. Click "Continue" to enter the cluster role assignment

HDFS role assignment:

Hive role assignment:

Cloudera Manager Service role assignment:

Spark role assignment: (Spark on Yarn so there is no spark master and worker roles)

Yarn role assignment:

Zookeeper role assignment: (at least 3 servers)

  1. After the role assignment is complete, click "Continue" to enter the next step to test the database connection

  1. The test is successful, click "Continue" to enter the directory settings, here use the default default directory, modify the directory according to the actual situation

  1. Click "Continue" and wait for the service to start successfully

  1. Click "Continue" to show that the cluster installation is successful

  1. After the installation is successful, enter the home management interface

A drunk whip famous horse, how ostentatious a young man! Lingnan Huanxisha, vomiting wine shop! My best friend refuses to release, the data is a flower!
Reminder: To see the high-definition uncoded set of pictures, please use your mobile phone to open and click the picture to enlarge it.

Welcome to pay attention to Hadoop practical operation, the first time, share more Hadoop dry goods, if you like, please follow and share.

Original article, welcome to reprint, please indicate: Reprinted from WeChat public account Hadoop practical operation

Recommended Posts

CENTOS6.5 install CDH5.12.1 (1)
CentOS6.5 install CDH5.13
1.5 Install Centos7
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7
CentOS install nodejs 8
CentOS6.5 install GNS3
centos 7.5 install mysql5.7.17
Centos7 install MySQL8.0-manual
CentOS7 install Kubernetes 1.16.3
VirtualBox install centos7
centos7 install lamp
Install centos7 and connect
Install Docker on Centos7
Centos7 install docker-18.x original
install LNMP on centos7.4