Ambari 安装

    Ambari 没有简单的 .tar.gz 结尾的包,不能直接解压,配置一下就能跑的。apache 官网提供的安装方法,是要下载源码,自己编译成安装包安装。说明文档不够细,还要安装很多东西。编译的时候是用 maven,照理来说不应该会失败的。但是我总是失败,报找不到类的错误。maven 的仓库中明明是有的。实际生产环境,也不会是编译成安装包再安装的。还好, hortonworks 提供了 ambari 的安装方法。以下是在 centos7 上的安装步骤。

1. 下载ambari 仓库文件。

wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari.repo -O /etc/yum.repos.d/ambari.repo

2. 查看 

yum repolist

3. 安装。

yum -y install ambari-server

4. 配置 ambari-server

ambari-server setup --java-home=/opt/programs/jdk1.8.0_171 \
--database=mysql --databasehost=192.168.7.132 --databaseport=3306 \
--databasename=ambari --databaseusername=root --databasepassword=123456 \
--jdbc-driver=/opt/soft/mysql-connector-java-5.1.43.jar --jdbc-db=mysql

  这一步可以直接运行 ambari-server setup,根据提示输入自定义的内容。默认使用的 Postgres 数据库。

5. 启动 ambari-server 。

ambari-server start

   (1)如果报如下的错误, 

Starting ambari-server
ERROR: Exiting with exit code 1. 
REASON: Unable to detect a system user for Ambari Server.
- If this is a new setup, then run the "ambari-server setup" command to create the user
- If this is an upgrade of an existing setup, run the "ambari-server upgrade" command.
Refer to the Ambari documentation for more information on setup and upgrade.

          运行下面的命令,设置 ambari-server.user 的值为 root,或者另外一个系统用户

vi /etc/ambari-server/conf/ambari.properties

    (2)如果出现下面的错误,需要运行: yum install -y mysql-connector-java

Starting ambari-server
Ambari Server running with administrator privileges.
ERROR: Exiting with exit code -1. 
REASON: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties.

     (3) 其它错误的话,可以查看启动日志

more /var/log/ambari-server/ambari-server.log

       我事先没有创建库,会报数据库不存在的错误。如果报什么什么表不存在的话,需要把 /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql 中的初始化语句跑到数据库中。

猜你喜欢

转载自www.cnblogs.com/langfanyun/p/10330732.html