deartim

导航

 

作者: silgogo

Cloudera Enterprise 5.15.x官网
 
1.JDK (所有节点)
/usr/java/
jdk-version
/etc/profile

2.MySQL (仅master节点)
安装mysql yum源
#下载wget http://repo.mysql.com/mysql80-community-release-el7-2.noarch.rpm到/etc/yum.repos.d/
1 rpm -Uvh mysql80-community-release-el7-2.noarch.rpm 
2 vim /etc/yum.repos.d/mysql-community.repo
 安装mysql,并修改密码:
yum install mysql-community-server -y
systemctl start mysqld
grep "password" /var/log/mysqld.log
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Aa@12345^';
create user 'webdb'@'%' IDENTIFIED BY 'Webdb123$';
GRANT ALL ON *.* TO 'webdb'@'%';
flush privileges;
---------------------------------------------
配置my.conf增加以下内容
transaction-isolation = READ-COMMITTED
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
log_bin = /var/lib/mysql/mysql_binary_log
server_id = 1
binlog_format = mixed
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
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
sql_mode = STRICT_ALL_TABLES
-----------------------------------
安装MySQL JDBC Driver
下载地址:https://mvnrepository.com/artifact/mysql/mysql-connector-java
版本参照:
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-versions.html (Connector/J Versions 5.1)
https://dev.mysql.com/doc/connector-j/6.0/en/connector-j-versions.html (Connector/J Versions 6.0)
1 mkdir -p /usr/share/java/
2 /usr/share/java/mysql-connector-java.jar

3.配置network &hosts(所有节点)
vim /etc/sysconfig/network
NETWORKING=yes
systemctl restart network
 
vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.215.43.1 cdh-1.digidite.com cdh-1
10.215.43.2 cdh-2.digidite.com cdh-2
10.215.43.3 cdh-3.digidite.com cdh-3
10.215.43.4 cdh-4.digidite.com cdh-4
10.215.43.5 cdh-5.digidite.com cdh-5
10.215.43.6 cdh-6.digidite.com cdh-6
10.215.43.7 cdh-7.digidite.com cdh-7
10.215.43.8 cdh-8.digidite.com cdh-8
10.215.43.9 cdh-9.digidite.com cdh-9

4.关闭防火墙和selinux(所有节点)
systemctl stop firewalld
chkconfig firewalld off
 
vim /etc/selinux/config
disabled
setenforce 0

5.配置ssh免密(所有节点)
yum install openssh-* -y
cd .ssh/
ssh-keygen -t rsa
cat id_rsa.pub >> authorized_keys   #master
ssh-copy-id -i cdh-1  #将其他主机的公钥拷贝到master
chmod 600 authorized_keys
scp cdh-1:/root/.ssh/authorized_keys /root/.ssh/   #拷贝至其他节点机

6.设置CDH仓库源(所有节点)
cloudera-manager.repo
cloudera-cdh5.repo
/etc/yum.repos.d

7.配置ntp服务(所有节点)
yum -y install ntp
chkconfig ntpd on
hwclock --systohc
vim /etc/ntp.conf
restrict 10.215.255.2  nomodify notrap noquery
server 10.215.255.2
ntpdate 10.215.255.2
systemctl start ntpd 

8.Cloudera Manager 安装前的系统设置(所有节点)
sysctl -w vm.swappiness=10
echo "vm.swappiness=10" >> /etc/sysctl.conf
echo never > /sys/kernel/mm/transparent_hugepage/enabled   
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo "echo never>/sys/kernel/mm/transparent_hugepage/defrag">> /etc/rc.local   
echo "echo never>/sys/kernel/mm/transparent_hugepage/enabled">> /etc/rc.local

9.python环境配置(所有节点)
yum install epel-release -y
yum install python-pip -y
pip install --upgrade pip

10.安装Cloudera Manager Server(agent)并初始化数据库(仅master节点)
yum install cloudera-manager-daemons cloudera-manager-server -y
yum install cloudera-manager-daemons cloudera-manager-agent -y
 
/usr/share/cmf/schema/scm_prepare_database.sh  -u root -pAa@12345^  mysql scm scm
#Enter SCM password:
Scm12345^
#出现All done, your SCM database is configured correctly!表示配置scm数据库完成

11.启动master节点 SCM-server和agent
service cloudera-scm-server start
tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
出现这条日志时,表示Cloudera Manager管理控制台已准备就绪
WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
---------
service cloudera-scm-agent start
tail -f /var/log/cloudera-scm-agent/cloudera-scm-agent.log
若日志中报错“[Errno 111] Connection refused”执行以下操作:
mv /usr/bin/host /usr/bin/host.bak

12.在Node节点安装Cloudera Manager Agent
yum install cloudera-manager-daemons cloudera-manager-agent -y
mv /usr/bin/host /usr/bin/host.bak
配置Cloudera Manager Agent的Server地址为主节点的主机名cdh-1
vim /etc/cloudera-scm-agent/config.ini
service cloudera-scm-agent start
tail -f /var/log/cloudera-scm-agent/cloudera-scm-agent.log

13.配置CDH集群
10.215.43.1:7180
admin/admin
#创建数据库-设置连接-
create database huedb;
GRANT ALL ON *.* TO 'root'@'%' identified by 'Aa@12345^';
flush privileges;
 

问题记录:
1.各主机显示:“ 不良 : 当从 Java 进程查看时该主机的主机名称和规范名称不一致。”
修改hosts和network
解决:修改hosts 使FQDN和 hostname相同
hosts修改前:
127.0.0.1 localhost.localdomain localhost
10.215.43.1 cdh-1.digidite.com cdh-1
10.215.43.2 cdh-2.digidite.com cdh-2
10.215.43.3 cdh-3.digidite.com cdh-3
10.215.43.4 cdh-4.digidite.com cdh-4
10.215.43.5 cdh-5.digidite.com cdh-5
10.215.43.6 cdh-6.digidite.com cdh-6
10.215.43.7 cdh-7.digidite.com cdh-7
10.215.43.8 cdh-8.digidite.com cdh-8
10.215.43.9 cdh-9.digidite.com cdh-9
hosts修改后:
127.0.0.1 localhost.localdomain localhost
10.215.43.1 cdh-1 cdh-1
10.215.43.2 cdh-2 cdh-2
10.215.43.3 cdh-3 cdh-3
10.215.43.4 cdh-4 cdh-4
10.215.43.5 cdh-5 cdh-5
10.215.43.6 cdh-6 cdh-6
10.215.43.7 cdh-7 cdh-7
10.215.43.8 cdh-8 cdh-8
10.215.43.9 cdh-9 cdh-9
network修改前:
network修改后:
cdh-1

hue配置文件修复数据字符编码问题:
vim  /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/hue/apps/filebrowser/src/filebrowser/views.py
import sys
reload(sys)
sys.setdefaultencoding('utf8')
posted on 2019-04-09 15:12  deartim  阅读(766)  评论(0编辑  收藏  举报