https://www.linuxidc.com/Linux/2018-03/151491.htmCentOS 7下Cloudera Manager及CDH 5.14.0安装过程详解
1.系统环境搭建
1.1 下载CentOS
http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso、
1.2 虚拟机共享主机网络
https://www.cnblogs.com/heruiguo/p/8919659.html
vim /etc/sysconfig/network-scripts/ifcfg-ens33
1.3设置主机名,修改主机名配置hosts
hostname 查看主机名
每台服务器分别把主机名与ip对应关系写进/etc/hosts上。
vim /etc/hosts
192.168.226.131 node1
192.168.226.132 node2
192.168.226.133 node3
在主节点上配置Cloudera Manager仓库,便于从节点的agetn的安装(添加存储库的时候会用到)。
yum -y install httpd createrepo
systemctl start httpd && systemctl enable httpd
cd /var/www/html/cloudera-repos/ && createrepo . #生成RPM元数据:
ll /var/www/html/cloudera-repos/
cloudera-manager-agent-6.1.0-769885.el7.x86_64.rpm
cloudera-manager-daemons-6.1.0-769885.el7.x86_64.rpm
cloudera-manager-server-6.1.0-769885.el7.x86_64.rpm
cloudera-manager-server-db-2-6.1.0-769885.el7.x86_64.rpm
oracle-j2sdk1.8-1.8.0+update141-1.x86_64.rpm
repodata
1.4关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
https://blog.csdn.net/yanjun821126/article/details/80828908SELINUX介绍
每个机子中使用
service firewalld status
查看防火墙状态
1.5禁用SELINUX
[root@localhost ~]# vim /etc/selinux/config .config/
将selinux=enforcing改成selinux=disabled
每个机子中使用
getenforce
命令查看SElinux是否关闭
1.6SSH免密登录
ssh-keygen -t rsa (一路回车)
在其他节点也同样执行此操作,生成密钥之后
切换到.ssh/目录下
cd .ssh/
然后把密钥文件重命名,并且复制到cdh01(主节点)的.ssh/目录下,其他节点类似
mv id_rsa.pub 2id_rsa.pub
scp 2id_rsa.pub root@node1:/root/.ssh/
mv id_rsa.pub 3id_rsa.pub
scp 3id_rsa.pub root@node1:/root/.ssh/
在主节点上的.ssh/目录下查看,并且把3个节点上的密钥文件写到authorized_keys,再复制到其他2个节点上
查看authorized_keys,并给authorized_keys文件授权
[root@node1 .ssh]# cat id_rsa.pub >> authorized_keys
[root@node1 .ssh]# cat 2id_rsa.pub >> authorized_keys
[root@node1 .ssh]# cat 3id_rsa.pub >> authorized_keys
cat authorized_keys
chmod 600 authorized_keys
复制到另外2个节点上
scp authorized_keys root@node2:/root/.ssh/
scp authorized_keys root@node3:/root/.ssh/
在另外2个节点上同样需要授权
chmod 600 authorized_keys
测试连接(此时切换到其他节点就不需要再输入密码了)
ssh cdh02
ssh cdh03
原文链接:https://blog.csdn.net/qq_24817093/article/details/84138976
1.6NTP服务器设置(用于不同节点间实现时间同步)
yum -y install ntp
vim /etc/ntp.conf
注释掉所有server *.*.*的指向,新添加一条可连接的ntp服务器(百度一下ntp服务器,我选的是上海交大的)
server ntp.sjtu.edu.cn iburst
在其他节点上把ntp指向master服务器地址即可(/etc/ntp.conf下)
server 192.168.160.130 iburst
date;ssh node2 date;ssh node3 date
1.7.安装MySQL
https://www.cnblogs.com/hongchengcheng/p/8623219.htmlCentOS第一次安装MySQL的完整步骤
1.8安装驱动
下载mysql-connector-java.jar,并保存到所有主机的/usr/share/Java目录下
mv mysql-connector-java-5.1.48-bin.jar mysql-connector-java.jar
2.安装CDH
1、主节点安装repo,并导入GPG key:
#wget https://archive.cloudera.com/cm6/6.1.0/redhat7/yum/cloudera-manager.repo -P /etc/yum.repos.d/
#rpm --import https://archive.cloudera.com/cm6/6.0.0/redhat7/yum/RPM-GPG-KEY-cloudera
2、主节点上按照如下顺序进行JDK、CM、server、agent安装以及agent的安装。
# yum -y install oracle-j2sdk1.8-1.8.0+update141-1.x86_64.rpm
# yum -y install cloudera-manager-daemons-6.1.0-769885.el7.x86_64.rpm
# yum -y install cloudera-manager-server-6.1.0-769885.el7.x86_64.rpm
# yum -y install cloudera-manager-agent-6.1.0-769885.el7.x86_64.rpm
作者:Firetheworld
链接:https://www.jianshu.com/p/f804bd587d95
来源:
著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
https://blog.csdn.net/Hampton_Chen/article/details/81370170虚拟机磁盘扩容
在主节点初始化CM5的数据库
使用命令
在命令里scm_prepare_database.sh后面的参数分别是:数据库类型 数据库名称(可以随便起一个名称) 数据库主机名 数据库用户名 密码 --scm-host 主节点机名 scm scm scm
/opt/cm-5.16.2/share/cmf/schema/scm_prepare_database.sh mysql cm -h node1 -u root -p admin123 --scm-host node1 scm scm scm
tar -xvf /opt/cloudera-manager-centos7-cm5.16.2_x86_64.tar.gz
Agent配置
主节点修改agent配置文件,/opt/cm-5.8.2/etc/cloudera-scm-agent/config.ini中的server_host为主节点的主机名。
使用命令 vim /opt/cm-5.16.2/etc/cloudera-scm-agent/config.ini
/opt/cm-5.16.2/share/cmf/schema/scm_prepare_database.sh mysql cm -h node1 -u root -p admin123 --scm-host node1 scm scm scm
https://www.cnblogs.com/felixzh/p/9082344.html
在主节点node1用命令同步Agent到其他所有节点
scp -r /opt/cm-5.16.2/ root@node2:/opt/
scp -r /opt/cm-5.16.2/ root@node3:/opt/
在所有节点创建cloudera-scm用户
在每台机子中
使用命令
useradd --system --home=/opt/cm-5.16.2/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
cat /etc/passwd 查看用户列表
# mkdir /opt/cm-5.7.0/run/cloudera-scm-agent
/opt/cm-5.16.2/etc/init.d/cloudera-scm-server start
数据库
systemctl stop mysqld.service
systemctl start mysqld.service
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> flush privileges
grant all on *.* to 'hanson'@'%' identified by 'admin123' with grant option;
create database hive;
create database ooz;
https://blog.csdn.net/qq_33286695/article/details/84777776Error loading MySQLdb module: libmysqlclient_r.so.18: cannot open shared object file: No such file
https://www.cnblogs.com/tmeily/p/4578553.html