SimpleDao
airflow配置
2019-05-06, 访问数: 1087

修改数据库为mysql

  1. sql_alchemy_conn = mysql://root:123@localhost:3066/airflow?charset=utf8

修改celery的broker为redis

  1. broker_url = redis://localhost:6379/0
  2. # rabbitmq: amqp://guest:guest@localhost:5672//
  3. celery_result_backend = redis://localhost:6379/0

添加user

  1. import airflow
  2. from airflow import models, settings
  3. from airflow.contrib.auth.backends.password_auth import PasswordUser
  4. user = PasswordUser(models.User())
  5. user.username = 'test_user'
  6. user.email = 'test_user@example.com'
  7. user.password = 'test_user'
  8. session = settings.Session()
  9. session.add(user)
  10. session.commit()
  11. session.close()
  12. exit()