【Bigtop】Ambari2.8.0编译及安装

Ambari2.8.0编译及安装

  • Ambari2.8.0编译及安装
    • 编译Ambari
    • 编译Ambari-metrics
    • 搭建Ambari
      • 镜像准备

Ambari2.8.0编译及安装

编译Ambari

安装必要工具:

yum -y install gcc-c++ git psutils python-devel rpm-build 

克隆仓库并切换到2.8.0-rc1分支

git checkout release-2.8.0-rc1

必须安装3.8.6的mvn,不然会在编译ambari-metrics时报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.7.0:copy-dependencies (default) on project ambari-metrics-timelineservice: Excluding every artifact inside 'test' resolution scope means excluding everything: you probably want includeScope='compile', read parameters documentation for detailed explanations -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :ambari-metrics-timelineservice

先装个node然后手动做下ambari-admin的依赖安装,防止后面bower依赖安装太久了,版本供参考:

[root@ops-3 ~]# npm version
{
  npm: '8.1.2',
  node: '16.13.2',
}

进到admin-web执行下面操作:

npm install
npm install -g bower
npm install -g gulp

然后执行bower安装依赖

bower install --allow-root

编译整个ambari

mvn clean install rpm:rpm -DskipTests -Drat.skip=true

编译Ambari-metrics

手动下载这些然后做本地http服务

    <hbase.tar>http://repo.bigtop.apache.org.s3.amazonaws.com/bigtop-stack-binary/3.2.0/centos-7/x86_64/hbase-2.4.13-bin.tar.gzhbase.tar>
    <hadoop.tar>http://repo.bigtop.apache.org.s3.amazonaws.com/bigtop-stack-binary/3.2.0/centos-7/x86_64/hadoop-3.3.4.tar.gzhadoop.tar>
    <grafana.tar>https://dl.grafana.com/oss/release/grafana-9.3.2.linux-amd64.tar.gzgrafana.tar>
    <phoenix.tar>http://repo.bigtop.apache.org.s3.amazonaws.com/bigtop-stack-binary/3.2.0/centos-7/x86_64/phoenix-hbase-2.4-5.1.2-bin.tar.gzphoenix.tar>

改成自己做的本地http,比如:

    <hbase.tar>http://172.18.2.31:5000/hbase-2.4.13-bin.tar.gzhbase.tar>
    <hadoop.tar>http://172.18.2.31:5000/hadoop-3.3.4.tar.gzhadoop.tar>
    <grafana.tar>http://172.18.2.31:5000/grafana-9.3.2.linux-amd64.tar.gzgrafana.tar>
    <phoenix.tar>http://172.18.2.31:5000/phoenix-hbase-2.4-5.1.2-bin.tar.gzphoenix.tar>

搭建Ambari

镜像准备

FROM centos:centos7.9.2009 

RUN rm -rf /etc/yum.repos.d/*.repo

ADD CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo 
ADD epel.repo /etc/yum.repos.d/
ADD packages/jdk-8u291-linux-x64.rpm /tmp/

RUN yum update -y && yum install --nogpgcheck -y openssh-server \
    net-tools \
    vim \
    wget \
    curl \
    telnet \
    lsb \ 
    redhat-lsb \
    zip \ 
    tar 

CMD ['/usr/sbin/init']

创建3台虚拟机来做安装部署

docker run -it -d --privileged=true --name bigdata01 --network bridge --hostname bigdata01 ambari /usr/sbin/init
docker run -it -d --privileged=true --name bigdata02 --network bridge --hostname bigdata02 ambari /usr/sbin/init
docker run -it -d --privileged=true --name bigdata03 --network bridge --hostname bigdata03 ambari /usr/sbin/init

操作前手动把jdk、selinux、防火墙、时间同步这些东西处置好

用createrepo命令创建yum仓库,并配置repo文件:

[ambari-2.8.0.0.0]
name=ambari Version - ambari-2.8.0.0.0
baseurl=http://172.18.2.31:9000/2.8.0.0.0/
enabled=1
gpgcheck=0

这里我们自己装了个数据库,没装的话装一下,我们这里用的是PG,导入建表语句:

psql -Upostgres -p5832 -h127.0.0.1 -dambari -f Ambari-DDL-Postgres-CREATE.sql 

sql文件可以在ambari-server的/var/lib/ambari-server/resources/Ambari-DDL-Postgres-CREATE.sql下找到

进行ambari初始化设置

ambari-server setup

设置pg驱动

ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/local/share/java/postgresql-42.7.4.jar 

启动ambari-server

[root@bigdata01 /]# ambari-server start
Using python  /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start............
Server started listening on 8080

DB configs consistency check: no errors and warnings were found.
Ambari Server 'start' completed successfully.

然后在页面做一下组件的安装即可,这些都是基础,按照页面引导做即可:
【Bigtop】Ambari2.8.0编译及安装_第1张图片
【Bigtop】Ambari2.8.0编译及安装_第2张图片

你可能感兴趣的:(大数据,运维开发,大数据,hadoop,ambari)