♥ Ubuntu 18.04 최초 설치 후에 Airflow 설치하는 방법
Ubuntu 18.04.6 LTS
Python 3.6.9
Putty
MySql
여기부터는 ubuntu command line에 입력하면 되는 명령어들이에요
★ pip package 설치하기
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
에러가 발생하기 때문에
pip3 install --ignore-installed PyYAML
Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
에러가 발생하기 때문에
pip3 install wheel
★ Airflow 설치하기
sudo su
apt-get update
pip3 install apache-airflow
pip3 install cryptography psycopg2-binary boto3 botocore
pip3 list
★ MySQL 설치하기
apt-get install mysql-server mysql-client
mysql --version
mysql Ver 14.14 Distrib 5.7.36, for Linux (x86_64) using EditLine wrapper
su -username
service mysql start
mysqladmin -u root create test -p
하면 test 라는 db 생성
mysql -u root -p
create database airflow;
show databases;
grant all privileges on airflow.* to 'myairflow'@localhost identified by '1234';
USE mysql;
SELECT Host, User, authentication_string FROM user;
pip3 install pymysql
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
explicit_defaults_for_timestamp = 1
추가
Ctrl+O, Ctrl+X 로 저장 나가기
service mysql restart
★ Airflow initialization
폴더 만들기
cd /var/lib
mkdir airflow && cd airflow
mkdir dags
export AIRFLOW_HOME=/var/lib/airflow
sudo nano airflow.cfg
#sql_alchemy_conn = sqlite:////var/lib/airflow/airflow.db
sql_alchemy_conn = mysql+pymysql://myairflow:1234@localhost:3306/airflow
sql_alchemy_conn =이 sqlite로 되있는거를 #로 comment하고
sql_alchemy_conn = mysql+pymysql://myairflow:1234@localhost:3306/airflow
를 붙여넣기한다.
airflow db init
airflow scheduler -D
airflow webserver -p 8080 -D
admin 계정 생성
airflow users create --username admin --firstname admin --lastname airflow --role Admin --password 1234 --email admin@admin.com
인터넷 브라우저 켜고
ip주소:8080
로 접속
아이디: admin / 비밀번호: 1234 입력
하면 접속 됨
프로세스 kill 하는 방법
cat airflow-scheduler.pid | xargs kill
cat airflow-webserver.pid | xargs kill -9
cat /dev/null > $AIRFLOW_HOME/airflow-webserver.pid
Ref.
[파이썬] PyYAML install error (tistory.com)
[파이썬] PyYAML install error
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. github 에서 READM..
powerofsummary.tistory.com
[Python] Using legacy 'setup.py install' ... since package 'wheel' is not installed 해결 방법 - 랭크 브라더스
pip으로 패키지를 설치할 때 이런 메시지가 나올 때가 있습니다. wheel이 깔려 있지 않으니 레거시인 setup.py install을 사용해 패키지를 설치한다는 내용인데요, 해결 방법은 단순합니다. pip으로 wheel
rank-brothers.com
[무작정 따라하기] Linux(Ubuntu) 환경에서 Airflow 구축하기 :: Aust_Coconut (tistory.com)
[무작정 따라하기] Linux(Ubuntu) 환경에서 Airflow 구축하기
이번 포스팅에선 Linux(Ubuntu)에서 MySQL과 연동된 Airflow 환경을 구축해 보겠습니다. 다루는 내용 - Airflow 설치 - Airflow 연동을 위한 MySQL 설정 - Airflow 초기화 - Airflow Schedular 및 Webserver 실행..
austcoconut.tistory.com