Ambari 2.6.1 构建 Hadoop 集群 ---- CentOS 7


1. 准备 ( Getting Ready )

Ambari 为 Hadoop 集群提供了一个端对端的管理和监控方案(end-to-end management and monitoring solution)。利用 Ambari 的 Web UI and REST APIs,

可以在一个中心点部署、操作、管理配置,以及监控集群的所有节点服务。



    1.1 确定安装栈兼容性 ( Determine Stack Compatibility )
    -------------------------------------------------------------------------------------------------------------------------------------
    HDP —— Hortonworks Data Platform

    Ambari 支持很多安装栈版本,如下表所示:

            
            Use this table to determine whether your Ambari and HDP stack versions are compatible
            
            +========+==========+===========+=======================+
            | Ambari | HDP 2.6    | HDP 2.5    | HDP 2.4(deprecated)    |
            +--------+----------+-----------+-----------------------+
            | 2.6.x  | √        | √            | √                        |
            +--------+----------+-----------+-----------------------+
            | 2.5.x  | √        | √            | √                        |
            +--------+----------+-----------+-----------------------+
            | 2.4.x  |            | √            | √                        |
            +--------+----------+-----------+-----------------------+

            Ambari does not install Hue or HDP Search (Solr).


    1.2 满足最小系统要求 ( Meet Minimum System Requirements )
    -------------------------------------------------------------------------------------------------------------------------------------
    系统必须满足如下最小系统要求

    
    ● 浏览器要求 (Browser Requirements)
    -------------------------------------------------------------------------------------------------------------------------------------
        
            Ambari 2.5.1 or later Browser Requirements        
        +-------------------+-----------------------------------+
        | Operating System    |            Browser                    |
        +-------------------+-----------------------------------+
        |                     | Chrome 56.0.2924.87, 57.0.2987    |
        |    Linux            +-----------------------------------+
        |                    | Firefox 51, 52                    |
        +-------------------+-----------------------------------+

    
    ● 软件要求 (Software Requirements)
    -------------------------------------------------------------------------------------------------------------------------------------
    每部主机上:
        yum and rpm (RHEL/CentOS/Oracle Linux)
        scp, curl, unzip, tar, and wget
        OpenSSL (v1.01, build 16 or later)
        Python 2.7.x



    ● JDK 要求 (JDK Requirements)
    -------------------------------------------------------------------------------------------------------------------------------------
    
            HDP 2.6.4 JDK Support
        +---------------+-----------------------------------------------+
        |     JDK            |         Version                                    |
        +---------------+-----------------------------------------------+
        | Open Source    | JDK 8                                            |
        +---------------+-----------------------------------------------+
        | Oracle        | JDK 8, 64-bit (minimum JDK 1.8.0_77), default    |
        +---------------+-----------------------------------------------+


    ● 数据库要求 (Database Require)
    -------------------------------------------------------------------------------------------------------------------------------------
    Ambari 要求一个关系数据库来存储有关集群配置和拓扑信息。如果安装 HDP Stack 选择 Hive 或 Oozie, 也需要一个关系型数据库。
    
    Ambari 支持的数据库:
        □ PostgreSQL 9.1.13+,9.3, 9.4***
        □ MariaDB 10.1*
        □ MySQL 5.6****
        □ Oracle 11gr2
        □ Oracle 12c**

    默认情况下,Ambari 在 Ambari Server 主机上安装一个 PostgreSQL 实例。Hortonworks  支持任何版本的 PostgreSQL, 安装 Ambari Server 时会自动
    安装。也可以选择使用一个已存在的  PostgreSQL, MySQL 或 Oracle  实例。

    如果使用 HDP 2.5, MariaDB 10 数据库支持 RHEL/CentOS/Oracle Linux 7 or SLES 12.
    使用已存在的 Oracle 12c 数据库只支持 HDP 2.3 or later.
    使用已存在的 PostgreSQL 9.4 只支持 HDP 2.5 or later.
    使用已存在的 MySQL 5.6 数据库只支持默认的, InnoDB 引擎.

    
    ● 内存要求 (Memory Requirements)
    -------------------------------------------------------------------------------------------------------------------------------------
    Ambari 主机至少 1 GB RAM, 500 MB 可用。
    
    
    ● 检查最大打开文件描述符数量 (Check the Maximum Open File Descriptors)
    -------------------------------------------------------------------------------------------------------------------------------------    
    建议最大打开文件数量为 10000,或者更多。检查当前可打开文件数量,在每部主机上执行下面命令:
    
        ulimit -Sn
        ulimit -Hn
    
    如果输出不大于 10000,运行下面命令来设置合适的默认值:
    
        ulimit -n 10000

    
    1.3 收集信息 ( Collect Information )
    -------------------------------------------------------------------------------------------------------------------------------------
    部署集群之前,应收集如下信息:
    
    ● 每个主机的 FQDN —— fully qualified domain name 。 可通过如下命令检查:
    
        hostname -f
        
    ● 每个主机要设置的组件列表
    
    ● 规划数据存储挂载点的基目录 (base directories)
    
        □ NameNode data
        □ DataNodes data
        □ Secondary NameNode data
        □ YARN data
        □ ZooKeeper data, if you install ZooKeeper
        □ Oozie data
        □ Various log, pid, and db files, depending on your install type
    
        重要提示:
        ---------------------------------------------------------------------------------------------------------------------------------
        必须使用 base directories 为组件和 Hadoop 数据提供持久化存储位置。使用可能被删除的位置来安装组件会导致集群失效或数据丢失。例如,
        不要在 base directory 路径上使用 /tmp 。
    
    
    
    1.4 准备环境 ( Prepare the Environment )
    -------------------------------------------------------------------------------------------------------------------------------------    
    使用 Ambari 部署 Hortonworks stack, 需要准备部署环境。
    
    
    
    ■ 设置无密码 SSH (Set Up Password-less SSH)
    -------------------------------------------------------------------------------------------------------------------------------------
    为了执行 Ambari Server 在集群的所有主机上自动安装 Ambari Agent, 必须在集群的 Ambari Server 主机和所有其他主机之间设置无密码 SSH 连接。
    Ambari Server 主机利用 SSH 公钥认证远程访问并安装 Ambari Agent.
    
        注:也可以选择在集群的每个主机上手动安装 Ambari Agent. 这种情况下,不需要生成和分发 SSH key
    
    步骤:
        ① Ambari Server 主机上生成 SSH keys        
            ssh-keygen
            
        ② 复制 SSH 公钥(id_rsa.pub) 到目标主机的根帐号 (root account)
            .ssh/id_rsa
            .ssh/id_rsa.pub
            
        ③ 在目标主机上把 SSH 公钥(SSH Public Key)添加到 authorized_keys 文件
            cat id_rsa.pub >> authorized_keys
            
            
        ④ 根据使用的 SSH 版本,在目标主机上可能需要设置 .ssh 目录的权限为 700, 目录下的 authorized_keys 文件权限为 600
            chmod 700 ~/.ssh
            chmod 600 ~/.ssh/authorized_keys
            
        ⑤ 从 Ambari Server 的主机上,确保可以 SSH 无密码连接到集群的每一部主机上。
            ssh root@<remote.target.host>
            
        ⑥ 如果第一次登录显示:Are you sure you want to continue connecting (yes/no)?
            输入 yes
        
        ⑦ 在运行基于 web 的 Ambari 安装向导的主机上保留一份 SSH 私钥 (SSH Private Key) 拷贝。
    
        
        便捷方法:将配置好的 .ssh 目录整个复制到所有目标主机
        
            生成密钥之后,执行:    
            [root@ambari ~]# ssh-copy-id localhost
            [root@ambari ~]# scp -r ~/.ssh namenode.sansovo.org:~/
    
        注:使用非根 SSH 帐号(non-root SSH account)也是可能的,但这个非根帐号必须能不需要输入密码执行 sudo 命令。
    

    ■ 设置服务帐号 (Set Up Service User Accounts)
    -------------------------------------------------------------------------------------------------------------------------------------    
    每个服务要求一个服务用户帐号(a service user account). Ambari 集群安装向导创建新的并保留已存在的服务用户帐号,并使用这些帐号配置Hadoop
    服务。
    
    在 Hadoop 中,每一个服务都运行在它们自己的 Unix 帐号所有者身份之下,这些帐号称之为服务用户(service user). 服务用户属于特定的 Unix 用户
    组 (Unix group). 可以在 Customize Services 安装步骤的 Misc 选项卡来自定义这些帐号和组。
    
    如果选择了自定义的帐号名, Ambari 会检查这些帐号是否存在。如果不存在 Ambari 会自动创建。安装过程中默认帐号总是会自动创建,不管是否指定
    了自定义帐号。如果默认帐号没有使用,可以在安装之后删除。
    
    注:服务帐号必须是 UID >= 1000
    
    
                                    Service Users
            +===================+=======================+===================================+
            | Service            | Component                | Default User Account                |
            +-------------------+-----------------------+-----------------------------------+
            | Accumulo            | Accumulo Tracer,        | accumulo                            |
            |                    | Accumulo Monitor,     | (HDP 2.2 or later)                |
            |                    | Accumulo GC, Accumulo    |                                    |
            |                    | Master                |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Ambari Metrics    | Metrics Collector,    | ams                                |
            |                    | Metrics Monitor        |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Ambari Infra        | Infra Solr Instance    | infra-solr                        |
            +-------------------+-----------------------+-----------------------------------+
            | Atlas                | Atlas Metadata Server    | atlas (HDP 2.3 or later)            |
            +-------------------+-----------------------+-----------------------------------+
            | Falcon             | Falcon Server            | falcon                            |
            +-------------------+-----------------------+-----------------------------------+
            | Flume                | Flume Agents            | flume                                |
            +-------------------+-----------------------+-----------------------------------+
            | HBase                | MasterServer            | hbase                                |
            |                    | RegionServer            |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | HDFS                | NameNode                 | hdfs                                |
            |                    | SecondaryNameNode     |                                    |
            |                    | DataNode                |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Hive                | Hive Metastore,         | hive                                |
            |                    | HiveServer2            |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | HUE                | HUE                    | hue                                |
            +-------------------+-----------------------+-----------------------------------+
            | Kafka                | Kafka Broker            | kafka                                |
            +-------------------+-----------------------+-----------------------------------+
            | Knox                | Knox Gateway            | knox                                |
            +-------------------+-----------------------+-----------------------------------+
            | Mahout            | Mahout clients        | mahout (HDP 2.2 or later)            |
            +-------------------+-----------------------+-----------------------------------+
            | MapReduce2        | HistoryServer            | mapred                            |
            +-------------------+-----------------------+-----------------------------------+
            | Oozie                | Oozie Server            | oozie                                |
            +-------------------+-----------------------+-----------------------------------+
            | PostgreSQL        | PostgreSQL             | postgres (Created as part of        |
            |                    |(with Ambari Server)    | installing the default PostgreSQL    |            
            |                    |                        | database with Ambari Server. If     |
            |                    |                        | you are not using    the Ambari        |
            |                    |                        | PostgreSQL database, this user is    |
            |                    |                        | not needed.)                        |
            +-------------------+-----------------------+-----------------------------------+
            | Ranger            | Ranger Admin,            |ranger (HDP 2.2 or later)            |
            |                    | Ranger Usersync        |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Ranger KMS        | Ranger KMS Server        | kms (HDP 2.3 or later)            |
            +-------------------+-----------------------+-----------------------------------+
            | Slider            | Slider clients        | slider                            |
            +-------------------+-----------------------+-----------------------------------+
            | SmartSense        | HST Server,            | <same as ambari agent>            |
            |                    | HST Agent,            |                                     |
            |                    | Activity Analyzer,    |                                    |
            |                    | Activity Explorer        |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Spark                | Livey Servers            | livy                                |
            +-------------------+-----------------------+-----------------------------------+
            | Spark                | Spark History Server    | spark (HDP 2.2 or later)            |
            +-------------------+-----------------------+-----------------------------------+
            | Sqoop                | Sqoop                    | sqoop                                |
            +-------------------+-----------------------+-----------------------------------+
            | Storm                | Masters (Nimbus,         | storm                                |
            |                    | DRPC Server,             |                                    |
            |                    | Storm REST API, Server|                                    |
            |                    | , Storm UI Server)     |                                    |
            |                    | Slaves (Supervisors,     |                                    |
            |                    | Logviewers)            |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Tez                | Tez clients            | tez                                |
            +-------------------+-----------------------+-----------------------------------+
            | WebHCat            | WebHCat Server        | hcat                                |
            +-------------------+-----------------------+-----------------------------------+
            | YARN                | NodeManager            | yarn                                |
            |                    | ResourceManager        |                                    |
            +-------------------+-----------------------+-----------------------------------+
            | Zeppelin Notebook    | Zeppelin Notebook        | zeppelin                            |
            +-------------------+-----------------------+-----------------------------------+
            | ZooKeeper            | ZooKeeper                | zookeeper                            |
            +-------------------+-----------------------+-----------------------------------+
    
        对于所有的组件来说,Smoke Test 用户为集群服务执行 smoke tests 作为安装过程的一部分。也可以在  Ambari Web UI 上按需执行。
        smoke test 的默认帐号为 ambari-qa
    
                                
                                Service Groups
            +===============+=======================+===============+
            | Service        | Components            | Default Group    |
            +---------------+-----------------------+---------------+
            | All            | All                    | hadoop        |
            +---------------+-----------------------+---------------+
            | Atlas            | Atlas Metadata Server    | atlas            |
            +---------------+-----------------------+---------------+
            | Knox            | Knox Gateway            | knox            |
            +---------------+-----------------------+---------------+
            | Ranger        | Ranger Admin,            | ranger        |
            |                | Ranger Usersync        |                |
            +---------------+-----------------------+---------------+
            | Ranger KMS    | Ranger KMS Server        | kms            |
            +---------------+-----------------------+---------------+
            | Spark            | Spark History Server    | spark            |
            +---------------+---------------------------------------+

    
    
    
    ■ 设置集群和浏览器主机上开机启动 NTP 服务 (Enable NTP on the Cluster and on the Browser Host)
    -------------------------------------------------------------------------------------------------------------------------------------
    集群上所有节点和运行浏览器访问 Ambari Web 接口的主机上的时钟必须彼此同步。在每部主机上安装 NTP 服务并确保其开机启动:
    
    RHEL/CentOS/Oracle 7 :
                            yum install -y ntp
                            systemctl enable ntpd

    Ubuntu :
            apt-get install ntp
            update-rc.d ntp defaults
    
    
    
    ■ 检查 DNS 和 NSCD (Check DNS and NSCD)
    -------------------------------------------------------------------------------------------------------------------------------------    
    系统上所有主机必须配置正向和反向 DNS .
    
    如果不能配置 DNS, 可以在集群的每部主机上编辑 /etc/hosts 文件包含集群每部主机的 IP 地址和全限定域名 (Fully Qualified Domain Name, FQDN)
    
    Hadoop 很大程度上依赖于 DNS, 正常操作中执行很多 DNS 查询。为了降低 DNS 负载,强烈建议在运行Lunix 的集群节点使用名称服务缓存守护进程(
    Name Service Caching Daemon, NSCD). 这个 daemon 会缓存 host, user, and group lookups, 提供更好的解析性能,并降低 DNS 负载。
    
        
        ● 编辑 /etc/hosts 文件(Edit the Host File)
        ---------------------------------------------------------------------------------------------------------------------------------
            ① vi /etc/hosts
            
            ② 为集群的每部主机添加一行,每行中包括 IP 地址和 FQDN:
                
                格式:IP <fully.qualified.domain.name>
                
                范例:192.168.1.103 namenode.sansovo.org
                
                ★ 重要提示:不要删除或改动 hosts 文件中下面两行,否则可能会导致各种需要网络的程序错误。
                    
                    127.0.0.1 localhost.localdomain localhost
                    ::1 localhost6.localdomain6 localhost6
                
        
        ● 设置主机名 (Set the Hostname)
        ---------------------------------------------------------------------------------------------------------------------------------
            ① 确认主机设置正确,执行:
                
                hostname -f
        
            ② 使用 "hostname" 命令设置主机名,执行:
            
                hostname <fully.qualified.domain.name>
                
        
        ● 编辑网络配置文件 (Edit the Network Configuration File)
        ---------------------------------------------------------------------------------------------------------------------------------
            ① vi /etc/sysconfig/network
        
            ② 修改 HOSTNAME 属性为 FQDN
    
    
        ● 启用 NSCD 服务
        ---------------------------------------------------------------------------------------------------------------------------------
        [root@ambari ~]# yum install -y nscd
        [root@ambari ~]# systemctl enable nscd
        [root@ambari ~]# systemctl start nscd

        配置文件:  vi /etc/nscd.conf
        查看:
        [root@ambari ~]# nscd -g

        
    ■ 配置防火墙 (Configuring iptables)
    -------------------------------------------------------------------------------------------------------------------------------------    
    Ambari 在设置主机部署和管理时需要和集群每部主机通信,要求某些端口必须打开并可用。最简单的方法是临时禁用防火墙:
    
    RHEL/CentOS/Oracle Linux 7 : systemctl disable firewalld
                                 service firewalld stop
    
    
                        Default Network Port Numbers - Ambari
        +===============+===================+=======================+===========+===================================================+
        | Service        | Servers            | Default Port            | Protocol    | Description                                        |
        +---------------+-------------------+-----------------------+-----------+---------------------------------------------------+
        | Ambari Server    | Ambari Server     | 8080                    | http        | Interface to Ambari Web and Ambari REST API        |
        +---------------+-------------------+-----------------------+-----------+---------------------------------------------------+
        | Ambari Server    | Ambari Server     | 8440                    | https        | Handshake Port for Ambari Agents to Ambari Server    |
        +---------------+-------------------+-----------------------+-----------+---------------------------------------------------+
        | Ambari Server    | Ambari Server     | 8441                    | https        | Registration and Heartbeat Port for Ambari Agents    |
        |                |                    |                        |            | to Ambari Server                                    |
        +---------------+-------------------+-----------------------+-----------+---------------------------------------------------+
        | Ambari Agent    | All hosts running    | 8670                    | tcp        | Ping port used for alerts to check the health of    |
        |                | Ambari Agents        | You can change the    |            | the Ambari Agent                                    |
        |                |                    | Ambari Agent ping port|            |                                                    |
        |                |                    | in the Ambari    Agent    |            |                                                    |
        |                |                    | configuration            |            |                                                    |
        +---------------+-------------------+-----------------------+-----------+---------------------------------------------------+


    
    ■ 禁用 SELinux 和 PackageKit 并检查 umask (Disable SELinux and PackageKit and check the umask Value)
    -------------------------------------------------------------------------------------------------------------------------------------
    ① Ambari 设置成功必须禁用 SELinux, 每部主机上执行:
        
        setenforce 0
        
        Note:
            要永久禁用 SELinux, 在 /etc/selinux/config 配置文件中设置 SELINUX=disabled, 这样保证机器重启时 SELinux 处于禁用状态。
    
    ② 如果 RHEL/CentOS 上安装了 PackageKit, 打开 /etc/yum/pluginconf.d/refresh-packagekit.conf, 设置:
        
        enabled=0
        
    ③ UMASK (User Mask or User file creation MASK) 为 Linux 机器上创建新文件或新文件夹设置默认权限或基本权限。很多 Linux 发布包将 UMASK
        默认设置为 022, umask 值为 022 授予新建的文件和文件夹具有读、写、执行的 755 权限。umask 值为 027 授予新建的文件和文件夹具有读、写、
        执行的 750 权限。
        
        Ambari, HDP, 和 HDF 支持 umask 值为 022 (0022 功能上相同), 027 (0027 功能上相同)。这些值必须在每部主机上设置。
        
        范例:
            设置当前登录会话的 umask
                umask 0022
                
            检查当前 umask
                umask
                
            修改所有用户 umask 设置
                echo umask 0022 >> /etc/profile


    ■ 下载和设置数据库连接器 (Download and set up database connectors)
    -------------------------------------------------------------------------------------------------------------------------------------
    像 Hive, Ranger, and Oozie 组件要求操作数据库。在安装过程中,可以选择使用现有数据库或对于 Hive 的情况,让 Ambari 安装一个新的实例,
    为了让 Ambari 连接到自己选择的数据库,需要在安装组件之前下载必要的数据库驱动和连接器,设置好连接数据库环境。


