歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習Linux

centos 7 下 安裝配置 caravel

centos 7 下 安裝配置 caravel

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 prefixMySQLpipinstallmysqlclientmysql://Postgrespipinstallpsycopg2postgresql+psycopg2://Prestopipinstallpyhivepresto://Oraclepipinstallcx_Oracleoracle://sqlitesqlite://Redshiftpipinstallsqlalchemy-redshiftredshift+psycopg2://MSSQLpipinstallpymssqlmssql://Impalapipinstallimpylaimpala://SparkSQLpipinstallpyhivejdbc+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

http://xxxxxx/Linuxjc/1184797.html TechArticle

Copyright © Linux教程網 All Rights Reserved