ambari 2.6.1.5安装

系统要求:
CentOS 7
Python 2.7.x
JDK1.8+
安装环境准备
HDP版本兼容性

https://supportmatrix.hortonworks.com/

运维知识库 > ambari安装 > image2018-9-29_11-7-33.png

由于严格依赖版本,所以要先确定安装的版本。

系统初始化
修改主机名
sudo hostnamectl set-hostname test-bg-xx
sudo hostname test-bg-xx

修改时区和字符集
#修改时区:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
同步集群时间
yum install –y ntp
ntpdate -u cn.pool.ntp.org
或:
ntpdate time1.aliyun.com
硬件时间和系统时间同步:
clock -w
配置自动同步:/etc/crontab写入
/1 * root ntpdate -u cn.pool.ntp.org >> /dev/null 2>&1

关闭防火墙和selinux
#关闭防火墙
systemctl stop firewalld
systemctl disable firewalld

#关闭selinux
修改配置
sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /etc/sysconfig/selinux
临时关闭
setenforce 0

配置免密钥登录
为了让Ambari服务器在所有集群主机上自动安装Ambari代理,您必须在Ambari服务器主机和集群中的所有其他主机之间设置无密码SSH连接。Ambari服务器主机使用SSH公钥认证来远程访问和安装Ambari代理
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
注意:您可以选择在每个集群主机上手动安装Ambari代理。在这种情况下,您不需要生成和分发SSH密钥
可以使用非root SSH帐户,如果该帐户可以执行sudo而不输入密码

#
#如果ssh端口不是默认,可以在.ssh下创建config文件如下
[[email protected] .ssh]$ cat config
Host test-bg-m01
HostName test-bg-m01
User jt_ops
Port 1876

Host test-bg-w01
HostName test-bg-w01
User jt_ops
Port 1876

系统初始化参数
cat >> /etc/sysctl.conf << EOF
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
vm.max_map_count = 262144
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
vm.swappiness = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.core.somaxconn = 16384
EOF

文件描述符和用户最大进程数
#调整文件描述符
cat >> /etc/security/limits.conf <<EOF

  • soft nproc 65535
  • hard nproc 65535
  • soft nofile 65535
  • hard nofile 65535
    EOF
    ##用户进程限制
    cat >> /etc/security/limits.d/20-nproc.conf <<EOF
  • soft nproc 8192
    root soft nproc unlimited
    EOF

安装
安装有两种方法:在线安装和搭建本地yum源仓库安装

在线安装
下载yum源配置文件repo


#如果做了免秘钥登陆,则只需要在主节点下载yum源
sudo 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

sudo wget –nv http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/hdp.repo -O /etc/yum.repos.d/hdp.rep

sudo wget -nv http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/hdp.gpl.repo -O /etc/yum.repos.d/hdp.gpl.repo

离线安装
 制作本地源
制作本地镜像源安装HDP,可以在主节点或者单独的一台服务器(建议)
选择一台可以访问internet的服务器配置本地源
apache httpd
提供离线仓库的下载服务
#安装apache
yum install httpd –y
#开启防火墙
firewall-cmd --add-service=http
firewall-cmd --permanent --add-service=http
#添加系统服务
systemctl start httpd.service
systemctl enable httpd.service
#安装本地源制作工具
yum install yum-utils createrepo

下载软件源

在httpd网站根目录,默认是即/var/×××w/html/,创建目录ambari,
并且将下载的压缩包解压到/var/×××w/html/ambari目录

cd /var/×××w/html/
mkdir ambari
cd /var/×××w/html/ambari/
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/centos6/2.x/updates/2.6.4.0/HDP-2.6.4.0-centos6-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos6/HDP-UTILS-1.1.0.22-centos6.tar.gz

http://public-repo-1.hortonworks.com/HDP-GPL/centos6/2.x/updates/2.6.4.0/HDP-GPL-2.6.4.0-centos6-rpm.tar.gz

解压下载的tar包

下载repo并修改
下载yum源并修改

