# service ntpd start
1.3.7 卸载OpenJDK安装Oracle JDK
命令
#rpm -qa | grep java
#rpm -e --nodeps xxx
#rpm -ivh xxx.rpm
#vi /etc/profiles
//配置 JAVA_HOME
export JAVA_HOME=/xxx
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
#source /etc/profiles
1.3.8 安装、配置PostgreSQL或MySQL
PostgreSQL安装命令
# wget https://download.postgresql.org/pub/repos/yum/9.2/RedHat/rhel-6-x86_64/pgdg-centos92-9.2-8.noarch.rpm
# rpm –ivh xxxx.rpm
# vi /etc/yum.repos.d/ CentOS-Base.repo
[base]
…
exclude=postgresql*
[updates]
…
exclude=postgresql*
# yum upgrade postgresql-libs
# yum install postgresql92-server
# service postgresql-9.2 initdb
# service postgresql-9.2 start
# psql -U postgres
//修改配置文件/var/lib/pgsql/9.1/data/pg_hba.conf 将peer改为trust,将METHOD由默认的ident改为md5,再重启服务
MySQL安装、部署命令
# rpm -qa | grep mysql
# rpm -e --nodeps mysql //卸载原有的MySQL
# yum install -y mysql-server mysql mysql-devel
# service mysqld start
# chkconfig mysqld on //开机启动mysqld服务
# mysqladmin -u root password 'root' //初始化数据库root账户
1.3.9 安装MySQL依赖
命令
# yum install mysql-connector-java
# chmod 644 /usr/share/java/<mysql-connector-java.jar>
1.3.10 UMASK
命令
#echo umask 0022 >> /etc/profile
1.3.11 搭建本地库
(1) 基本依赖组件安装
命令
# yum install createrepo
# yum install openssl
# yum install nc
# yum install redhat-lsb
# yum install gcc
# yum install python-devel
# yum install python-libs
(2) 下载相关文件
ITEMS
URLS
Ambari 2.2.2
ambari-2.2.2.0-centos6.tar.gz
HDP 2.4
updates/2.4.2.0/HDP-2.4.2.0-centos6-rpm.tar.gz
HDP-UTILS
repos/centos6/HDP-UTILS-1.1.0.20-centos6.tar.gz
(3) 安装Apache httpd
命令
# yum install httpd
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start
# mkdir -p /var/www/html/ambari
# mkdir -p /var/www/html/hdp
# mkdir -p /var/www/html/hdp-utils
(4) 解压、配置repo文件
命令
# tar -zxvf ambari-2.2.2.0-centos6.tar.gz -C /var/www/html/ambari
# tar -zxvf HDP-2.4.2.0-centos6-rpm.tar.gz -C /var/www/html/hdp
# tar -zxvf HDP-UTILS-1.1.0.20-centos6.tar.gz -C /var/www/html/hdp-utils
# vi ambari.repo
[Updates-ambari-2.2.2.0]
name=ambari-2.2.2.0-Updates
baseurl=http://192.168.31.3/ambari/AMBARI-2.2.2.0/centos6/2.2.2.0-460/
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
# vi hdp.repo
[HDP-2.4.2.0]
name=HDPVersion-HDP-2.4.2.0
baseurl=http://192.168.31.3/hdp/HDP/centos6/2.x/updates/2.4.2.0/
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.2.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
# vi hdp-utils.repo
[HDP-UTILS-1.1.0.20]
name=HDPUtilsVersion-HDP-UTILS-1.1.0.20
baseurl=http://192.168.31.3/hdp-utils/HDP-UTILS-1.1.0.20/repos/centos6/
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.2.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
# cp ambari.repo /etc/yum.repos.d/
# cp hdp.repo /etc/yum.repos.d/
# cp hdp-utils.repo /etc/yum.repos.d/
//打开编辑的链接,可以看到解压出的文件已经挂在httpd上了。
2. Ambari组件安装 2.1 Ambari server
命令
# yum install ambari-server
# ambari-server start //启动服务
# ambari-server status //状态查看
//初始化数据库(以MySQL为例)
# mysql -u root -p
mysql> CREATE USER '<AMBARIUSER>'@'%' IDENTIFIED BY '<AMBARIPASSWORD>';
mysql> GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'%';
mysql> CREATE USER '<AMBARIUSER>'@'localhost' IDENTIFIED BY '<AMBARIPASSWORD>';
mysql> GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'localhost';
mysql> CREATE USER '<AMBARIUSER>'@'<AMBARISERVERFQDN>' IDENTIFIED BY '<AMBARIPASSWORD>';
mysql> GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'<AMBARISERVERFQDN>';
mysql> FLUSH PRIVILEGES;
# ambari-server setup //根据提示进行