*
*
*

2. 使用本地库 ( Using a Local Repository )
-----------------------------------------------------------------------------------------------------------------------------------------
如果集群外网 internet 访问受限,应考虑使用本地仓库,可以拥有更多的控制并获得更好的安装性能。也可以使用本地仓库执行集群安装后的例行操作,
例如,启动和重启服务。使用本地仓库包括获取公共仓库(public repositories), 在无 internet 访问或有限 internet 环境设置仓库,并准备 Ambari
仓库配置文件来使用新的本地仓库。

步骤:
    (1) 获取公共仓库 (Obtain Public Repositories)
    (2) 设置本地仓库 (Set up a local repository)
        • 无 Internet 访问设置本地仓库 (Setting Up a Local Repository with No Internet Access)
        • 临时 Internet 访问设置本地仓库 (Setting up a Local Repository with Temporary Internet Access)
    (3) 准备 Ambari 仓库配置文件使用本地仓库 (Preparing the Ambari Repository Configuration File to Use the Local Repository)


2.1 设置本地仓库 ( Setting Up a Local Repository )
-----------------------------------------------------------------------------------------------------------------------------------------



    ■ 准备设置本地仓库 (Preparing to Set Up a Local Repository)
    -------------------------------------------------------------------------------------------------------------------------------------
    在设置本地仓库之前,必须满足一定的要求:
        
        ● 选择一个现有的机器作为镜像服务器(mirror server), 可以在集群内或者可以访问集群。
        ● 保证集群所有的主机可以访问到镜像服务器。
        ● 确保镜像服务器安装了包管理器,如, yum (for RHEL,CentOS, or Oracle Linux), zypper (for SLES), or apt-get (for Debian and Ubuntu).
        ● 可选的:如果仓库临时可以 Internet 访问,并且使用 RHEL, CentOS, 或 Oracle Linux 作为操作系统,安装 yum 工具:
            
            yum install yum-utils createrepo

    满足上述要求之后,可以按如下步骤准备设置本地仓库。
    
    步骤:
        ① 创建 HTTP 服务器:
            a. 在镜像服务器上安装 HTTP server, 例如, Apache httpd
            b. 启动服务器
            c. 确保防火墙设置允许集群节点到镜像服务器的 HTTP 入站访问
        
        ② 在镜像服务器上,为 web server 创建目录:
            
            RHEL/CentOS/Oracle Linux: mkdir -p /var/www/html/
            Debian/Ubuntu: mkdir -p /var/www/html/
        
            如果使用符号链接,web server 上 enable followsymlinks
 


    ■ 通过临时 Internet 访问设置本地仓库 (Setting up a Local Repository with Temporary Internet Access)
    -------------------------------------------------------------------------------------------------------------------------------------
    步骤:
    
        ① 在主机上为 Ambari 和安装栈安装仓库配置文件
        
            [root@ambari ~]# wget -P /etc/yum.repos.d/ http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari.repo
            [root@ambari centos7]# wget -P /etc/yum.repos.d/ http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/hdp.repo    
            
            http://public-repo-1.hortonworks.com/HDP-SOLR-3.0.0-100/repos/centos7/hdp-solr.repo
            
        ② 确认仓库可用
        
            RHEL, CentOS, or Oracle Linux: yum repolist
            
        ③ 同步仓库内容到镜像服务器
            
            ● 进入 web server 目录:
                
                RHEL, CentOS, or Oracle: cd /var/www/html
            
            ● 为 Ambari 创建 ambari 目录并执行仓库同步(reposync):
                
                mkdir -p ambari/<OS>
                cd ambari/<OS>
                reposync -r ambari-2.6.1.5
                
            上面语法中:<OS> is centos6, centos7, sles11, sles12, ubuntu14, ubuntu16, or debian7.
                
            范例:
                [root@ambari html]# mkdir -p ambari/centos7
                [root@ambari html]# cd ambari/centos7
                [root@ambari centos7]# reposync -r ambari-2.6.1.5

            ● 对于 Hortonworks Data Platform (HDP) stack 仓库,创建 hdp 目录并执行仓库同步
                mkdir -p hdp/<OS>
                cd hdp/<OS>
                reposync -r HDP-<latest.version>
                reposync -r HDP-UTILS-<version>
                
                mkdir -p hdp-gpl/<OS>
                cd hdp-gpl/<OS>
                reposync -r HDP-GPL-<latest.version>
                
            范例:
                [root@ambari centos7]# mkdir -p hdp/centos7
                [root@ambari centos7]# cd hdp/centos7
                [root@ambari centos7]# reposync -r HDP-2.6.4.0
                [root@ambari centos7]# reposync -r HDP-UTILS-1.1.0.22
                
                [root@ambari centos7]# mkdir -p hdp-gpl/centos7
                [root@ambari centos7]# cd hdp-gpl/centos7
                [root@ambari centos7]# reposync -r HDP-GPL-2.6.4.0
                
                
            ● 对于 HDF Stack 仓库, 创建 hdf 目录并执行仓库同步
                mkdir -p hdf/<OS>
                cd hdf/<OS>
                reposync -r HDF-<latest.version>
                
            范例:
                [root@ambari html]# mkdir -p hdf/centos7
                [root@ambari html]# cd hdf/centos7/
                

        ④ 生成仓库元数据:
            
            Ambari:    createrepo <web.server.directory>/ambari/<OS>/ambari-2.6.1.5
            HDP Stack Repositories: createrepo <web.server.directory>/hdp/<OS>/HDP-<latest.version>
                                    createrepo <web.server.directory>/hdp/<OS>/HDP-UTILS-<version>
                                    createrepo <web.server.directory>/hdp-gpl/<OS>/HDP-GPL-<latest.version>
            HDF Stack Repositories: createrepo <web.server.directory>/hdf/<OS>/HDF-<latest.version>
            
            范例:
                [root@ambari centos7]# createrepo /var/www/html/ambari/centos7/ambari-2.6.1.5
                [root@ambari centos7]# createrepo /var/www/html/hdp/centos7/HDP-2.6.4.0
                [root@ambari centos7]# createrepo /var/www/html/hdp/centos7/HDP-UTILS-1.1.0.22
                [root@ambari centos7]# createrepo /var/www/html/hdp-gpl/centos7/HDP-GPL-2.6.4.0
        
        ⑤ 确认可以通过浏览器看到新创建的仓库:
            
            Ambari Base URL        http://<web.server>/ambari/<OS>/Updates-Ambari-2.6.1.5
            HDP Base URL         http://<web.server>/hdp/<OS>/HDP-<latest.version>
            HDP-UTILS Base         URL http://<web.server>/hdp/<OS>/HDP-UTILS-<version>
            HDP-UTILS Base         URL http://<web.server>/hdp-gpl/<OS>/HDP-GPL-<latest.version>
            HDF Base URL         http://<web.server>/hdf/<OS>/HDF-<latest.version>
            
            <web.server>     - web server 主机的 FQDN
            <version>         – The Hortonworks stack 版本号
            <OS>             – centos6, centos7, sles11, sles12, ubuntu14, ubuntu16, or debian7
        
        范例:    
            http://ambari.sansovo.org/ambari/centos7/ambari-2.6.1.5/
            http://ambari.sansovo.org/hdp/centos7/HDP-2.6.4.0/
            http://ambari.sansovo.org/hdp/centos7/HDP-UTILS-1.1.0.22/
            http://ambari.sansovo.org/hdp-gpl/centos7/HDP-GPL-2.6.4.0
            
        提示:
            记录这些 base url, 安装 Ambari 和集群时需要这些 url
            
        
        ⑥ 可选的。如果环境中配置了多个仓库,集群的所有节点部署如下插件:
            a. 安装插件:
            
                RHEL and CentOS 7: yum install yum-plugin-priorities
                
            b. 编辑 /etc/yum/pluginconf.d/priorities.conf 文件添加如下内容:
            
                [main]
                enabled=1
                gpgcheck=0
        
    
    ■ 无 Internet 访问设置本地仓库 (Setting Up a Local Repository with No Internet Access)
    -------------------------------------------------------------------------------------------------------------------------------------    
    步骤:
        
        ① 获取仓库 tarball
            http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz
            http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/HDP-2.6.4.0-centos7-rpm.tar.gz
            http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
        
        ② 拷贝 仓库 tarball 文件到 web server 目录并解包(untar) 存档文件
    
            a. 进入 web server 目录:
                
                RHEL, CentOS, or Oracle: cd /var/www/html
    
            b. untar 仓库 tarball 文件到相应位置
            
                Ambari 仓库 Untar 到 <web.server.directory> 之下.    
                HDP Stack 仓库:创建 <web.server.directory>/hdp 目录并 untar 到该目录之下.
                HDF Stack 仓库:创建 <web.server.direcotry>/hdf 目录并 untar 到该目录之下.
    
        ③ 确认可以通过浏览器看到新创建的仓库:
            
            Ambari Base URL        http://<web.server>/ambari-2.6.1.5/<OS>
            HDP Base URL         http://<web.server>/hdp/HDP/<OS>/2.x/updates/<latest.version>
            HDP-UTILS Base URL     http://<web.server>/hdp/HDP-UTILS-<version>/repos/<OS>
            HDF Base URL         http://<web.server>/hdf/HDF/<OS>/3.x/updates/<latest.version>
            
            <web.server>     - web server 主机的 FQDN
            <version>         – The Hortonworks stack 版本号
            <OS>             – centos6, centos7, sles11, sles12, ubuntu14, ubuntu16, or debian7
        
        范例:    
            http://ambari.sansovo.org/ambari-2.6.1.5/centos7/
            http://ambari.sansovo.org/hdp/HDP/centos7/2.x/updates/2.6.4.0/
            http://ambari.sansovo.org/hdp/HDP-UTILS-1.1.0.22/repos/centos7/

        提示:
            记录这些 base url, 安装 Ambari 和集群时需要这些 url
    
    
        ④ 可选的。如果环境中配置了多个仓库,集群的所有节点部署如下插件:
            a. 安装插件:
            
                RHEL and CentOS 7: yum install yum-plugin-priorities
                
            b. 编辑 /etc/yum/pluginconf.d/priorities.conf 文件添加如下内容:
            
                [main]
                enabled=1
                gpgcheck=0
                
                