源文件内容:

[[email protected] yum.repos.d]# cat ambari.repo
#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5
gpgcheck=1
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

修改为:

[[email protected] yum.repos.d]# cat ambari.repo
#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://192.168.103.194:8080/ambari/centos7/2.6.1.5-3
gpgcheck=1
gpgkey=http://192.168.103.194:8080/ambari/centos7/2.6.1.5-3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1[[email protected] yum.repos.d]#

源文件内容:

[[email protected] yum.repos.d]# cat ambari-hdp-1.repo
[HDP-2.6-repo-1]
name=HDP-2.6-repo-1
baseurl=http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0

path=/
enabled=1
gpgcheck=0
[HDP-UTILS-1.1.0.22-repo-1]
name=HDP-UTILS-1.1.0.22-repo-1
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7

path=/
enabled=1
gpgcheck=0[[email protected] yum.repos.d]#

修改为:

[[email protected] yum.repos.d]# cat ambari-hdp-1.repo
[HDP-2.6-repo-1]
name=HDP-2.6-repo-1
baseurl=http://192.168.103.194:8080/HDP/centos7/2.6.4.0-91

path=/
enabled=1
gpgcheck=0
[HDP-2.6-GPL-repo-1]
name=HDP-2.6-GPL-repo-1
baseurl=http://192.168.103.194:8080/HDP-GPL-2.6.4.0-centos7-rpm/HDP-GPL/centos7/2.6.4.0-91

path=/
enabled=1
gpgcheck=0
[HDP-UTILS-1.1.0.22-repo-1]
name=HDP-UTILS-1.1.0.22-repo-1
baseurl=http://192.168.103.194:8080/HDP-UTILS-1.1.0.22-centos7

path=/
enabled=1
gpgcheck=0[[email protected] yum.repos.d]#

更新yum 元数据
yum clean all

yum makecache

yum repolist

安装Ambari-server
在主节点安装ambari-server
sudo yum install -y ambari-server

配置Ambari-server
配置mysql连接器
由于ambari要访问数据库,所以要添加lib包,请自行去mysql官网下载
sudo mkdir -p /usr/share/java
sudo cp /opt/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/share/java/

在ambari-server配置文件中添加mysql lib包路径地址

执行一下命令配置jdbc环境

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

vim /etc/ambari-server/conf/ambari.properties
###在jdbc区下面找个位置添加如下如下语句
server.jdbc.driver.path=/usr/share/java/mysql-connector-java-5.1.47-bin.jar

检查环境并配置
执行以下命令
sudo ambari-server setup
按提示操作

会检查selinux,是否自定义用户,检查防火墙,设置JDK路径,数据库配置等,按提示操作即可

具体操作如下:

[[email protected] opt]# vim /etc/ambari-server/conf/ambari.properties
[[email protected] opt]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.47-bin.jar
Using python /usr/bin/python
Setup ambari-server
Copying /usr/share/java/mysql-connector-java-5.1.47-bin.jar to /var/lib/ambari-server/resources
If you are updating existing jdbc driver jar for mysql with mysql-connector-java-5.1.47-bin.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.
JDBC driver was successfully initialized.
Ambari Server ‘setup‘ completed successfully.
[[email protected] opt]# vim /etc/ambari-server/conf/ambari.properties
[[email protected] opt]# ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is ‘disabled‘
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):ambari
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[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: /opt/jdk1.8.0_161
Validating JDK on Ambari Server...done.
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 (1): 3
Hostname (localhost): 192.168.103.3
Port (3306):
Database name (ambari):
Username (ambari):
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 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)? n
WARNING: Remote database setup aborted.
Ambari Server ‘setup‘ completed with warnings.
[[email protected] opt]#

将Ambari数据库脚本导入到数据库

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

启动ambari server
ambari-server start

在浏览器中访问ip:8080,默认登录名:admin 密码:admin

添加服务组件
https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-administration/content/ambari_admin_overview.html

