创建一个新的虚拟机分配8G+内存,100G+硬盘,4核+处理器,配域名映射,免密,ip地址,主机域名映射
一:Linux中安装CDH
linux中域名映射
vi /etc/hosts
修改固定ip地址
vi /etc/sysconfig/network-scripts/ifcfg-ens33
配置免密
ssh-keygen --一路回车
ssh-copy-id doitcdh --分发免密给自己
在/opt目录下创建一个apps文件夹上传文件夹到此目录下
详细步骤:
①: vi /etc/selinux/config —> SELINUX=disabled (修改)
②:安装JDK
1)下载jdk
rpm -ivh oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
2)配置环境变量
vi /etc/profile
3)在文件末尾添加以下命令
export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera/
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
4)刷新配置文件
source /etc/profile
5)检查是否安装成功
java -version
java version “1.8.0_181” Java™ SE Runtime Environment (build
1.8.0_181-b13) Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)
③:创建一个文件夹 存储 mysql驱动包
mkdir -p /usr/share/java
上传mysql驱动包
rz
注:rz命令不能使用 执行下面指令
yum list | grep rz
yum -y install rz....
上传并改名
mv mysql-connector-java-5.1.39.jar mysql-connector-java.jar
④:安装mysql rpm安装
1:在/opt/apps下创建一个mysql文件夹 上传 解压
2:按照以下命令一步一步执行
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.65-1.el7.x86_64
yum -y install net-tools
yum -y install perl
rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm
service mysqld start
mysqld --initialize --user=mysql
cat /var/log/mysqld.log | grep password 拿到初始密码
mysql -uroot -p密码
查看网络端口号命令
修改密码遇到错误(由于自定义密码比较简单,出现了不符合密码策略的问题)
加入下面指令即可
mysql 安装完成!
⑤:1)开启root用户远程登录权限
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
mysql> flush privileges;
2)创建库(后续安装服务等使用)
create database cmserver default charset utf8 collate utf8_general_ci;
grant all on cmserver.* to 'root'@'%' identified by 'root';
#给hive
create database metastore default charset utf8 collate utf8_general_ci;
grant all on metastore.* to 'root'@'%' identified by 'root';
# 给CM的activity mornitor
create database amon default charset utf8 collate utf8_general_ci;
grant all on amon.* to 'root'@'%' identified by 'root';
# 给CM的Reports Manager
create database rman default charset utf8 collate utf8_general_ci;
grant all on rman.* to 'root'@'%' identified by 'root';
create database oozie default charset utf8 collate utf8_general_ci;
grant all on oozie.* to 'root'@'%' identified by 'root';
create database hue default charset utf8 collate utf8_general_ci;
grant all on hue.* to 'root'@'%' identified by 'root';
⑥: 安装 开启 http服务
yum -y install httpd
systemctl start httpd 开启这个服务
systemctl enable httpd.service 设置httpd服务开机自启
⑦:创建一个文件夹 作为cdh6的本地指定仓库的路径
创建文件夹指定名字不许改名
mkdir -p /var/www/html/cloudera-repos/
将cdh所在文件夹移入并改名
mv /opt/apps/cloudera-repos-6.2.0 /var/www/html/cloudera-repos/cm6
cd /var/www/html/cloudera-repos/cm6
yum -y install createrepo
以当前目录创建一个仓库
createrepo .
⑧:配置本地yum源的位置
vi /etc/yum.repos.d/cloudera-manager.repo
[clouder-manager]
name=Cloudera Manager,Version
baseurl=http://doitcdh/cloudera-repos/cm6/
gpgcheck=1
enabled=1
将yum清楚一下,重新创建缓存
yum clean all
yum makecache
⑨:导入 key
rpm --import http://doitcdh/cloudera-repos/cm6/RPM-GPG-KEY-cloudera
⑩:安装CDH
sudo yum -y install cloudera-manager-daemons
sudo yum -y install cloudera-manager-agent
sudo yum -y install cloudera-manager-server
11: 追加内容
/opt> mv apps/parcel-6.2.0/* cloudera/parcel-repo/
cd /opt/cloudera/parcel-repo
sha1sum CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel | awk ‘{ print $1 }’ > CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha
12:初始化
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql cmserver root root
13:启动服务
systemctl start cloudera-scm-server.service
二:WEB页面操作CDH
①:访问端口号 7180
http://doitcdh:7180
初始账号密码为 admin admin
②:继续三连
三:按照以下图操作
注:无图的地方都选默认
至此安装成功!!