Code Monkey home page Code Monkey logo

install-airflow-docker's Introduction

Install Airflow on Docker and Create first DAG

Prerequisite:

Before you running this installation, make sure you have Docker and Docker Compose on your Linux/Unix machine.

Airflow Setup

In this Airflow installation, you will install Airflow 2.2.0 and some services to support Airflow such as :

  1. Databases:

    • First Postgresql image as datalake
    • Second Postgresql image as datawarehouse
  2. Airflow Setup:

    • Postgresql as Airflow repo
    • Redis
    • Airflow webserver, scheduler, worker
    • Flower

Running Setup

  1. To run this installation, you must config the credential inside the .env file. For example:
AIRFLOW_UID=50000
DB_NAME=dev
USER_NAME=user_dev
USER_PASSWORD=pass2022!
AIRFLOW_CONN_POSTGRES_DATALAKE=postgresql://user_dev:[email protected]:5433/dev
AIRFLOW_CONN_POSTGRES_DATAWAREHOUSE=postgresql://user_dev:[email protected]:5434/dev
  1. Change the credential inside the credentials.json file in this folder dags/script/. For example:
{
    "postgres_lake": {
        "host":"172.17.0.1",
        "port":"5433",
        "database":"dev",
        "username":"user_dev",
        "password":"pass2022!"
    },
    "postgres_warehouse": {
        "host":"172.17.0.1",
        "port":"5434",
        "database":"dev",
        "username":"user_dev",
        "password":"pass2022!"
    }
}
  1. Then, open your terminal and enter to installation folder where you can find docker-compose.yaml file.
  2. Run this command to turn on your installation. It will download and install some docker images for 5-20 minutes based on your internet connection.
docker-compose up
  1. After installation finish, open your browser and type this URL :
localhost:8080
  1. You need to insert username and password for Airflow for the first time login, please use this credential below.
username : airflow
password : airflow
  1. You will see a DAG named postgres2postgres_manual and you can trigger this DAG using play button on the right page.
  2. Click on postgres2postgres_manual DAG and you will see dag tree and wait for the process until finish.
  3. If all process success, you can use your Postgresql client and enter to postgres_warehouse database to see table that already created and inserted.
  4. To turn off Airflow installation, you can use this command on your terminal.
docker-compose down

install-airflow-docker's People

Contributors

bagasprakasa avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.