nJcx's Blog

生而不忧,死而不怖。得其时横刀天下,不得其时蓬头而行。

ambari 实践笔记


介绍

安装

系统:centos7.3,maven-3.5.4,ambari-2.7.1

目录: /opt

先安装maven

# wget http://ftp.yz.yamagata-u.ac.jp/pub/network/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
# tar -zxvf apache-maven-3.5.4-bin.tar.gz

添加环境变量

export MAVEN_HOME=/opt/apache-maven-3.5.4
export PATH=${MAVEN_HOME}/bin:${PATH}

source /etc/profile

找到conf/settings.xml,修改Maven源

 <mirrors>    
            <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>https://maven.aliyun.com/repository/releases/</url>
        </mirror>

        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>https://maven.aliyun.com/repository/central/</url>
        </mirror>

        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>https://maven.aliyun.com/repository/public/</url>
        </mirror>
  </mirrors> 
# wget https://mirrors.aliyun.com/apache/ambari/ambari-2.7.1/apache-ambari-2.7.1-src.tar.gz 
# tar -zxvf apache-ambari-2.7.1-src.tar.gz
# cd apache-ambari-2.7.1-src

mvn versions:set -DnewVersion=2.7.1.0.0 
pushd ambari-metrics
mvn versions:set -DnewVersion=2.7.1.0.0
popd

接下来会开启啰嗦模式~,耐心休息休息

mvn -B clean install rpm:rpm -DnewVersion=2.7.1.0.0 -DbuildNumber=90430db08a5f543a97d97918cf5f711f2786ad8a -DskipTests -Dpython.ver="python >= 2.6"
  • server安装

编译后,在如下目录查找,ambari-server/target/rpm/ambari-server/RPMS/noarch/

yum install ambari-server*.rpm
ambari-server setup
ambari-server start
  • agent 安装 编译后,在如下目录查找,ambari-agent/target/rpm/ambari-agent/RPMS/x86_64/
yum install ambari-agent*.rpm

vim /etc/ambari-agent/ambari.ini

[server]
hostname=localhost

ambari-agent start

访问页面 http://:8080 账户:admin:admin

方法二:

master

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

yum install ambari-server -y

slave1

yum install ambari-agent -y