Deploying CDH 6.3.2 on CentOS 7

Four servers running CentOS 7.9 (minimal installation) are requierd:

Hostname Specification IP Address Role
cdh-master 8 cores / 16 GB RAM / 300 GB SSD 192.168.110.101 Cloudera Manager, Agent
cdh-node01 8 cores / 16 GB RAM / 300 GB SSD 192.168.110.102 Agent
cdh-node02 8 cores / 16 GB RAM / 300 GB SSD 192.168.110.103 Agent
cdh-node03 8 cores / 16 GB RAM / 300 GB SSD 192.168.110.104 Agent

Server Initialization

SSH Key-Based Authenticatoin

Generate an SSH key pair and distribute the public key to all nodes:

ssh-keygen -q -N '' -f ~/.ssh/id_rsa
for host in 192.168.110.10{1..4}; do ssh-copy-id root@$host; done

Hostnames and DNS Resolution

Set consistent hostnames and update /etc/hosts on all nodes:

hostnamectl set-hostname cdh-master
# Repeat for other nodes: cdh-node01, cdh-node02, cdh-node03

cat >> /etc/hosts << EOF
192.168.110.101 cdh-master
192.168.110.102 cdh-node01
192.168.110.103 cdh-node02
192.168.110.104 cdh-node03
EOF

System Tuning

Disable transparent huge pages and adjust swap behavior:

# Add to /etc/rc.local
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

# Add to /etc/sysctl.conf
vm.swappiness = 10

# Apply changes
sysctl -p
chmod +x /etc/rc.local

Database Setup

Install MySQL 5.7

Use the USTC mirror for offline installation:

rpm -ivh http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm
yum install -y mysql-community-server

# Modify initialization to skip secure setup
sed -i 's/--initialize /--initialize-insecure /' /usr/bin/mysqld_pre_systemd

systemctl enable mysqld --now

MySQL Configuration

Edit /etc/my.cnf with optimized settings:

[mysqld]
bind-address = 0.0.0.0
server-id = 1
init-connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4
skip-name-resolve
max_connections = 3783
max_allowed_packet = 500M
tmp_table_size = 128M
max_heap_table_size = 8M
innodb_buffer_pool_size = 1024M
innodb_file_per_table = 1
innodb_log_file_size = 32M
innodb_flush_log_at_trx_commit = 2
lower_case_table_names = 1
default-storage-engine = InnoDB
log_bin = mysql-bin
binlog_format = ROW
expire_logs_days = 7
slow_query_log = 1
long_query_time = 1
performance_schema = 0
sql_mode = NO_AUTO_VALUE_ON_ZERO

[client]
default-character-set = utf8mb4

Restart MySQL and set root password:

systemctl restart mysqld
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Demo2@22-#'; FLUSH PRIVILEGES;"

Create Required Databases and Users

CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON metastore.* TO 'hive'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'Demo2@22-#';

GRANT ALL ON scm.* TO 'scm'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON amon.* TO 'amon'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON rman.* TO 'rman'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON hue.* TO 'hue'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON metastore.* TO 'hive'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON sentry.* TO 'sentry'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON nav.* TO 'nav'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON navms.* TO 'navms'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';
GRANT ALL ON oozie.* TO 'oozie'@'192.168.110.%' IDENTIFIED BY 'Demo2@22-#';

FLUSH PRIVILEGES;

CDH Repository Setup

Install and Configure HTTP Server

yum install -y httpd createrepo
rm -f /etc/httpd/conf.d/welcome.conf

# Edit /etc/httpd/conf/httpd.conf
ServerName localhost:80
AllowOverride All
DirectoryIndex index.html index.cgi index.php
AddType application/x-gzip .gz .tgz .parcel
ServerTokens Prod

systemctl enable httpd --now

Upload and Extract CDH Packages

mkdir -p /var/www/html/cdh6.3.2
tar xf cdh.tar.gz -C /var/www/html/cdh6.3.2/
chown -R apache:apache /var/www/html/cdh6.3.2/

Install Cloudera Manager

Configure YUM Repository

# Create /etc/yum.repos.d/cloudera-repo.repo
[cloudera-repo]
name=Cloudera Manager Repository
baseurl=http://192.168.110.101/cdh6.3.2/cloudera-repos/
enabled=1
gpgcheck=0

Install JDK and Cloudera Manager

# Install Oracle JDK on all nodes
rpm -ivh jdk-8u181-linux-x64.rpm

# Install Cloudera Manager server on the master node
yum install -y cloudera-manager-server

# Extract parcels and CSDs
tar xf parcel-repo.tar.gz -C /opt/cloudera/parcel-repo/
tar xf csd.tar.gz -C /opt/cloudera/csd/

Initialize Database and Start Services

# Extract Java to system path (on all nodes)
tar xf java.tar.gz -C /usr/share/

# Initialize CM database
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h 192.168.110.101 scm scm Demo2@22-#

systemctl enable cloudera-scm-server --now
tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log

Cluster Deployment via Web UI

Access the Cloudera Manager web interface:

http://192.168.110.101:7180
Username: admin
Password: admin

Follow the wizard to:

  • Discover hosts
  • Assign roles to nodes
  • Configure services (HDFS, YARN, Hive, HBase, Kafka, etc.)
  • Run cluster checks and deploy

Troubleshooting

Kafka Listener Configuration

Update Kafka broker configs on each node to use explicit advertised listeners:

# On cdh-node01
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://192.168.110.102:9092

# On cdh-node02
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://192.168.110.103:9092

# On cdh-node03
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://192.168.110.104:9092

Memory Warning Resolution

Adjust memory allocation thresholds in Cloudera Manager under Hosts > Monitoring. Ansure swap usage remains below 10% and disable unnecessary services.

Tags: CDH Cloudera Manager CentOS 7 MySQL HDFS

Posted on Mon, 19 Oct 2026 16:47:01 +0000 by Glen