ubuntu14离线安装ambari(一、搭建本地镜像库)

因环境限制不能访问外网,在ubuntu14上安装ambari,所以采用离线方式搭建,特此记录

安装httpd服务(httpd依赖apr、apr-util、prce三个服务)

名称 下载地址
apr http://ftp.cuhk.edu.hk/pub/packages/apache.org//apr/apr-1.6.3.tar.gz
apr-util http://ftp.cuhk.edu.hk/pub/packages/apache.org//apr/apr-util-1.6.1.tar.gz
pcre http://jaist.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gz
httpd http://mirrors.shu.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
  • 解压4个文件
 tar -xzvf apr-1.6.3.tar.gz  
 tar -xzvf apr-util-1.6.1.tar.gz 
 tar -xzvf pcre-8.42.tar.gz 
 tar -xzvf httpd-2.4.33.tar.gz  
  • 编译、安装pcre,解决pcre not found的问题
  cd  pcre-8.42
  ./configure --prefix=/usr/local/pcre 
  make && make install
  • 编译、安装apr,解决apr not found的问题
  cd  apr-1.6.3
  ./configure --prefix=/usr/local/apr
  make && make install
  • 编译、安装apr-util,解决apr-utilnot found的问题
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util  --with-apr=/usr/local/apr
make && make install
#直接将apr、apr-util源码拷贝至httpd的依赖文件夹srclib内也是一种方式,但是编译的时候容易出错,所以未采用#
# cp -r /usr/software/apr-1.6.3  /usr/software/httpd-2.4.33/srclib/apr
#cp -r /usr/software/apr-util-1.6.1  /usr/software/httpd-2.4.33/srclib/apr-util
  • 安装C++编译环境,解决"You need a C++ compiler for C++ support"
    sudo apt-get install build-essential
  • 解决"fatal error: expat.h: No such file or directory"或者"collect2: error: ld returned 1 exit status"
    sudo apt-get install libexpat1-dev
  • 解决"error: mod_deflate has been requested but can not be built due to prerequisite failures"
    sudo apt-get install zlib1g-dev
  • 解决"error: mod_ssl has been requested but can not be built due to prerequisite failures"
    原因是Ubuntu那是没有安装openssl包,需要安装:
    sudo apt-get install openssl
    之后报openssl版本太旧,所以下载最新源码手动编译安装
    ./config --prefix=/usr/local/ssl
    make && make install
    同时需要修改httpd编译配置添加
    --with-ssl=/usr/local/ssl
  • 编译、安装httpd
  cd  httpd-2.4.33
  ./configure --prefix=/usr/local/httpd \
  --enable-dav \
  --enable-so \
  --enable-maintainer-mode \
  --enable-rewrite \
  --enable-deflate=shared \
  --enable-ssl=shared \
  --enable-expires=shared \
  --enable-headers=shared \
  --enable-static-support \
  --with-included-apr \
  --with-mpm=prefork \
  --enable-cache \
  --enable-file-cache \
  --with-pcre=/usr/local/pcre \
  --with-apr=/usr/local/apr \
  --with-apr-util=/usr/local/apr-util \
  --with-ssl=/usr/local/ssl
  make && make install

下载镜像

在ambari离线安装包下载页面 下载以下文件:

名称 下载地址
ambari-2.6.2安装包 http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.6.2.0/ambari-2.6.2.0-ubuntu14.tar.gz
HDP http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.5.0/HDP-2.6.5.0-ubuntu14-deb.tar.gz
HDP-UTILS http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/ubuntu14/HDP-UTILS-1.1.0.21-ubuntu14.tar.gz
HDP-GPL http://public-repo-1.hortonworks.com/HDP-GPL/ubuntu14/2.x/updates/2.6.5.0/HDP-GPL-2.6.5.0-ubuntu14-gpl.tar.gz
  • 上传并解压下载的文件至/var/www/html/hdp-2.6.5-ubuntu14/下(超过4G使用filezilla上传大文件)
  • 修改httpd配置文件/usr/local/httpd/conf/httpd.conf
    #开头添加
    ServerName 10.24.21.144:8090
    ...  
    #修改
    Listen 8090
    ...
    #修改
    DocumentRoot "/var/www/html"
    
    
    

启动httpd镜像服务

  • 解决报错:"httpd: Syntax error on line 129 of /usr/local/cp-httpd-2.4.18/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: libssl.so.1.0.0: cannot open shared object file: No such file or directory ",原因参考
#添加软连接即可
ln -s /usr/local/ssl/lib/*.so /usr/lib64
ln -s /usr/local/ssl//lib/*.so.* /usr/lib
#启动httpd服务
cd /usr/local/httpd/bin
./httpd -k  start
ubuntu14离线安装ambari(一、搭建本地镜像库)_第1张图片
image.png
参考资料:

Apache Ambari Installation

## ubuntu下编译安装httpd-2.4.3

你可能感兴趣的:(ubuntu14离线安装ambari(一、搭建本地镜像库))