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-python
@H_18_301@pipinstallpsycopg2 @H_18_301@postgresql+psycopg2:// @H_18_301@pipinstallcx_Oracle @H_18_301@oracle:// @H_18_301@pipinstallsqlalchemy-redshift @H_18_301@redshift+psycopg2:// @H_18_301@pipinstallimpyla @H_18_301@impala://
database pypi package sqlAlchemy URI prefix
MysqL pipinstallMysqLclient MysqL://
Postgres
Presto pipinstallpyhive presto://
Oracle
sqlite sqlite://
Redshift
MSsql pipinstallpymssql mssql://
Impala
Sparksql jdbc+hive://
注意如果连接数据源报错如连接MysqL数据源报错 importError no moduel MysqLdb解决办法如下:

linux环境下安装MysqL-python的两种方式


第一种 简单:yum install MysqL-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/7271019
http://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

原文链接:https://www.f2er.com/centos/380116.html

猜你在找的CentOS相关文章