2.2 准备 Ambari 仓库配置文件使用本地仓库 (Preparing the Ambari Repository Configuration File to Use the Local Repository)
-----------------------------------------------------------------------------------------------------------------------------------------    
步骤:
        
    ① 从公共仓库下载 ambari.repo 文件
        
        http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari.repo
    
    ② 编辑 ambari.repo 文件替换 Ambari Base URL baseurl 为本地仓库
        
        #VERSION_NUMBER=2.6.1.5-3
        [ambari-2.6.1.5]
        name=ambari Version - ambari-2.6.1.5
        baseurl=http://ambari.sansovo.org/ambari/centos7/ambari-2.6.1.5
        gpgcheck=0
        gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
        enabled=1
        priority=1

    Note:
         可以通过设置 gpgcheck =0 来禁用 GPG 检验。或者保持检验启用,将 gpgkey 设置为一个本地仓库的 GPG-KEY
    
    
    ③ 将 ambari.repo 文件放置到 Ambari server 主机上
    
        RHEL/CentOS/Oracle Linux:     /etc/yum.repos.d/ambari.repo


*
*
*

3. 获取公共仓库 (Obtaining Public Repositories)
-----------------------------------------------------------------------------------------------------------------------------------------


3.1 Ambari 仓库 (Ambari Repositories)
-----------------------------------------------------------------------------------------------------------------------------------------
如果 Ambari server 不能访问 internet,下载 tarball 存档文件,其内部包含安装 Ambari 的软件。
如果 Ambari server 可以临时访问 internet, 则使用仓库文件来安装 Ambari。


    RedHat 7, CentOS 7, Oracle Linux 7 :
    -------------------------------------------------------------------------------------------------------------------------------------
    Base URL    - http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5
    Repo File    - http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari.repo
    Tarball        - http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz



