cloudera manager文件下载, 红框中的不需要下载。
下载allkeys.asc文件,如下:
cdh6文件下载,下载对应的系统文件:
CentOS7.5.1804 3.10.0-862.el7.x86_64
所有节点配置/etc/hostname、/etc/hosts文件
所有节点修改/etc/selinux/config文件如下:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
执行sestatus命令,查看是否修改成功。
所有节点执行如下命令:
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
修改如下:
* soft nofile 65535
* hard nofile 1029345
* soft nproc unlimited
* hard nproc unlimited
* soft memlock unlimited
* hard memlock unlimited
所有节点卸载 yum -y remove chrony
所有节点安装 yum install ntp -y
修改/etc/ntp.conf文件:
#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
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
启动服务:systemctl start ntpd;
添加到开机启动:systemctl enable ntpd。
验证始终同步,在所有节点执行ntpq -p命令,左边出现*号表示同步成功。
所有节点执行:
echo vm.swappiness = 10 >> /etc/sysctl.conf
以下语句所有节点执行:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
将如下语句添加到/etc/rc.d/rc.local文件中:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
执行命令:chmod +x /etc/rc.d/rc.local
使用如下命令配置集群之间的免密登录:
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
ssh-copy-id -p -i ~/.ssh/id_rsa.pub "@"
chmod 0600 ~/.ssh/authorized_keys
在cloudera manager server节点的/var/www/html目录下创建文件夹cm6和cdh6,把下载好的cloudera manager文件上传到cm6目录下,cdh6的文件上传到cdh6目录下。
执行如下命令:
yum install -y createrepo
cd /var/www/html/cm6
createrepo .
添加本地源:vim /etc/yum.repos.d/cloudera-repo.repo
[cloudera-repo]
name=cloudera-repo
baseurl=http:///cm6
enabled=1
gpgcheck=0
注:此处的hostname为cloudera manager server节点,复制cloudera-repo.repo文件到集群所有节点的/etc/yum.repos.d/目录下。
在所有节点的/usr/share/java/目录下放mysql-connector-java.jar (jar包名一定要修改成这个名字)。
执行如下命令:
chmod -R ugo+rX /var/www/html/cm6
chmod -R ugo+rX /var/www/html/cdh6
所有节点执行如下命令:
yum -y install httpd
systemctl start httpd
systemctl enable httpd
yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb postgresql* portmap mod_ssl openssl-devel python-psycopg2 MySQL-python
yum install python-pip
pip install psycopg2==2.7.5 --ignore-installed
复制/var/www/html/cm6/oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm到集群的所有节点。
所有节点安装jdk:
rpm -ivh /var/www/html/cm6/oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
配置jdk环境变量:
export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export PATH
在cloudera manager server节点安装,
先卸载系统自带的包:
查看系统是否已存在相应的安装包:rpm -qa | grep -i mariadb
卸载已存在的安装包:yum remove
安装mariadb:
yum install mariadb-server
systemctl stop mariadb
修改/etc/my.cnf文件,官方推荐修改如下:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
transaction-isolation = READ-COMMITTED
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
symbolic-links = 0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
key_buffer = 16M
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
#expire_logs_days = 10
#max_binlog_size = 100M
#log_bin should be on a disk with enough free space.
#Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your
#system and chown the specified folder to the mysql user.
log_bin=/var/lib/mysql/mysql_binary_log
#In later versions of MariaDB, if you enable the binary log and do not set
#a server_id, MariaDB will not start. The server_id must be unique within
#the replicating group.
server_id=1
binlog_format = mixed
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
# InnoDB settings
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
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
执行如下命令:
systemctl enable mariadb
systemctl start mariadb
初始化mysql密码:
/usr/bin/mysql_secure_installation
[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Set root password? [Y/n] Y
New password:
Re-enter new password:
[...]
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] N
[...]
Remove test database and access to it [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
[...]
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 -p),使用下面的命令,创建下面所有的库:
CREATE DATABASE DEFAULT CHARACTER SET DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON .* TO ''@'%' IDENTIFIED BY '';
FLUSH PRIVILEGES;
SHOW DATABASES;
SHOW GRANTS FOR ''@'%';
scm_prepare_database.sh脚本的语法如下:
/opt/cloudera/cm/schema/scm_prepare_database.sh [options]
如下:
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm
执行成功的log如下:
Enter SCM password:
JAVA_HOME=/usr/java/jdk1.8.0_141-cloudera
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing: /usr/java/jdk1.8.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.
[ main] DbCommandExecutor INFO Successfully connected to database.
All done, your SCM database is configured correctly!
yum install -y cloudera-manager-server
开启之后没有安装成功,本人推荐不开启,此步骤可跳过。
Cloudera Manager添加任何主机之前,必须启用Auto-TLS。要使用嵌入式Cloudera Manager CA启用auto-TLS,请运行以下命令:
sudo JAVA_HOME=/usr/java/jdk1.8.0_141-cloudera /opt/cloudera/cm-agent/bin/certmanager setup --configure-services
用你的JDK版本替换jdk1.8.0_141-cloudera。如果希望将文件存储在指定目录中(/var/lib/cloudera-sc -server/certmanager),请添加--location选项,如下所示:
sudo JAVA_HOME=/usr/java/jdk1.8.0_141-cloudera /opt/cloudera/cm-agent/bin/certmanager --location /opt/cloudera/CMCA setup --configure-services
systemctl start cloudera-scm-server
tail -300f /var/log/cloudera-scm-server/cloudera-scm-server.log
当你看到这条日志时,Cloudera Manager管理控制台已经启动了:
INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
浏览器访问:http://
搜索完成,点击右下角“继续”。
点击右下角“继续”
点击右下角“完成”。
此处不多介绍,根据需求去选择
在安装oozie服务的所有server中,
将ext-2.2.zip解压到:/opt/cloudera/parcels/CDH/lib/oozie/libext目录下;
执行如下命令:chown oozie:oozie -R ext-2.2;
在管理界面重启oozie服务。
1.从安装方式上来看,CDH6与CDH5变化不大,这也方便了CDH5的用户可以较为快速的迁移到CDH6,以及适应CDH6的安装与使用。
2.安装向导界面有一些变化,现在可以一目了然的看到一共多少步骤,以及每个步骤是干什么。
3.安装条件前置没有任何变化,包括防火墙,Selinux关闭,ntp同步等等。可以参考Fayson之前的文章《CDH安装前置准备》
4.进到主界面变化也不大,主要是Cloudera的logo变成了黑色,与Cloudera主页的整体风格一致。
5.在配置Cloudera Manager连接到数据库时的脚本有所变化。以前是/usr/share/cmf/schema/scm_prepare_database.sh,现在是/opt/cloudera/cm/schema/scm_prepare_database.sh
6.Cloudera Manager服务的状态在Redhat7通过systemctl status cloudera-scm-server查看是显示正确,而以前是不正确的,可以参考Fayson之前的文章《Cloudera Manager Server服务在RedHat7状态显示异常分析》
7.Cloudera Manager的rpm安装包由之前的7个变成了5个,去掉了之前的JDK6的包,然后自带JDK1.8.0_141,将不再支持JDK1.7。
8.注意CM的安装除了下载rpm包以外,还要下载allkeys.asc文件,否则安装agent的时候会报以下错误:
9.对于离线安装CDH6.0,分发Parcel出现hash校验失败的问题,是因为在CM6中修复了一个bug,让它不再忽略由http服务器发送的“Content-Encoding”的header信息,但是我们在Redhat中安装的httpd服务,当它传输parcel文件时,默认会错误的设置“Content-Encoding”。于是CM server会错误的认为parcel文件已经被httpd压缩并尝试解压缩。所以会导致失败。解决办法是参考2.8章节的,设置httpd的conf文件,AddType application/x-gzip .gz .tgz .parcel,然后重启httpd服务和CM服务。这个问题在beta的时候就已经存在了,具体请参考《Redhat7.4安装CDH6.0_beta1时分发Parcel异常分析》
10.在安装过程中会有页面提示Auto-TLS,该步骤可以忽略,不过如果对主机通信或者CM页面访问有SSL/TLS需求的话,也可以按照提示进行配置。