diff --git a/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/Worker.scala b/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/Worker.scala index 88c8a61a6a1..c86296729d8 100644 --- a/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/Worker.scala +++ b/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/Worker.scala @@ -979,7 +979,9 @@ private[deploy] object Worker extends Logging { // much as possible. Therefore, if the user manually specifies the address of the Master when // starting the Worker, we should set it in the parameters and automatically calculate what the // address of the Master should be used in the end. - conf.set("rss.master.address", RpcAddress.fromRssURL(workerArgs.master).toString) + if (workerArgs.master != null) { + conf.set("rss.master.address", RpcAddress.fromRssURL(workerArgs.master).toString) + } val metricsSystem = MetricsSystem.createMetricsSystem("worker", conf, WorkerSource.ServletPath) diff --git a/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/WorkerArguments.scala b/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/WorkerArguments.scala index 188d1301d09..5a1a71f739a 100644 --- a/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/WorkerArguments.scala +++ b/server-worker/src/main/scala/com/aliyun/emr/rss/service/deploy/worker/WorkerArguments.scala @@ -28,7 +28,7 @@ class WorkerArguments(args: Array[String], conf: RssConf) { var port = 0 // var master: String = null // for local testing. - var master: String = s"rss://$host:9097" + var master: String = null var propertiesFile: String = null parse(args.toList) @@ -58,9 +58,6 @@ class WorkerArguments(args: Array[String], conf: RssConf) { parse(tail) case Nil => - if (master == null) { // No positional argument was given - printUsageAndExit(1) - } case _ => printUsageAndExit(1)