3.2 HDP Stack 仓库(HDP Stack Repositories)
-----------------------------------------------------------------------------------------------------------------------------------------


RedHat 7, CentOS 7, Oracle Linux 7 : HDP-2.6.4.0
-----------------------------------------------------------------------------------------------------------------------------------------
HDP:
    Version Definition File(VDF)- http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/HDP-2.6.4.0-91.xml
    Base URL                    - http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0
    Repo File                    - http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/hdp.repo
    Tarball                        - 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:
    Base URL                    - http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7
    Tarball                        - 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:
    URL                            - http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/hdp.gpl.repo
    Tarball                     - 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    
*
*
*

4. 安装 Ambari (Installing Ambari)
-----------------------------------------------------------------------------------------------------------------------------------------


4.1 下载 Ambari 仓库 (Download the Ambari Repository)
-----------------------------------------------------------------------------------------------------------------------------------------
在可以访问 internet 的主机上执行如下命令

步骤:    
    ① root 帐户登录主机
    
    ② 下载 Ambari 仓库文件到 yum 仓库目录
    
        wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari.repo -O /etc/yum.repos.d/ambari.repo
        
        不要修改 ambari.repo 文件名
        
    ③ 检查 repo 列表确认配置正确
    
        yum repolist
        
    
4.2 安装 Ambari Server (Install the Ambari Server)
-----------------------------------------------------------------------------------------------------------------------------------------

