环境准备
- 关闭seLinux:sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
- 关闭防火墙:
-
service iptables stop
chkconfig iptables off
service iptables status
-
- 搭建本地yum源
(1)执行安装命令:yum install httpd -y (2)启动服务:/etc/rc.d/init.d/httpd start (3)开放80端口: ①开放端口:/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT ②保存防火墙设置:/etc/rc.d/init.d/iptables save ③重启防火墙:/etc/init.d/iptables restart (4)在/var/www/html目录下创建自己的文件夹,用来存储yum依赖包 (5)将bddfa_3.3.0.1.tar.gz解压到/var/www/html目录下 (6)重启httpd服务 (7)创建 .repo文件 ①vi /etc/yum.repos.d/ambari.repo 1)文件内容 [bddfa-3.3.0.1] name=bddfa Version - bddfa-3.3.0.1 baseurl=http://192.168.145.139/bddfa_3.3.0.1 gpgcheck=0 enabled=1 注:192.168.145.139为httpd服务的IP地址
- 安装JDK
- 使用版本:jdk-8u112-linux-x64.tar.gz
- 安装MySQL(可选)
- 安装yum install mysql-server
- 启动:service mysqld start
- 安装MySQL JDBC Connector:yum install mysql-connector-java
- 重启MySQL:service mysqld restart
- 初始化密码:/usr/bin/mysql_secure_installation
-
- 进入MySQL
- create database ambari;
- use ambari;
- CREATE USER 'ambari'@'%' IDENTIFIED BY 'bigdata';
- GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
- CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'bigdata';
- GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
- CREATE USER 'ambari'@'ecp1' IDENTIFIED BY 'bigdata';
- GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'ecp1';
- FLUSH PRIVILEGES;
- 进入MySQL
安装
- yum install -y ambari-server
- ambari-server setup
- 建表
- mysql -uambari -pbigdata
- use ambari
- source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql ;
- ambari-server start
- 创建hive使用的数据库
- mysql -uroot -121444
- CREATE DATABASE hive;
- use hive;
- CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';
- GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
- CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive';
- GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost';
- CREATE USER 'hive'@'ecp1' IDENTIFIED BY 'hive';
- GRANT ALL PRIVILEGES ON *.* TO 'hive'@'ecp1';
- FLUSH PRIVILEGES;
- 创建oozie使用的数据库
- mysql -uroot -121444
- CREATE DATABASE oozie;
- use oozie;
- CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie';
- GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
- CREATE USER 'oozie'@'localhost' IDENTIFIED BY 'oozie';
- GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'localhost';
- CREATE USER 'oozie'@'ecp1' IDENTIFIED BY 'oozie';
- GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'ecp1';
- FLUSH PRIVILEGES;