Repository: incubator-airflow
Updated Branches:
  refs/heads/master 5ee0209cb -> 587bfa826


[AIRFLOW-1356] Add `--celery_hostname` to `airflow worker`

Closes #2405 from d2207197/airflow-1356


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/587bfa82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/587bfa82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/587bfa82

Branch: refs/heads/master
Commit: 587bfa8261d5d82e93b1fe504eefaece97e213b7
Parents: 5ee0209
Author: 顏孜羲 <joseph....@gmail.com>
Authored: Wed Sep 20 10:07:48 2017 -0700
Committer: Chris Riccomini <criccom...@apache.org>
Committed: Wed Sep 20 10:07:55 2017 -0700

----------------------------------------------------------------------
 airflow/bin/cli.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/587bfa82/airflow/bin/cli.py
----------------------------------------------------------------------
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index 5035a66..a24ed5e 100755
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -862,6 +862,7 @@ def worker(args):
         'O': 'fair',
         'queues': args.queues,
         'concurrency': args.concurrency,
+        'hostname': args.celery_hostname,
     }
 
     if args.daemon:
@@ -1379,6 +1380,10 @@ class CLIFactory(object):
             type=int,
             help="The number of worker processes",
             default=conf.get('celery', 'celeryd_concurrency')),
+        'celery_hostname': Arg(
+            ("-cn", "--celery_hostname"),
+            help=("Set the hostname of celery worker "
+                  "if you have multiple workers on a single machine.")),
         # flower
         'broker_api': Arg(("-a", "--broker_api"), help="Broker api"),
         'flower_hostname': Arg(
@@ -1538,7 +1543,7 @@ class CLIFactory(object):
         }, {
             'func': worker,
             'help': "Start a Celery worker node",
-            'args': ('do_pickle', 'queues', 'concurrency',
+            'args': ('do_pickle', 'queues', 'concurrency', 'celery_hostname',
                      'pid', 'daemon', 'stdout', 'stderr', 'log_file'),
         }, {
             'func': flower,

Reply via email to