Centos6.8
- 配置好host /etc/hosts
- 网络是通的
- 支持免密通信 ssh
- 配置sudo
- 修改sshd配置
- selinux 关闭
# 关闭selinux
# 临时关闭,无需重启
setenforce 0
# 永久关闭,重启后生效。
sed -i s#SELINUX=enforcing#SELINUX=disabled#g /etc/selinux/config
(HDP2.6 官方依赖说明)[https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.3/bk_support-matrices/content/ch_matrices-ambari.html#ambari_min-sys-req]
- 依赖yum install -y rpm scp curl unzip tar wget openssl-devel openssl yum-utils createrepo yum-plugin-priorities
- 依赖python2.7
- JDK 1.8.0_77+
ulimit -n 65535
echo '* - nofile 65535' >> /etc/security/limits.conf
#
echo "vm.swappiness=10" >> /etc/sysctl.conf
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag " >> /etc/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local
echo "umask 0022" >> /etc/profile
echo "transparent_hugepage=never" >> /etc/grub.conf
echo "gpgcheck=0" >> /etc/yum/pluginconf.d/priorities.conf
# 创建目录
mkdir -p /var/www/html/hdp/
cd /var/www/html
createrepo ./
# 开启web服务
python -m SimpleHTTPServer 80 &
在/tmp/ 目录下,下载如下资源
- Ambari:ambari-2.6.0.0-centos6.tar.gz
- HDP:HDP-2.6.3.0-centos6-rpm.tar.gz
- HDP-UTILS:HDP-UTILS-1.1.0.21-centos6.tar.gz
tar zxvf /tmp/ambari-2.6.0.0-centos6.tar.gz -C /var/www/html/
tar zxvf /tmp/HDP-UTILS-1.1.0.21-centos6.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.21/repos/centos6
tar zxvf /tmp/HDP-2.6.3.0-centos6-rpm.tar.gz -C /var/www/html/hdp
chmod -R 777 /var/www/html/ambari
chmod -R 777 /var/www/html/hdp
# 在root 用户下
wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.6.0.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
wget http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.3.0/hdp.repo -O /etc/yum.repos.d/hdp.repo
# 修改ambari.repo 配置文件:
#VERSION_NUMBER=2.6.0.0-267
[ambari-2.6.0.0]
name=ambari Version - ambari-2.6.0.0
# baseurl=http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.6.0.0
# gpgcheck=1
# gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.6.0.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
baseurl=http://node0/ambari/centos6/2.6.0.0-267
gpgcheck=0
gpgkey=http://node0/ambari/centos6/2.6.0.0-267/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
# ambari.repo 修改完成
# 修改hdp.repo 配置文件:
#VERSION_NUMBER=2.6.3.0-235
[HDP-2.6.3.0]
name=HDP Version - HDP-2.6.3.0
# baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.3.0
# gpgcheck=1
# gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.3.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
baseurl=http://node0/hdp/HDP/centos6/2.6.3.0-235
gpgcheck=0
gpgkey=http://node0/hdp/HDP/centos6/2.6.3.0-235/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
# baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos6
# gpgcheck=1
# gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.3.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
baseurl=http://node0/hdp/HDP-UTILS-1.1.0.21/repos/centos6
gpgcheck=0
gpgkey=http://node0/hdp/HDP-UTILS-1.1.0.21/repos/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
# hdp.repo 修改完成
# 将上述ambari.repo 和 hdp.repo 同步到其他节点
# 在其他节点执行
yum clean all
yum makecache
yum repolist
yum -y erase hdp-select
yum install hdp-select
# 在node0中 安装ambari-server
yum install ambari-server
数据库选用mysql,版本在5.6+
# 进入mysql 命令行
CREATE DATABASE ambari;
use ambari;
CREATE USER 'ambari'@'%' IDENTIFIED BY 'ambari';
update mysql.user set password=PASSWORD("ambari")where user="ambari";
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
CREATE DATABASE hive;
use hive;
CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';
update mysql.user set password=PASSWORD("hive")where user="hive";
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE oozie;
use oozie;
CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie';
update mysql.user set password=PASSWORD("oozie") where user="oozie";
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
FLUSH PRIVILEGES;
# 配置ambari-server
mkdir -p /usr/share/java
\cp /tmp/mysql-connector-java-5.1.35.jar /usr/share/java/
echo "server.jdbc.driver.path=/usr/share/java/mysql-connector-java-5.1.35.jar" >> /etc/ambari-server/conf/ambari.properties
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.35.jar
# 启动服务
ambari-server start
Be sure you have run:
ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/mysql/mysql-connector-java.jar on the Ambari Server host to make the JDBC driver available and to enable testing the database connection.