ubuntu14離線安裝ambari(一、搭建本地鏡像庫)

因環(huán)境限制不能訪問外網(wǎng),在ubuntu14上安裝ambari,所以采用離線方式搭建,特此記錄

安裝httpd服務(wù)(httpd依賴apr、apr-util、prce三個服務(wù))

名稱 下載地址
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內(nèi)也是一種方式,但是編譯的時候容易出錯,所以未采用#
# 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++編譯環(huán)境,解決"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"
    <Directory "/var/www/html">
    
    

啟動httpd鏡像服務(wù)

  • 解決報錯:"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服務(wù)
cd /usr/local/httpd/bin
./httpd -k  start
image.png
參考資料:

Apache Ambari Installation

## ubuntu下編譯安裝httpd-2.4.3

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容