centos 7 下 安裝配置 caravel

來源:互聯網
上載者:User

centos 7 下 安裝配置 caravel

安裝基礎包:yum groupinstall "Development tools"

一、pip安裝1. 安裝python

需要2.7版本的Python,如果centOS內建的是2.7的則不需安裝(centOS7內建了2.7.5)
① 下載 python
https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
# tar xf Python-2.7.9.tar.xz
# cd Python-2.7.9
# make && make altinstall
# ln -s /usr/local/bin/python2.7 /usr/local/bin/python
④ 測試
# python -V

② 解壓

③ 編譯安裝

# ./configure --prefix=/usr/local

2. 安裝pip

首先
# yum install epel-release
然後
# yum install python-pip

3. 安裝caravel

① 獲得caravel源碼
# wget https://github.com/airbnb/caravel/archive/master.zip
② 解壓
# unzip caravel-master.zip
③ 安裝
進入根目錄,使用pip命令安裝(考慮到境外伺服器太慢,這裡使用清華大學的源)
# pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple/

4. 錯誤(如果有錯誤執行下面的)

① cffi
yum install libffi-devel
② sasl
yum install libgsasl-devel
yum install libmemcached-devel
③ python
yum install python-devel
④ openssl
yum install openssl-devel
⑤ pytz
pip install --upgrade pytz
⑥ npy_math.py
yum install numpy

yum install openssl

二、nmp安裝1. 安裝nodejs下載node-v4.5.0.tar.gz(官網)
解壓

# ./configure --prefix=/usr/local
# make
# make install
# ln -s /usr/local/bin/node /usr/bin/node

2. 安裝npm

根據網址下載 install.sh (https://npmjs.org/install.sh)
# sh install.sh

3. 安裝express

# npm install express -g

4. 安裝caravel(源碼安裝)

## assuming $CARAVEL_HOME as the root of the repo
# cd $CARAVEL_HOME/caravel/assets
# npm install
# npm run prod
# cd $CARAVEL_HOME
# python setup.py install

三、初始化運行建立admin使用者
# fabmanager create-admin --app caravel
初始化caravel中繼資料
# caravel db upgrade
初始化caravel預設的使用者角色和許可權
# caravel init
載入樣本資料
# caravel load_examples
定義運行連接埠
# caravel runserver -p 8088
通過http://localhost:8088就可訪問

四、串連資料來源1. postgresql
yum install build-dep python-psycopg2
pip install psycopg2
2. mysql
yum install MySQL-pythondatabasepypi packageSQLAlchemy URI prefixMySQL pipinstallmysqlclient mysql://Postgres pipinstallpsycopg2 postgresql+psycopg2://Presto pipinstallpyhive presto://Oracle pipinstallcx_Oracle oracle://sqlite sqlite://Redshift pipinstallsqlalchemy-redshift redshift+psycopg2://MSSQL pipinstallpymssql mssql://Impala pipinstallimpyla impala://SparkSQL pipinstallpyhive jdbc+hive://注意如果串連資料來源報錯如串連mysql資料來源報錯 importError no moduel MySQLdb解決辦法如下:

linux環境下安裝MySQL-python的兩種方式

第一種 簡單:yum installMySQL-python

第二種:複雜:需要自己源碼編譯,依賴包比較多

a. gcc

b.setuptools

c.python-dev

第二章詳細步驟如下:

A.下載:wgethttp://sourceforge.net/projects/mysql-python/files/latest/download

B.

$ tar xfz MySQL-python-1.2.3.tar.gz
$ cd MySQL-python-1.2.3

$whereismysql_config

mysql_config: /usr/bin/mysql_config
$ vim site.cfg
修改mysql_config為mysql設定檔的路徑/usr/bin/mysql_config

還要修改

threadsafe = False
$ python setup.py build
$ sudo python setup.py install在python環境下>>> import MySQLdb
/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.pyc, but /app/MySQL-python-1.2.5 is being added to sys.path安裝成功-------------------------------------------------------------------------------------------------------------------------------安裝過程中報,error: command 'gcc' failed with exit status 1用yum install gcc 顯示已經是安裝最新版本未安裝mysql-devel包解決方案:yum install mysql-devel參考地址:http://blog.csdn.net/wklken/article/details/7271019http://blog.csdn.net/agoago_2009/article/details/9492765

參考檔案

http://www.aboutyun.com/thread-19402-1-1.html

http://blog.csdn.net/csulfy/article/details/51833407

http://lxw1234.com/archives/2016/06/681.htm

http://km-moon11.iteye.com/blog/2213527

http://airbnb.io/caravel/installation.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.