spark配置
由于spark要访问数据库,所以要添加mysql lib包
cp /opt/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/hdp/2.6.4.0-91/spark/lib/

 安装数据库
使用现有数据库或者自己安装

创建ambari和hive库
create database ambari character set utf8 ;

添加权限

GRANT ALL PRIVILEGES ON ambari.* TO ‘ambari‘@‘%‘;
FLUSH PRIVILEGES;

删除权限:
revoke all privileges on ambari.* from [email protected]‘%‘;

# 程序安装目录

程序默认安装目录
[[email protected] 2.6.4.0-91]# pwd
/usr/hdp/2.6.4.0-91
[[email protected] 2.6.4.0-91]# ls
atlas hadoop hadoop-mapreduce hbase hive2 kafka pig ranger-hdfs-plugin ranger-kafka-plugin ranger-yarn-plugin spark storm tez usr
etc hadoop-hdfs hadoop-yarn hive hive-hcatalog livy ranger-hbase-plugin ranger-hive-plugin ranger-storm-plugin slider spark2 storm-slider-client tez_hive2 zookeeper
[[email protected] 2.6.4.0-91]#

PID目录

/var/run/

日志目录
/var/logs/

一般修改log目录,在安装大数据组件的时候,修改配置文件即可。

删除服务
先停止服务
Service Actions > Delete Service
yum remove xx
https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-administration/content/ambari_admin_overview.html

ambari监控

 ambari安装默认用户和用户组

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-administration/content/defining_service_users_and_groups_for_a_hdp_2x_stack.html

常见问题
问题1:Centos 7安装 ambari-agent报错NetUtil.py-[SSL: CERTIFICATE_VERIFY_FAILED]

Centos 7安装 ambari通过Ambari部署系统时,ambari-agent注册失败,在/var/log/ambari-agent的log中可以看到日志显示:
ERROR 2018-03-08 15:02:25,223 NetUtil.py:88 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
ERROR 2018-03-08 15:02:25,223 NetUtil.py:89 - SSLError: Failed to connect. Please check openssl library versions.

解决方法:

修改/etc/python/cert-verification.cfg配置文件:
# vim /etc/python/cert-verification.cfg
[https]
verify=platform_default ###(这是默认配置)
修改为verify=disable

编辑 /etc/ambari-agent/conf/ambari-agent.ini 配置文件,在 [security] 节部分,确保设置如下两个值,其它值保持不变:
[[email protected] ~]# vim /etc/ambari-agent/conf/ambari-agent.ini
[security]
ssl_verify_cert=0
force_https_protocol=PROTOCOL_TLSv1_2
以上配置修改完后,重试即可通过ambari-agent注册,执行即可下一步

参考文档
官方文档安装文档

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-installation/content/determine_product_interop.html

未完待续~

原文地址:http://blog.51cto.com/xulianglinux/2321290

时间: 2024-10-29 13:08:38

ambari 2.6.1.5安装的相关文章

ambari介绍及安装

Ambari简介 Ambari概述 Apache Ambari是一种基于Web的工具,支持Apache Hadoop集群的创建.管理和监控.Ambari已支持大多数Hadoop组件,包括HDFS.MapReduce.Hive.Pig. Hbase.Zookeeper.Sqoop和Hcatalog等:除此之外,Ambari还支持Spark.Storm等计算框架及资源调度平台YARN. Apache Ambari 从集群节点和服务收集大量信息,并把它们表现为容易使用的,集中化的接口:Ambari W

用HAWQ轻松取代传统数据仓库(二) —— 安装部署

一.安装规划1. 选择安装介质        HAWQ的安装介质有两种选择,一是下载源码手工编译,二是使用Pivotal公司提供的HDB安装包.源码的下载地址为http://apache.org/dyn/closer.cgi/incubator/hawq/2.0.0.0-incubating/apache-hawq-src-2.0.0.0-incubating.tar.gz,目前最新版本是2.0.0.源码编译和安装Apache官方文档地址为https://cwiki.apache.org/con

