HDP搭建

作者: Surveillant | 来源:发表于2021-12-29 15:31 被阅读0次

    基础环境配置

    a.修改主机名配置hosts

    systemctl stop firewalld
    hostnamectl set-hostname  ambari-server   #更改个主机名
    sed -i 's/SELINUX=enforcing/SELINUX=disable/g' /etc/selinux/config
    setenforce 0
    cat >>/etc/hosts<<EOF    #添加各个节点hosts解析
    172.20.2.222    ambari-server
    172.20.2.203      hadoop-1
    172.20.2.204      hadoop-2
    172.20.2.205      hadoop-3
    EOF
    

    配置ambaer-server免密登录其他节点

    a. 配置免密登录

    ssh-keygen -t rsa     #在ambari-server生成密钥对
    for num in `seq 1 3`;do ssh-copy-id -i /root/.ssh/id_rsa.pub root@bigdata${num};done
    

    b.在ambari-server安装数据库

    # 安装mariadb
    yum -y install mariadb-server mysql-connector-java
    systemctl start mariadb
    mysql -uroot password
    # 修改密码
    use mysql;
    UPDATE user SET password=PASSWORD('123456') WHERE user='root';
    FLUSH PRIVILEGES;
    # 允许其他用户连接
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    

    安装时间同步NTP工具

    a. 使用yum命令安装

    yum install -y ntp
    

    b. 检查ntp服务是否在启动时自动启动

    systemctl is-enabled ntpd
    

    c. 将 NTP 服务设置为启动时自动启动,请在每台主机上运行以下命令:

    systemctl enable ntpd
    

    d.每台服务器启动ntp

    systemctl start ntpd
    

    安装httpd服务器

    执行命令

    yum install httpd -y && systemctl start httpd
    

    ambari+hdp安装

    a.创建上传目录

    mkdir /opt/sotfware
    

    b.上传到目录下查看并解压

    [root@bigdata01 software]# ls
    ambari-2.7.5.0-centos7.tar.gz HDP-3.1.5.0-centos7-rpm.tar.gz   HDP-UTILS-1.1.0.22-centos7.tar.gz
    # 创建解压目录 
    mkdir -P /var/www/html/ambari
    mkdir -p  /var/www/html/hdp/{HDP,HDP-UTILS-1.1.0.22}
    # 解压
    tar -zvxf ambari-2.7.5.0-centos7.tar.gz -C /var/www/html/ambari
    tar -zvxf HDP-3.1.5.0-centos7-rpm.tar.gz -C  /var/www/html/hdp/HDP
    tar -zvxf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.22
    

    c.配置ambari的yum源

    cat >/etc/yum.repos.d/ambari.repo<<EOF
    #VERSION_NUMBER=2.7.5.0-72
    [Updates-ambari-2.7.5.0]
    name=ambari-2.7.5.0 - Updates
    baseurl=http://172.0.0.201/ambari/ambari/centos7/2.7.5.0-72/
    gpgcheck=1
    gpgkey=http://172.0.0.201/ambari/ambari/centos7/2.7.5.0-72/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
    enabled=1
    priority=1
    EOF
    

    d.配置hdp的yum源

    cat >/etc/yum.repos.d/hdp.repo<<EOF
    #VERSION_NUMBER=3.1.5.0-152
    [HDP-3.1.5.0]
    name=HDP Version - HDP-3.1.5.0
    baseurl=http://172.0.0.201/hdp/HDP/HDP/centos7/3.1.5.0-152
    gpgcheck=1
    gpgkey=http://172.0.0.201/hdp/HDP/HDP/centos7/3.1.5.0-152
    enabled=1
    priority=1
    
    [HDP-UTILS-1.1.0.22]
    name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
    baseurl=http://172.0.0.201/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22
    gpgcheck=1
    gpgkey=http://172.0.0.201/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22
    enabled=1
    priority=1
    EOF
    

    e.yum初始化

    yum clean all
    yum makecache
    

    f. 安装ambari

    # 安装
    yum -y install ambari-server
    
    # 进入数据库创建ambari库和导入数据
    mysql>create database ambari DEFAULT CHARSET utf8;
    mysql>use ambari
    mysql>source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
    

    g.配置ambari-server

    [root@bigdata01 2.7.5.0-72]# 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 [y/n] (y)? y
    Ambari-server daemon is configured to run under user 'ambari'. Change this setting [y/n] (n)? y
    Enter user account for ambari-server daemon (ambari):root
    Adjusting ambari-server permissions and ownership...
    Checking firewall status...
    Checking JDK...
    Do you want to change Oracle JDK [y/n] (n)? n
    Check JDK version for Ambari Server...
    JDK version found: 8
    Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
    Checking GPL software agreement...
    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 (3): 3
    Hostname (localhost): 172.0.0.201
    Port (3306): 3306
    Database name (ambari): ambari
    Username (root): root
    Enter Database Password (bigdata): 
    Re-enter password: 
    Configuring ambari database...
    Configuring remote database connection properties...
    WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell 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 repo file doesn't contain latest json url, skipping repoinfos modification
    Adjusting ambari-server permissions and ownership...
    Ambari Server 'setup' completed successfully.
    

    h. 启动ambari-server

    ambari-server start
    

    i. 浏览器访问ambari-server admin/admin

    相关文章

      网友评论

          本文标题:HDP搭建

          本文链接:https://www.haomeiwen.com/subject/vfkvqrtx.html