步骤:
    ① 安装 ambari-server, 也会安装默认的 PostgreSQL Ambari database
    
        yum install ambari-server
        
    ② 提示确认和依赖检查,输入 y
    

    
4.3 设置 Ambari Server (Set Up the Ambari Server)
-----------------------------------------------------------------------------------------------------------------------------------------
启动 Ambari Server 之前,必须设置 Ambari Server. 设置过程配置 Ambari 和 Ambari 数据库对话,安装 JDK 并允许自定义运行 Ambari Server daemon
的用户帐号。

运行下面指令启动设置进程,也可以在此命令后追加设置选项:
    
    ambari-server setup
    
设置提示响应:
    ① 如果没有临时禁用 SELinux, 会得到警告,接受默认值 (y), 继续
    ② 默认情况,Ambari Server 运行于 root 帐户。接受默认值 (n) 继续以 root 帐户运行。使用自定义帐户,选择 y
    ③ 如果没有禁用防火墙提示警告,输入 y 继续
    ④ 选择 JDK 版本下载。输入 1 下载 Oracle JDK 1.8 。另一种选择是输入自定义 JDK. 如果选择自定义 JDK, 需要手动安装 JDK 到所有主机上并设置
        Java Home 路径
        
    ⑤ 接受 Oracle JDK license, JDK 在部署阶段安装。
    ⑥ 查看 GPL license agreement. 为了明确 Ambari 下载并安装 LZO 数据压缩库文件,必须回答 y
    ⑦ Enter advanced database configuration [y/n] (n)? 出现时选择 n 使用默认的数据库配置,嵌入的 PostgreSQL. 默认的数据库名称为 ambari. 默认的用户名
        和密码为 ambari/bigdata . 否则,使用现有的 PostgreSQL, MySQL/MariaDB or Oracle 数据库,选择 y
        
    ⑧ 设置完成。
    
    
