A. 环境准备
使用yum安装一系列依赖的软件
关闭防火墙
# systemctl disablefirewalld
# systemctl stopfirewalld
关闭selinux,将“SELINUX=enforcing”à“SELINUX=disabled”
# vim
/etc/sysconfig/selinux
安装Oracle jdk,可以使用
# rpm -ivh oracle-j2sdk1.8-1.8.0+update141-1.x86_64.rpm
设置系统运行参数
设置swappiness
# echo 10 >/proc/sys/vm/swappiness
禁用透明大页面压缩,修改“/etc/rc.local”文件,重启生效
# vim /etc/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
修改“/etc/hosts”文件,添加配置节点的地址
# vim /etc/hosts
安装HAWQ2.3.0依赖软件包
# wgethttp://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/t/thrift-0.9.1-15.el7.x86_64.rpm
#rpm -ivh thrift-0.9.1-15.el7.x86_64.rpm
免密登录配置
如果系统中没有安装openssh,可以通过yum命令安装。然后在主节点进行ssh免密配置,并将生成的.ssh/文件替换到所有节点下
#yum install openssh openssh-clients openssh-server-7 -y
# ssh-keygen -t rsa
# ssh-copy-id XXXX
# scp -r /root/.ssh XXX:/root
NTP服务的安装以保障集群内时间的同步
首先要移除默认安装的chrony,然后将主节点作为NTP本地服务器。
# yum -y remove chrony
# yum -y install ntp
# vim /etc/ntp.conf //注释掉server0 server1 server2 server3
添加
server 127.127.1.0
fudge 127.
在其他节点,注释掉server0 server1 server2 server3,添加
serverXX.XX.XX.XX
# systemctl restart ntpd
# systemctl status ntpd //查看运行状态
安装HTTPD服务
start httpd
#vim
/etc/httpd/conf/httpd.conf
httpd.conf数据库MariaDB的安装配置
# yum -y install mariadb
# yum -y install mariadb-server
启动MariaDB
# systemctl start mariadb
# /usr/bin/mysql_secure_installation
Y、Y、N、Y、Y
建立Ambari,Hive需要的数据库
# mysql -u root -p
# create database metastore defaultcharacter set utf8;
# CREATE USER 'hive'@'%' IDENTIFIED BY'password';
# GRANT ALL PRIVILEGES ON metastore.*TO 'hive'@'%';
# FLUSH PRIVILEGES;
# create database ambari default character setutf8;
# CREATE USER 'ambari'@'%' IDENTIFIED BY'password';
# GRANT ALL PRIVILEGES ON ambari.* TO'ambari'@'%';
安装JDBC驱动,版本可以更改
# mkdir -p/usr/share/java/
# mvmysql-connector-java-5.1.34.jar /usr/share/java/
# cd /usr/share/java
# chmod 777mysql-connector-java-5.1.34.jar
# ln -smysql-connector-java-5.1.34.jar mysql-connector-java.jar
替换yum源
首先备份yum
# cp /etc/yum.repos.d /etc/yum.repos.d-backup
解压HDP和Ambari包到/var/www/html目录
# wgethttp://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.0.0.0/HDP-GPL-3.0.0.0-centos7-gpl.tar.gz
# wgethttp://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
# wgethttp://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.0.0.0/HDP-3.0.0.0-centos7-rpm.tar.gz
# wgethttp://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.0.0/ambari-2.7.0.0-centos7.tar.gz
# tar -zxvf file -C /var/www/html/
分别制作repo文件
# vim /etc/yum.repos.d/ambari.repo
# vim/etc/yum.repos.d/hdp.repo
# vim/etc/yum.repos.d/hdp_gpl.repo
# vim/etc/yum.repos.d/hdp_utls_repo.repo
# yum repolist
B.安装
安装ambari-server
# yum -y install ambari-server
建立Ambari与MySQL驱动链接
# ambari-server setup--jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
初始化Ambari Server
# ambari-server setup
初始化Ambari数据库
# mysql -uroot -p -Dambari < /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
可进入数据库查看是否创建成果
各个节点手动安装ambari-agent
# yum install ambari-agent-y
# systemctl start ambari-agent
# systemctl enableambari-agent
C.启动
数据库
# systemctl start mariadb
Httpd服务
# service httpd start
Ambari
# Amabri-server start
后面的实在是没截图,反正是肯定会报错的。
网友评论