Centos5.6下利用Ambari搭建Hadoop集群(Hotonworks框架)

 写在前面: 很长时间没在CSDN上写博客了,最近两个月公司计划要搞大数据,而我们的技术不够,所以这段时间主要进行Hadoop的相关技术学习及储备.废话不多说,下面进入主题,本次主要讨论在Centos5.6下通过Ambari进行Hadoop集群的安装(基于Hotonworks框架). 一.Centos安装(已装了系统的可以跳过此步) 1.    把光盘放入光驱中重新启动电脑,让光盘引导来安装CentOS 5.6系统; 上图为CentOS的安装启动界面,如果想用文本方式安装,就输入linux te

2、ambari搭建HDP集群

一.平台环境 操作系统:CentOS release 6.5 (Final) Java版本:jdk1.8.0_60 Ambari版本:2.2.1.0 HDP版本:2.4.0 MySQL版本:MySQL-5.6.25-1 用户权限:cent,sudo无密码 主机IP:192.168.234.145 安装包路径:~/packages 二.环境准备1. 增加系统打开文件数和进程数 在每台服务器命令行执行: ulimit -n 显示当前可以打开的最大文件数 sudo vim /etc/security/

Ambari HDP集群搭建文档_zhoujp

一.配置主机和节点机器之间SSH无密登录 多台外网服务器配置时,需要在/etc/hosts中把本机的IP地址设置为内网IP地址 http://2d67df38.wiz02.com/share/s/0JpZYU2X7kl626aE730Q_Flq3daBjm08rAnl2oLpli2uMOfo 二.为每台主机关闭iptables,SELinux,启动ntpd服务 三.安装Mysql,JDK 查看linux发行版本 cat /etc/redhat-release 从网站http://dev.mysq

solr组件集成进ambari进行统一管理

Solr 集成手册 1. 复制安装源 登录到YUM节点,将安装包复制到指定目录.cp HDPsearch.tar.gz /var/www/html/HDPsearch.tar.gz 2. 安装Ambari插件 登录到Ambari主机节点,安装Ambari插件. 解压插件unzip solr-stack.zipmv solr-stack /var/lib/ambari-server/resources/stacks/HDP/2.2/services/SOLR 重启服务ambari-server r

Hadoop 发行版本 Hortonworks 安装详解(一) 准备工作

一.前言 目前Hadoop发行版非常多,所有这些发行版均是基于Apache Hadoop衍生出来的,之所以有这么多的版本,完全是由Apache Hadoop的开源协议决定的:任何人可以对其进行修改,并作为开源或商业产品发布/销售. Hortonworks这个名字源自儿童书中一只叫Horton的大象.雅虎主导Hadoop开发的副总裁,带领二十几个核心成员成立Hortonworks. Hortonworks有两款核心产品:HDP和HDF Hortonworks没有对产品收费,而是将这两款产品完全开放

Hadoop 发行版本 Hortonworks 安装详解(四) 开启Kerberos集群安全验证

一.安装KDC Server 需要选择一个节点安装KDC服务器,这里选择备用头结点 yum install -y krb5-server krb5-libs krb5-workstation 修改配置文件 vi /etc/krb5.conf 把 EXAMPLE.COM 改为 自己想要的名字,[realms]配置段也需要根据实际情况修改 创建数据库 kdb5_util create -s -r EXAMPLE.COM(改成实际名称) 耐心等待一会,创建数据库有点慢 随后会要求你输入数据库主密钥并完

Ambari 2.6.0 HDP 2.6.3集群搭建

1.安装环境说明 三台机器安装好CentOS-7-x86_64-Minimal-1708.iso 下载地址:https://www.centos.org/download/ 最好在安装时设置好IP和HOSTNAME 三台机器的IP和HOSTNAME下载如下 主 192.168.31.11 SY-001.hadoop 从 192.168.31.12 SY-002.hadoop 从 192.168.31.13 SY-003.hadoop 每个节点设置host [[email protected] ~