设置命令选项:

    下列选项经常用于 Ambari Server 设置命令
    
    -j(or --java-home)    : Specifies the JAVA_HOME path to use on the Ambari Server and all hosts in the cluster. By default when you do not
                        specify this option, Ambari Server setup downloads the Oracle JDK 1.8 binary and accompanying Java Cryptography
                        Extension (JCE) Policy Files to /var/lib/ambari-server/resources. Ambari Server then installs the JDK to /usr/jdk64.
                        Use this option when you plan to use a JDK other than the default Oracle JDK 1.8. If you are using an alternate JDK,
                        you must manually install the JDK on all hosts and specify the Java Home path during Ambari Server setup.
                        
                        If you plan to use Kerberos, you must also install the JCE on all hosts. This path must be valid on all hosts.
                        For example:
                            ambari-server setup –j /usr/java/default
        
    
    --jdbc-driver        : Should be the path to the JDBC driver JAR file. Use this option to specify the location of the JDBC driver JAR and
                        to make that JAR available to Ambari Server for distribution to cluster hosts during configuration.
                        Use this option with the --jdbc-db option to specify the database type.
        
    --jdbc-db            : Specifies the database type. Valid values are: [postgres | mysql | oracle] Use this option with the --jdbc-driver
                        option to specify the location of the JDBC driver JAR file.    
        
    -s (or --silent)    : Setup runs silently. Accepts all the default prompt values, such as:
                            • User account "root" for the ambari-server
                            • Oracle 1.8 JDK (which is installed at /usr/jdk64). This can be overridden by adding the -j option and specifying
                            an existing JDK path.
                            • Embedded PostgreSQL for Ambari DB (with database name "ambari")    
    
    --enable-lzo-under-gpl-license    : Use this option to download and install LZO compression, subject to the General Public License.
    
    -v (or --verbose)    : Prints verbose info and warning messages to the console during Setup.
    
    -g (or --debug)     : Prints debug info to the console during Setup.
    
    
    
    
*
*
*

5. 使用管理包 (Working with Management Packs)
-----------------------------------------------------------------------------------------------------------------------------------------
管理包允许部署一系列服务到 Ambari-managed 的集群上。可以使用管理包部署一个特定的组件或服务,或者部署整个平台。

