not yet [HDP] HDP集群环境搭建:1.Ambari2.2.1安装

环境:RedHat6.5、JDK1.7_79、Python2.7.6、Ambari2.2.1.0

主机:安装Ambari的主机   HDMB01  192.168.111.80

1.登录主机(root) 下载repo: http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari.repo
然后

$ cp ambari.repo /etc/yum.repos.d/

 

2.安装ambari-server[root]
$ yum repolist
$ yum install ambari-server

3.配置mysql
创建ambari数据库,并创建用户ambari。mysql -u root -p登录mysql用户

mysql>create database ambari;
mysql>use mysql;
mysql>create user ambari identified by 'ambari';
mysql>grant all privileges on *.* to 'ambari'@'localhost' identified by 'ambari' with grant option;
mysql>grant all privileges on *.* to 'ambari'@'%' identified by 'ambari' with grant option;

 

4.对ambari-server进行配置设置(可以为ambari-server创建自己的用户,不过我为了省事还是用root)

$ ambari-server setup

参考:

Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue<span style="color: #ff0000;"> [y/n] (y)? y</span>
Customize user account for ambari-server daemon [y/n] (n)?
Adjusting ambari-server permissions and ownership...
Checking firewall status...
WARNING: iptables is running. Confirm the necessary Ambari ports are accessible. Refer to the Ambari documentation for more details on
ports.
OK to continue [y/n] (y)?
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): 3
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited
Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME: /usr/local/jdk1.7.0_79
Validating JDK on Ambari Server...done.
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): 192.168.111.148
Port (3306):
Database name (ambari): ambari
Username (ambari): ambari
Enter Database Password (bigdata):
Re-enter password:
Configuring ambari database...
WARNING: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java.
Press <enter> to continue.
Copying JDBC drivers to server resources...
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.4.2.0.136.jar
....
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

注意:在WARNING: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java.
这一步将对应的jdbc driver放到/usr/share/java

5.启动Ambari Server

$ ambari-server start

然后显示日志:

Using python /usr/bin/python2
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start....................

Ambari Server ‘start’ completed successfully.

 

6.打开Ambari页面

打开 http://IP:8080即可看到页面,用户名密码都是admin,登陆后即可看到完成安装了


 

 

常见问题及解决:
问题1:ambari-server start的时候报错 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver。但是查看/var/lib/ambari-
server/resources/后发现mysql-connector-java-5.1.40-bin.jar已经存在
解决方法:这应该是HDP的一个bug,即没法识别 mysql-connector-java-5.1.40-bin.jar的文件名,所以注意将mysql-connector-java-5.1.40-bin.jar 改成名字 mysql-connector-java.jar然后重新执行即可
$ ambari-server setup –jdbc-db=mysql –jdbc-driver=/${yourPath}/mysql-connector-java.jar

分类上一篇:无,已是最新文章    分类下一篇:

Leave a Reply