Apache Ambari 2.7.3.0 离线安装

1. 准备 (内存 3G 硬盘 40G)

0)设置ssh无密码

ssh-keygen
cat id_rsa.pub >> authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_key

1)修改hostname、固定ip

    vi /etc/hosts →1.2.3.4 <fully.qualified.domain.name>

    hostname <fully.qualified.domain.name>

    vi /etc/sysconfig/network-scripts/ifcfg-ens33

BOOTPROTO=static

ONBOOT=yes

其他默认即可

重启network服务

2)网络相关

     vi /etc/sysconfig/network

        NETWORKING=yes

        HOSTNAME=<fully.qualified.domain.name>H

    关闭防火墙,selinux,PackageKit

        systemctl disable firewalld

        service firewalld stop

        vi /etc/selinux/config

            SELINUX=disabled

        vi /etc/yum/pluginconf.defresh-packagekit.conf

            enabled=0

3)umask

  echo umask 0022 >> /etc/profile

4)为ranger配置mysql→暂不做了,虚拟机跑步起来,悲哀

5)ambari使用mysql数据库

  ①卸载mariadb

     yum erase mariadb*

  ②On the Ambari host, install the JDBC driver for MySQL, and then add it to Ambari:

 yum install mysql-connector-java* 

  ③安装mysql server并启动

     yum install -y mysql-community-server-5.7.23-1.el7.x86_64.rpm mysql-community-devel-5.7.23-1.el7.x86_64.rpm mysql-community-common-5.7.23-1.el7.x86_64.rpm mysql-community-client-5.7.23-1.el7.x86_64.rpm mysql-community-libs-5.7.23-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm

    还有几个依赖包,一并安装好

    yum install -y libtirpc-devel-0.2.4-0.10.el7.x86_64.rpm

    systemctl start mysqld.service

  ③获取mysql随机生成的root密码

    grep 'A temporary password is generated for root@localhost' \ /var/log/mysqld.log |tail -1

  ④设置root新密码

     /usr/bin/mysql_secure_installation

     登录验证:mysql -u root -p

  ⑤在MySQL中配置SAM和架构注册表元数据存储:

     create database registry;

     create database streamline;

     创建架构注册表和SAM用户帐户,用密码替换字符串标识的最终帐户:

     CREATE USER 'registry'@'%' IDENTIFIED BY 'R12$%34qw';
     CREATE USER 'streamline'@'%' IDENTIFIED BY 'R12$%34qw';

     为用户帐户分配权限:

     GRANT ALL PRIVILEGES ON registry.* TO 'registry'@'%' WITH GRANT OPTION ;

     GRANT ALL PRIVILEGES ON streamline.* TO 'streamline'@'%' WITH GRANT OPTION ;

     提交操作

     commit;

  ⑥在mysql中配置druid和superset元数据存储

     为druid和superset元存储创建数据库:

     CREATE DATABASE druid DEFAULT CHARACTER SET utf8;

     CREATE DATABASE superset DEFAULT CHARACTER SET utf8;

     创建druid和superset用户帐户,用密码替换字符串标识的最终用户帐户:

     CREATE USER 'druid'@'%' IDENTIFIED BY '9oNio)ex1ndL';

     CREATE USER 'superset'@'%' IDENTIFIED BY '9oNio)ex1ndL';

     为druid帐户分配特权:

     提交操作

     commit;

   ⑦配置ranger数据库

mysql> CREATE USER 'rangerdba'@'localhost' IDENTIFIED BY 'Rangerdba_123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'localhost';
mysql> CREATE USER 'rangerdba'@'%' IDENTIFIED BY 'Rangerdba_123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'%';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'localhost' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'%' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

6)设置本地源 

RedHat 7

CentOS 7

HDP-3.1.0.0 HDP http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/HDP-3.1.0.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/3.x/updates/3.1.0.0/HDP-GPL-3.1.0.0-centos7-gpl.tar.gz
  Ambari 2.7.3  

http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari-2.7.3.0-centos7.tar.gz

  mkdir -p /var/www/html

  mv * /var/www/html/

  mv *.repo /etc/yum.repos.d/

2. 安装、设置ambari

1) 安装

   yum install ambari-server

2)设置

   ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

   ambari-server setup (*java提前下载好1.8版本*)

   配置ambari数据库

创建用户

mysql> CREATE USER 'ambari'@'%' IDENTIFIED BY 'Ambari_123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
mysql> CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'Ambari_123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
mysql> CREATE USER 'ambari'@'redhat74.hdp.com' IDENTIFIED BY 'Ambari_123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'redhat74.hdp.com';
mysql> FLUSH PRIVILEGES;

创建数据库

[root@redhat74 ~]# mysql -u ambari -p
mysql> CREATE DATABASE ambari;

导入ambari ddl

mysql> use ambari;
mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;

3.部署hdfs集群

1)启动ambari

ambari-server start

遇到报错:

ERROR: Exiting with exit code 1.
REASON: Server not yet listening on http port 8080 after 90 seconds. Exiting.

但是ambari-server仍能启动,前台可以打开

解决:

https://community.hortonworks.com/questions/186434/help-with-cant-start-the-sandboxambari-server-reas.html

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

添加server.startup.web.timeout=150

重启ambari-server,不再报错,正常启动使用

2)登录ambari

http://<your.ambari.server>:8080
the default user name/password: admin/admi

3)启动Ambari集群安装向导

资源有限,跑不起来,装个伪分布式测试机群(不知道可不可以,就只放了一个节点,试试咯)

ps:有一点更方便了

You can use ranges inside brackets to indicate larger sets of hosts. For example, for host01.domain through host10.domain use host[01-10].domain

 

 

 

 

 

  

 

 

  

 

 

  

    

 

 

 

 

 

   

 

posted on 2019-02-27 14:58  roger888  阅读(804)  评论(0编辑  收藏  举报

导航