一般情况下,使用管理包工作,按序执行下列任务:

    (1) 安装管理包
    (2) 在 Ambari 中更新仓库 URL
    (3) 启动 Ambari Server
    (4) 运行 Ambari 安装向导




*
*
*

6. 安装、配置、部署集群 (Installing, Configuring, and Deploying a Cluster)
-----------------------------------------------------------------------------------------------------------------------------------------
使用运行于浏览器的 Ambari 集群安装向导安装、配置、部署集群,如下所示:

    ● 启动 Ambari Server
    ● 登录 Ambari
    ● 启动 Ambari 集群安装向导
    ● 命名集群
    ● 选择版本
    ● 安装选项
    ● 确认主机
    ● 选择服务
    ● 分配 masters
    ● 分配 slaves 和 clients
    ● 自定义服务
    ● 回顾配置(Review)
    ● 安装,启动,测试
    ● 完成


6.1 启动 Ambari Server (Start the Ambari Server)
-----------------------------------------------------------------------------------------------------------------------------------------

    ● 运行如下命令启动 Ambari Server
        
        ambari-server start
        
    ● 检查 Ambari Server 进程状态
        
        ambari-server status
        
    ● 停止 Ambari Server
    
        ambari-server stop
        
    Note:
        如果计划为 Hive 或 Oozie 使用已有的数据库实例,必须在安装 Hadoop 集群之前准备使用现有数据库。

    
    启动 Ambari Server 时,Ambari 运行数据库一致性检查查看是否有问题。如果发现任何问题,Ambari Server 退出启动,并显示如下信息:
    
        DB configs consistency check failed.
    
    Ambari 将数据库检查结果有关细节写入 the/var/log/ambari-server/ambari-server-checkdatabase.log 文件。
    
    可以强制 Ambari Server 启动时跳过一致性检查:
    
        ambari-server start --skip-database-check
        
    如果数据库有问题,选择跳过检查,不要对集群拓扑做任何改变,或者执行集群升级,直到改正数据库一致性问题。


6.2 登录 Ambari (Log In to Apache Ambari)
-----------------------------------------------------------------------------------------------------------------------------------------

步骤:
    ① web browser 指向:
        
        http://<your.ambari.server>:8080

    ② 使用默认的用户名/密码:admin/admin 登录 Ambari Server。对于新的集群,集群安装向导会显示一个欢迎页



6.3 启动 Ambari 集群安装向导 (Launch the Ambari Cluster Install Wizard)
-----------------------------------------------------------------------------------------------------------------------------------------
在 Ambari 欢迎页,选择 Launch Install Wizard



6.4 命名集群 (Name Your Cluster)
-----------------------------------------------------------------------------------------------------------------------------------------
步骤:
    ① 在 Name your cluster, 输入要创建的集群名称:不要在名称里使用空格或特殊字符
    ② 选择 Next
    
    
6.5 选择版本 (Select Version)
-----------------------------------------------------------------------------------------------------------------------------------------
这一步,要选择软件版本和集群软件传递方法。使用公共仓库要求有 internet 连接,使用本地仓库要求本地仓库配置的相关软件在本地网络可用。
    

    
6.5.1 选择安装栈(Choosing Stack)
-----------------------------------------------------------------------------------------------------------------------------------------    
    可用版本展示在选项卡上。选择一个选项卡, Ambari 尝试找到选定版本的可用安装栈,以下拉列表的形式显示结果。选择一个安装栈版本,可用的服务
    及其对应的版本号显示在表格中。
        
    
    ● 选择版本(Choosing Version)
    -------------------------------------------------------------------------------------------------------------------------------------
    如果 Ambari 可以访问 internet, 选定安装栈的版本以下拉列表形式展示。如果有一个版本定义文件(Version Definition File)没有列出来,可以单击
    Add Version... 并上传 VDF 文件。选项 Default Version Definition 也包含在列表中,如果不能访问internet 或不确定安装哪个版本,可选择此项。
    
    
    
    ● 选择仓库(Choosing Repositories)
    -------------------------------------------------------------------------------------------------------------------------------------    
    Ambari 安装软件可以选择从公共仓库安装或从本地仓库安装。不管哪种选择,都可以编辑仓库的 Base URL. 支持的操作系统也显示在列表中,可以在
    列表上添加/删除操作系统来满足自己的环境。
    
    
    Next
    
    
    
6.5.2 安装选项 (Install Options)
-----------------------------------------------------------------------------------------------------------------------------------------    
为了构建集群,集群安装向导提示设置一些总体信息。需要提供每部主机的完全限定域名(FQDN). 需要访问创建无密码 SSH 登录的私钥文件。有了主机名和
密钥信息,向导就可以定位、访问集群的所有主机并与它们进行安全交互。

步骤:
    ① 在 Target Hosts 中,输入主机名列表,一行一个
        可以在中括号中指定一个范围来指定比较大型的主机集,如指定从 host01.domain 到 host10.domain 的所有主机名,使用 host[01-10].domain
    
    ② 如果让 Ambari 使用 SSH 自动安装 Ambari Agent 到所有主机上,选择 Provide your SSH Private Key, 然后或者使用 Choose File 按钮选择之前
        安装在所有主机上的公钥匹配的私钥文件,或者手动复制私钥粘贴到文本框内。
    
    ③ 输入选择的 SSH key 用户名。如果不使用 root 帐号,必须提供可以不需要提供密码执行 sudo 命令的帐号用户名。如果主机环境配置的 SSH 使用
        非默认的 22 端口,也在这里修改。
        
    ④ 如果不要 Ambari 自动安装 Ambari Agents, 选择 Perform manual registration
    
    ⑤ 选择 Register and Confirm 继续
    
    
    
6.5.3 确认主机 (Confirm Hosts)
-----------------------------------------------------------------------------------------------------------------------------------------    
确认主机指示确认 Ambari 已为集群定位到正确的主机并检查这些机器它们有正确的目录,包,以及可以继续安装要求的进程。如果任何主机遇到错误,可以
通过选择选项框并单击灰色的 Remove Selected 按钮删除主机。删除单个主机,在 Action 列单击小的白色 Remove 按钮。
    
在界面底部,可以注意到黄色文本框指出一些检查过程中遇到的 warning 信息。

    
可能遇到确认失败错误

查看日志文件:
-----------------------------------------------------------------------------------------------------------------------------------------
[root@worker-1 ~]# cat /var/log/ambari-agent/ambari-agent.log    

......

