2017-07-29 208 views
0

我在Ubuntu 16.04上,我用pip安裝了Airflow。下一步氣流:無法連接到('0.0.0.0',8080)

airflow initdb 
[2017-07-29 12:20:23,483] {__init__.py:57} INFO - Using executor SequentialExecutor 
DB: sqlite:////home/milenko/airflow/airflow.db 
[2017-07-29 12:20:23,813] {db.py:287} INFO - Creating tables 
INFO [alembic.runtime.migration] Context impl SQLiteImpl. 

這工作fine.But當我嘗試啓動Web服務器

airflow webserver -p 8080 
[2017-07-29 12:20:45,913] [4585] {models.py:167} INFO - Filling up the DagBag from /home/milenko/airflow/dags 
Running the Gunicorn Server with: 
Workers: 4 sync 
Host: 0.0.0.0:8080 
Timeout: 120 
Logfiles: - - 
=================================================================    
[2017-07-29 12:20:46,950] {__init__.py:57} INFO - Using executor SequentialExecutor 
[2017-07-29 12:20:47 +0200] [4590] [INFO] Starting gunicorn 19.3.0 
[2017-07-29 12:20:47 +0200] [4590] [ERROR] Connection in use: ('0.0.0.0', 8080) 
[2017-07-29 12:20:47 +0200] [4590] [ERROR] Retrying in 1 second. 
[2017-07-29 12:20:48 +0200] [4590] [ERROR] Connection in use: ('0.0.0.0', 8080) 
[2017-07-29 12:20:48 +0200] [4590] [ERROR] Retrying in 1 second. 
[2017-07-29 12:20:49 +0200] [4590] [ERROR] Connection in use: ('0.0.0.0', 8080) 
[2017-07-29 12:20:49 +0200] [4590] [ERROR] Retrying in 1 second. 
[2017-07-29 12:20:50 +0200] [4590] [ERROR] Connection in use: ('0.0.0.0', 8080) 
[2017-07-29 12:20:50 +0200] [4590] [ERROR] Retrying in 1 second. 
[2017-07-29 12:20:51 +0200] [4590] [ERROR] Connection in use: ('0.0.0.0', 8080) 
[2017-07-29 12:20:51 +0200] [4590] [ERROR] Retrying in 1 second. 
[2017-07-29 12:20:52 +0200] [4590] [ERROR] Can't connect to ('0.0.0.0', 8080) 

如何解決此問題?這是Gunicorn服務器問題還是沒有? 用netstat我得到這個輸出

sudo netstat -nlp | grep :80 
tcp6  0  0 :::8080     :::*     LISTEN  1711/java 

據我瞭解端口處於use.But什麼是1711/java嗎?如果我關掉它不會影響別的東西嗎? 這是我的氣流配置文件

[webserver] 
# The base url of your website as airflow cannot guess what domain or 
# cname you are using. This is used in automated emails that 
# airflow sends to point links to the right web server 
base_url = http://localhost:8080 

# The ip specified when starting the web server 
web_server_host = 0.0.0.0 

# The port on which to run the web server 
web_server_port = 8080 

# Paths to the SSL certificate and key for the web server. When both are 
# provided SSL will be enabled. This does not change the web server port. 
web_server_ssl_cert = 
web_server_ssl_key = 

# Number of seconds the gunicorn webserver waits before timing out on a worker 
web_server_worker_timeout = 120 

# Number of workers to refresh at a time. When set to 0, worker refresh is 
# disabled. When nonzero, airflow periodically refreshes webserver workers by 
# bringing up new ones and killing old ones. 
worker_refresh_batch_size = 1 

# Number of seconds to wait before refreshing a batch of workers. 
worker_refresh_interval = 30 

# Secret key used to run your flask app 
secret_key = temporary_key 

# Number of workers to run the Gunicorn web server 
workers = 4 

# The worker class gunicorn should use. Choices include 
# sync (default), eventlet, gevent 
worker_class = sync 
+0

看來Web服務器偵聽端口8080上** **的IPv6您 需要配置服務器來監聽** **的IPv4也。你可以分享氣流配置文件嗎? – Vinny

+0

現在看看我的編輯。 – MishaVacic

+0

如果可以,請嘗試禁用NIC上的IPv6,以查看這是否解決了問題 – Vinny

回答

1

的相關部分爲了完整起見:這個問題由Thomas別處回答:

要麼停止使用已經端口8080或更改的Java應用程序Airflow的港口。

Source