答案 0 :(得分:0)
那是因为默认情况下Web身份验证已关闭。
通过将以下内容添加到您的airflow.cfg
文件中来启用Web身份验证:
[webserver]
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
并确保它们与auth_backend
文件中的airflow.cfg
没有其他重复值。
然后为Web UI创建用户:
# navigate to the airflow installation directory
$ cd ~/airflow
$ python
Python 2.7.9 (default, Feb 10 2015, 03:28:08)
Type "help", "copyright", "credits" or "license" for more information.
>>> import airflow
>>> from airflow import models, settings
>>> from airflow.contrib.auth.backends.password_auth import PasswordUser
>>> user = PasswordUser(models.User())
>>> user.username = 'new_user_name'
>>> user.email = 'new_user_email@example.com'
>>> user.password = 'set_the_password'
>>> session = settings.Session()
>>> session.add(user)
>>> session.commit()
>>> session.close()
>>> exit()
现在,当您尝试访问Web ui时,它将要求输入用户名和密码。当您注销时,将无法看到DAG。