ERROR 2018-05-04 14:05:48,667 main.py:244 - Ambari agent machine hostname (worker-1.sansovo.org.1.168.192.in-addr.arpa) does not match
expected ambari server hostname (worker-1.sansovo.org). Aborting registration. Please check hostname, hostname -f and /etc/hosts file to
confirm your hostname is setup correctly

.....

原因:可能 DNS 未设置 IPv6 地址所致

解决方法:
-----------------------------------------------------------------------------------------------------------------------------------------
[root@worker-1 ~]# vi /etc/hosts    
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         worker-1.sansovo.org localhost localhost.localdomain localhost6 localhost6.localdomain6

    
主机确认成功之后

    Next
    
    
6.5.4 选择服务 (Choose Services)
-----------------------------------------------------------------------------------------------------------------------------------------    
根据在 Select Stack 步骤的选择,会显示可供选择的各种服务以安装到集群上。安装栈包含很多服务,可以现在选择要安装的任何服务,也可以后增加服务。
默认情况下,集群安装向导选择所有可用的服务进行安装。

从 Ambari 2.5 开始, SmartSense 部署是强制的。不能使用安装向导清除安装 SmartSense 选项。

    Next

    
6.5.5 分配主控服务 (Assign Masters)
-----------------------------------------------------------------------------------------------------------------------------------------    
集群安装向导为已选定的服务主控组件(master component)分配集群中合适的主机。左边的列显示服务和当前主机,邮编的列显示主机分配的主控组件,指明
CPU 线程数量和每部主机内存数量。

    ① 改变某个服务的主机分配,从下拉菜单中选择另一部主机。
    
    ② 要移除一个 ZooKeeper 实例,单击主机地址旁边绿色图标 (green - icon)
    
    ③ 分配满意后, 选择 Next
    


6.5.6 分配辅助组件和客户端 (Assign Slaves and Clients)
-----------------------------------------------------------------------------------------------------------------------------------------
集群安装向导分配辅助组件,例如 DataNodes, NodeManagers, 以及 RegionServers, 分配到集群的合适主机上。也会尝试选择主机来安装适当的客户端集

步骤:
    ① 使用 all 或 none 来选择某一列的所有主机或清空该列所有主机。如果主机名之后有一个星号 * , 表明这个主机运行一个或多个 master 组件。
        
    ② 使用选项框微调主机选项
    
    ③ 分配满意后,选择 Next
    
    

6.5.7 自定义服务 (Customize Services)
-----------------------------------------------------------------------------------------------------------------------------------------
自定义服务这一步表现为一组选项卡来查看和修改集群设置。集群安装向导尝试为每个选项设置有意义的默认值。当有不同需求时,强烈建议查看这些设置值

可以浏览每个服务选项卡。显示的服务选项卡数量取决于决定在集群上安装多少服务。任何要求输入值的选项卡显示为一个红色标记和一个数值属性需要引以
注意。选择带有红色标记的选项卡并输入适当的信息。


    ● 目录(Directories)
    -------------------------------------------------------------------------------------------------------------------------------------
    选择目录来存储信息至关重要。 Ambari 基于当前环境可用的挂载点选择有意义的默认值,但要仔细查看 Ambari 建议的默认目录设置。特别是,确认
    /tmp 和 /var 不要用于 HDFS 的 NameNode 目录和 DataNode 目录。
    
    
    ● 密码(Passwords)
    -------------------------------------------------------------------------------------------------------------------------------------
    必须提供服务的数据库密码:Hive 和 Oozie 服务, Master Secret for Knox, Grafana 数据库 password 。以 Hive 为例,选择 Hive 选项卡并展开
    Advanced 部分。数据库密码字段标记为红色,输入密码,在确认框再输入一遍,确认两次输入一致。


    ● 服务帐号和组(Service Account Users and Groups)
    -------------------------------------------------------------------------------------------------------------------------------------
    服务帐号和组在 Misc 选项卡。这些是服务组件运行使用的操作系统帐号。如果主机上不存在这些用户帐号, Ambari 会在机器上自动创建本地帐号和组。
    如果帐号已经存在, Ambari 会使用这些以存在帐号。
    
    取决于现有环境是如何配置的,可能不允许使用 groupmod 或 usermod 操作。如果是这种情况,必须确保所有的用户和组都已经创建好了,并确保在Misc
    选项卡中选择 Skip group modifications 选项。这样告知 Ambari 不要为服务帐号修改组成员。
    
    
完成自定义设置之后,选择 Next



6.5.8 信息回顾 (Review)
-----------------------------------------------------------------------------------------------------------------------------------------
Review 显示之前所做的分配工作。检查确认每项配置都正确了。如果需要改动设置,利用左侧的导航条返回到适当的步骤进行设置。

选择 Print 可以打印信息用于以后参考。

所有配置满意之后,选择 Deploy.



6.5.9 安装、启动及测试 (Install, Start and Test)
-----------------------------------------------------------------------------------------------------------------------------------------
安装过程显示在屏幕上。 Ambari 安装,启动每个组件,并在组件上运行一个简单的测试。总体过程的状态显示在顶部的进度条上,每部主机的状态显示在
主窗口部分。安装过程中不要刷新浏览器。刷新可能中断进度指示器。

查看每部主机任务完成的特定信息,单击 Message 列的主机链接。在弹出的 Task 菜单上单击要查看的任务相关日志文件。可以通过 Show 下拉列表选择
过滤条件。要查看更大版本的日志内容,单击 Open 或单击 Copy 复制内容到剪切板。

当出现 Successfully installed and started the services 时,选择 Next




6.5.10 完成 (Complete)
-----------------------------------------------------------------------------------------------------------------------------------------
Summary 页提供了一个完成任务的摘要列表,选择 Complete

浏览器打开 Ambari Web:

http://<your.ambari.server>:8080





安装过程遇到的错误:
-----------------------------------------------------------------------------------------------------------------------------------------
    1. zookeeper 安装失败:
    The 'zookeeper-client' component did not advertise a version. This may indicate a problem with the component packaging.

    先部署一个 zookeeper, 将 zookeeper 和 client 安装到同一部主机。安装好之后,再单独部署 zookeeper 为计划的数量。个别主机在部署 zookeeper
    时也可能会发生装不上的问题,换一台干净的主机安装试试。总之,zookeeper 比较敏感,部署时尽量保证系统干净。

猜你喜欢

转载自blog.csdn.net/devalone/article/details/80744436