LoginSignup
8
8

More than 5 years have passed since last update.

Airflow~インストール編~

Last updated at Posted at 2015-11-24

Python3.6で動くようになっていたので下記に書き直しました
http://qiita.com/hatappi/items/0da6cc28e18fa9b5853f

Airflowについて

AirflowはAirbnbが開発元のOSSのJob管理ツール
AWS re:Invent 2015で話題になった模様。
Pythonで動く。

動作環境

  • python2.7

事前の注意点

pythonのversionが2.6だとairflowを起動する際に、SyntaxErrorになるので注意!

手順

事前準備

最低限下記はいれておかないと
pipをいれる際にエラーになります。

yum install zlib-devel bzip2-devel openssl-devel gcc-c++ python-devel

pythonのインストール

curl -O https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar zxf Python-2.7.6.tgz 
cd Python-2.7.6
./configure --prefix=/opt/local
make && make altinstall
export PATH=$PATH:/opt/local/bin

pipインストール

curl -kL https://bootstrap.pypa.io/get-pip.py | python2.7

mysql5.7のインストール

yum install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community-dmr
yum install yum-utils
yum install mysql-community-server
yum install mysql-devel
  • Note: rootの初期パスワードはgrep password /var/log/mysqld.logで調べる

Airflowインストール

pip install airflow[mysql]
pip install airflow[celery]

設定

airflow.cfg
sql_alchemy_conn = mysql://[usr名]:[password]@[host]:[port]/[db名]
broker_url = sqla+mysql://[usr名]:[password]@[host]:[port]/[db名]
celery_result_backend = db+mysql://[usr名]:[password]@[host]:[port]/[db名]

注意点

pipを入れる際にzipimport.ZipImportError: can’t decompress data; zlib not available

これは予めzlib-develをインストールしていないから起きてるのでインストールして
再度pythonのインストールからやり直してください

pipを入れる際のImportError: cannot import name HTTPSHandler

これは予めopenssl-develをインストールしていないから起きてるのでインストールして
再度pythonのインストールからやり直してください

airflowを入れる際のerror: command 'gcc' failed with exit status 1が出た時は

mysql-develが入っていないので、yum install mysql-devel

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8