《Airflow webserver 启动选项配置》

《Airflow webserver 启动选项配置》

airflow webserver 可以在指定端口和 IP 上启动 Web 管理界面。

1 支持的选项参数

airflow webserver -h usage: airflow webserver [-h] [-p PORT] [-w WORKERS] [-k {sync,eventlet,gevent,tornado}] [-t WORKER_TIMEOUT] [-hn HOSTNAME] [--pid [PID]] [-D] [--stdout STDOUT] [--stderr STDERR] [-A ACCESS_LOGFILE] [-E ERROR_LOGFILE] [-l LOG_FILE] [--ssl_cert SSL_CERT] [--ssl_key SSL_KEY] [-d] optional arguments: -h, --help show this help message and exit -p PORT, --port PORT The port on which to run the server -w WORKERS, --workers WORKERS Number of workers to run the webserver on -k {sync,eventlet,gevent,tornado}, --workerclass The worker class to use for Gunicorn -t WORKER_TIMEOUT The timeout for waiting on webserver workers -hn HOSTNAME, --hostname HOSTNAME Set the hostname on which to run the web server --pid [PID] PID file location -D, --daemon Daemonize instead of running in the foreground --stdout STDOUT Redirect stdout to this file --stderr STDERR Redirect stderr to this file -A ACCESS_LOGFILE The logfile to store the webserver access log -E ERROR_LOGFILE The logfile to store the webserver error log -l LOG_FILE Location of the log file --ssl_cert SSL_CERT Path to the SSL certificate for the webserver --ssl_key SSL_KEY Path to the key to use with the SSL certificate -d, --debug Use the server that ships with Flask in debug mode

2 启动示例(后台守护)

airflow webserver -D -p 8999 -w 1 -hn 0.0.0.0 --pid /root/airflow.pid \ --stdout /root/airflow-info.log --stderr /root/airflow-error.log \ --log-file /root/airflow.log --access_logfile /root/access.log --error_logfile /root/error.log
  • -D, --daemon:以后台守护方式运行。
  • -w 1:只启动 1 个 worker,减少资源占用。
  • -hn:绑定监听地址,局域网访问可设为 0.0.0.0。

3 访问

浏览器打开管理界面:

http://<server-ip>:8999/admin/
阅读 — · 全站 —
🎸 我的歌单 0 首