名称 |
地址 |
操作系统 |
root密码 |
master |
192.168.217.130 |
Centos 7 |
root |
slave1 |
192.168.217.131 |
Centos 7 |
root |
slave2 |
192.168.217.132 |
Centos 7 |
root |
ssh-keygen cat .ssh/*.pub > .ssh/authorized_keys scp -r .ssh [email protected]:/root/ scp -r .ssh [email protected]:/root/ |
在master 机器上执行如下命令
vi /etc/hosts 192.168.217.130 master.bigdata.com master 192.168.217.131 slave1.bigdata.com slave1 192.168.217.132 slave2.bigdata.com slave2 scp /etc/hosts root@slave1:/etc/hosts scp /etc/hosts root@slave2:/etc/hosts |
iptables –F systemctl disable firewalld service firewalld stop setenforce 0 |
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum makecache |
本实验在mysql服务安装在了master节点,也可选择其他节点或机器。
具体步骤如下:
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm rpm -ivh mysql57-community-release-el7-8.noarch.rpm yum install mysql-server [root@master ~]# service mysqld start [root@master ~]# grep "password" /var/log/mysqld.log [root@master ~]# mysql -u root -p Enter password: mysql> set password = password("BigData123!@#"); mysql> grant all privileges on *.* to root@"%" identified by "BigData123!@#" ; mysql> flush privileges; |
yum install -y ntp systemctl enable ntpd |
setenforce 0 echo umask 0022 >> /etc/profile |
yum installmysql-connector-java.noarch
yum install yum-utils createrepo yum install httpd service httpd start |
操作系统 |
HDP/Ambari 版本 |
库名称 |
下载链接 |
CentOS 7 |
2.6.4.0 |
HDP |
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/HDP-2.6.4.0-centos7-rpm.tar.gz |
HDP-UTILS |
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz |
||
HDP-GPL |
http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/HDP-GPL-2.6.4.0-centos7-rpm.tar.gz |
||
CentOS 7 |
2.6.1.5 |
Ambari |
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz |
下载后把镜像包解压缩,并且移动到/var/www/html/hdp 目录下;
tar -zxvf ambari-2.6.1.5-centos7.tar.gz |
完成后目录结构如下:
wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.6.1.5/ ambari.repo -O /etc/yum.repos.d/ambari.repo |
3 执行ambari server安装
yum install ambari-server |
[root@master yum.repos.d]# ambari-server setup Checking SELinux... SELinux status is 'enabled' SELinux mode is 'permissive' WARNING: SELinux is set to 'permissive' mode and temporarily disabled. OK to continue [y/n] (y)? y Customize user account for ambari-server daemon [y/n] (n)? Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7 [3] Custom JDK ============================================================================== Enter choice (1): 1 ………… Successfully downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-8u112-linux-x64.tar.gz Installing JDK to /usr/jdk64/ Successfully installed JDK to /usr/jdk64/ Successfully downloaded JCE Policy archive to /var/lib/ambari-server/resources/jce_policy-8.zip Installing JCE policy... Checking GPL software agreement... GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? y Configuring database... ============================================================================== Choose one of the following options: [1] - PostgreSQL (Embedded) [2] - Oracle [3] - MySQL / MariaDB [4] - PostgreSQL [5] - Microsoft SQL Server (Tech Preview) [6] - SQL Anywhere [7] - BDB ============================================================================== Enter choice (1): 3 Hostname (localhost): master.bigdata.com Port (3306): Database name (ambari): Username (ambari): Enter Database Password (bigdata): BigData123_ Configuring ambari database... Configuring remote database connection properties... WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql (此处转下表的数据库操作) Proceed with configuring remote database connection properties [y/n] (y)? y Extracting system views... ambari-admin-2.6.1.5.3.jar Ambari Server 'setup' completed successfully. |
数据库操作
[root@master ~]# mysql -u root -p Enter password: mysql> create database ambari; mysql> grant all privileges on ambari.* to ambari@"%" identified by "BigData123_"; mysql> use ambari; Database changed mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql Query OK, 0 rows affected (0.00 sec) |
启动:ambari-server start
停止:ambari-server stop
启动成功后可以通过浏览器访问管理界面。
URL: 192.168.217.130:8080
用户名:admin
密码:admin
1.在浏览器打开http://192.168.217.130:8080
2.输入用户名密码 默认admin/admin
在HDP/centos7/2.6.4.0-91/HDP-2.6.4.0-91.xml文件基础上,修改baseurl。
选择增加版本、上传修改后的版本文件。
增加版本后,直接下一步
选择已有的mysql数据库,填入相关信息(用户名密码数据库地址)
数据库操作
[root@master ~]# mysql -u root -p Enter password: mysql> create database hive; mysql> grant all privileges on hive.* to hive@"%" identified by "BigData123_"; mysql> flush privileges; |
Ambari-server设置
[root@master bin]# rpm -qa |grep mysql-connector mysql-connector-java-5.1.25-3.el7.noarch [root@master bin]# rpm -ql mysql-connector-java-5.1.25-3.el7.noarch …… /usr/share/java/mysql-connector-java.jar …… [root@master java]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar Using python /usr/bin/python Setup ambari-server Copying /usr/share/java/mysql-connector-java.jar to /var/lib/ambari-server/resources If you are updating existing jdbc driver jar for mysql with mysql-connector-java.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts. JDBC driver was successfully initialized. Ambari Server 'setup' completed successfully. |
测试数据库连接。
密码:bigdata
密码:bigdata