centos7 安装cdh6.2

大数据

2021-06-24

534

0

1、硬件配置

Linux服务器一台

内存4G+

磁盘50G+

2、网络配置

要确保每台服务器都能相互通信

1)设置主机名

sudo hostnamectl set-hostname foo-1.example.com

2)在/etc/hosts 添加其他主机名

192.168.216.128  foo-1.example.com  foo-1
#2.2.2.2  foo-2.example.com  foo-2
#3.3.3.3  foo-3.example.com  foo-3
#4.4.4.4  foo-4.example.com  foo-4

3、关闭防火墙

sudo systemctl disable firewalld
sudo systemctl stop firewalld

4、设置SELinux模式

vi /etc/selinux/config
#修改 SELINUX=enforcing
SELINUX=permissive
#保存文件
#临时关闭SELinux
setenforce 0

5、安装 NTP service

yum install ntp

vi /etc/ntp.conf
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

#启动ntp
sudo systemctl start ntpd
sudo systemctl enable ntpd

#设置定时任务
#与阿里云服务器进行时钟同步
crontab  -e
#设置的内容如下
*/1 * * * * /usr/sbin/ntpdate -u ntp4.aliyun.com;

6、配置免登陆

主节点生产公钥和私钥

#执行下面的命令之后,要连续按三个回车
cd ~
ssh-keygen -t rsa
#生成公钥
ssh-copy-id foo-1.example.com

#将其他服务器公钥放到主服务器
scp /root/.ssh/authorized_keys foo-1.example.com:/root/.ssh

7、主节点安装Mysql

1.下载rpm包
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
#2.安装myaql源
yum localinstall -y mysql80-community-release-el7-3.noarch.rpm
#3.检查MySQL源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
#4.修改yum源配置文件,获取自己想要安装的mysql5.7版本
vi /etc/yum.repos.d/mysql-community.repo
把5.7版本的enabled设置为1,8.0版本的设置为0
#再次查看mysql版本
yum repolist enabled | grep "mysql.*-community.*"
#5.开始安装
yum -y install mysql-community-server
#安装完成后可在/etc/my.cnf修改mysql配置
#6.启动mysql服务
systemctl start mysqld
#7.设置开机启动mysql服务
systemctl enable mysqld
#8.获取默认密码并修改
grep 'temporary password' /var/log/mysqld.log
mysql -u root -p
alter user user() identified by "password";
#9.允许用户远程登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;

 8、创建CDH源数据库、用户及服务的数据库 

CREATE DATABASE scm DEFAULT CHARACTER SET utf8;
CREATE USER 'scm'@'%'IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON scm.* TO 'scm'@'%' IDENTIFIED BY 'password'; 
GRANT ALL PRIVILEGES ON *.* TO 'scm'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

CREATE DATABASE amon DEFAULT CHARACTER SET utf8;
CREATE USER 'amon'@'%'IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON amon.* TO 'amon'@'%' IDENTIFIED BY 'password'; 
GRANT ALL PRIVILEGES ON *.* TO 'amon'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

CREATE DATABASE hive DEFAULT CHARACTER SET utf8;
CREATE USER 'hive'@'%'IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%' IDENTIFIED BY 'password'; 
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

CREATE DATABASE hue DEFAULT CHARACTER SET utf8;
CREATE USER 'hue'@'%'IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON hue.* TO 'hue'@'%' IDENTIFIED BY 'password'; 
GRANT ALL PRIVILEGES ON *.* TO 'hue'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

CREATE DATABASE oozie DEFAULT CHARACTER SET utf8;
CREATE USER 'oozie'@'%'IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'password'; 
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

-- 刷新mysql的权限列表 
FLUSH PRIVILEGES;

9、安装JDK1.8

mkdir /usr/java
cd /usr/java
#下载JDK
wget https://download.oracle.com/otn/java/jdk/8u291-b10/d7fc238d0cbf4b0dac67be84580cfb4b/jdk-8u291-linux-x64.tar.gz?AuthParam=1624516816_c46ea1929101c77e283a9cd600636fa7
tar -zxvf jdk-8u291-linux-x64.tar.gz 
#配置环境变量
vi /etc/profile

export JAVA_HOME=/usr/java/jdk1.8.0_291
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=:$JAVA_HOME/bin:$PATH

source /etc/profile

10、下载jdbc驱动包

mkdir -p /usr/share/java
cd /usr/share/java
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar
mv mysql-connector-java-5.1.49.jar oracle-connector-java.jar

11、制作离线仓库

1、分别cm server 和cdh6的安装包

http://ro-bucharest-repo.bigstepcloud.com/cloudera-repos/cm6/redhat/7/x86_64/cm/6.2.0/

http://ro-bucharest-repo.bigstepcloud.com/cloudera-repos/cdh6/parcels/6.2.0/

2、发布

#安装工具
yum install createrepo httpd
#在下载安装包的目录执行
createrepo .
#启动httpd
service httpd start
#映射目录到httpd
ln -s /安装包目录 /var/www/html/cdh6.2
#创建yum源
vi /etc/yum.repos.d/cdh6.repo
[osrepo]
name=os_repo
baseurl=http://ip/cdh6.3.2
enabled=true
gpgcheck=false

 

12、安装cm server

1、主节点安装

yum install cloudera-manager-server

2、子节点安装

yum install cloudera-manager-daemons
yum install cloudera-manager-agent

 3、修改所有节点agent配置

vi /etc/cloudera-scm-agent/config.ini
#修改文件中server_host的属性值
server_host=foo-1.example.com

 4、初始化scm数据库

#主节点执行
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm password

5、启动

#主节点启动CM server
systemctl start cloudera-scm-server
#所有节点启动CM agent
systemctl start cloudera-scm-agent 

6、web访问地址

http://192.168.216.128:7180

admin/admin

未完待续。

转载请注明出处: http://www.julyme.com/20210624/113.html

发表评论

全部评论:0条

Julyme

感觉还行吧。

Julyme的IT技术分享



/sitemap