『Cloudera Manager』是一个拥有集群自动化安装、中心化管理、集群监控、报警功能的一个工具(软件),使得安装集群从几天的时间缩短在几个小时内,运维人员从数十人降低到几人以内,极大的提高集群管理的效率。
注:没有特殊说明,所有的指令在三台虚拟机中执行。
1、系统配置
三台初始状态虚拟机『caroly01』『caroly02』『caroly03』,系统版本为:『CentOS-6.8-x86_64』
分配内存(物理内存为 8G)分别为:(6G、2G、2G)/ 8G;若内存为 16G,分配内存为:(10G、2G、2G),剩下 2G 留给操作系统
角色分配为:S/A、A、A
2、网络配置
vi /etc/sysconfig/network
vi /etc/hosts
3、SSH 免密钥登陆
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
ssh-copy-id caroly01/caroly02/caroly03
4、防火墙关闭
service iptables stop
chkconfig iptables off
5、SELINUX 关闭
setenforce 0
vi /etc/selinux/config (SELINUX=disabled)
6、安装 JDK 配置环境变量
rpm -i jdk-8u251-linux-x64.rpm
vi /etc/profile +
export JAVA_HOME=/usr/java/jdk1.8.0_251-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
. /etc/profile
7、安装 NTP
yum install ntp
设置开机启动:
chkconfig ntpd on
设置时间同步:
ntpdate 0.centos.pool.ntp.org
8、更换源
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=https://vault.centos.org/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=https://vault.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=https://vault.centos.org/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=https://vault.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=https://vault.centos.org/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=https://vault.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=https://vault.centos.org/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=https://vault.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=https://vault.centos.org/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=https://vault.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
yum clean all
yum makecache
9、安装配置 MySQL(『caroly01』)
yum install mysql-community-server
service mysqld start
查看数据库初始密码:
grep 'temporary password' /var/log/mysqld.log
更改密码长度:
set global validate_password_length=4;
设置密码的验证强度等级:
set global validate_password_policy=LOW;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123123' WITH GRANT OPTION;
flush privileges;
10、下载第三方依赖包
yum install -y chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb
1、安装 Cloudera Manager Server、Agent(『caroly01』)
(三台都需要执行)
mkdir /opt/cloudera-manager
tar xf cloudera-manager*.tar.gz -C /opt/cloudera-manager
`注:参数 v 的意思是显示解压日志,我们的命令是在 client 端书写,作用在 server 端,如果日志有十亿行输出,等于这十亿行输出会通过 TCP 回响到 client 端,会对 server 端有个输出压力。所以不用 v。`
2、创建用户 cloudera-scm
useradd --system --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
3、配置 CM Agent
vi /opt/cloudera-manager/cm-5.4.3/etc/cloudera-scm-agent/config.ini
server_host=caroly01
4、配置 CM Server 数据库(『caroly01』)
cd /usr/share/java/
mv ~/software/mysql-connector-java-5.1.26-bin.jar ./mysql-connector-java.jar
grant all on *.* to 'temp'@'%' identified by 'temp' with grant option;
cd /opt/cloudera-manager/cm-5.4.3/share/cmf/schema/
./scm_prepare_database.sh mysql temp -h caroly01 -utemp -ptemp --scm-host caroly01 temp temp temp
`格式:脚本 数据库远程连接 cm server服务器 建立的数据库名 数据库中用户名 用户名密码`
5、创建 Parcel 目录
Server 节点(『caroly01』)
mkdir -p /opt/cloudera/parcel-repo
chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
Agent 节点
mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
6、制作 CDH 本地源(『caroly01』)
cd /opt/cloudera/parcel-repo
cp ~/software/CDH-5.4.0-1.cdh5.4.0.p0.27-el6.parcel ./
cp ~/software/CDH-5.4.0-1.cdh5.4.0.p0.27-el6.parcel.sha ./
cp ~/software/manifest.json ./
cd /opt/cloudera-manager/
scp -r ./* caroly02:`pwd` > /dev/null
scp -r ./* caroly03:`pwd` > /dev/null
du -sh ./* `查看各文件的大小`
`注:若不想看日志输出,则将输出重定向到 /dev/null,报错还是会看到的。`
7、启动 CM Server(『caroly01』)、Agent(三台都需要执行)
cd /opt/cloudera-manager/cm-5.4.3/etc/init.d
./cloudera-scm-server start
`注:Sever首次启动会自动创建表以及数据,不要立即关闭或重启,否则需要删除所有表及数据重新安装`
./cloudera-scm-agent start
8、启动日志查看启动情况(『caroly01』)
cd /opt/cloudera-manager/cm-5.4.3/log/cloudera-scm-server
tail -f cloudera-scm-server.log
9、访问
浏览器中输入:(用户名和密码均为 admin)
caroly01:7180
本文由 caroly 创作,如果您觉得本文不错,请随意赞赏
采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载 / 出处外,均为本站原创或翻译,转载前请务必署名
原文链接:https://caroly.fun/archives/clouderamanager部署
最后更新:2021-04-29 16:09:42
Update your browser to view this website correctly. Update my browser now