summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-10-23 12:03:42 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-10-23 12:03:42 -0700
commitdeecb5b0b617a6fc56951eb21733d18540b474b6 (patch)
tree14e7c19a1c3e0bbc1553af22aa539d2a123bb837
parent455fcfc68f4201ed2451500392e038ba87db8a90 (diff)
downloadceph-wip-mongoose-2.tar.gz
rgw: configurable mongoose portwip-mongoose-2
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/common/config_opts.h2
-rw-r--r--src/rgw/rgw_main.cc20
2 files changed, 16 insertions, 6 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index 0b3938ecb9e..ef9d4bd0746 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -727,6 +727,8 @@ OPTION(rgw_bucket_quota_ttl, OPT_INT, 600) // time for cached bucket stats to be
OPTION(rgw_bucket_quota_soft_threshold, OPT_DOUBLE, 0.95) // threshold from which we don't rely on cached info for quota decisions
OPTION(rgw_bucket_quota_cache_size, OPT_INT, 10000) // number of entries in bucket quota cache
+OPTION(rgw_standalone_server_port, OPT_INT, 0) // 0 means disabled
+
OPTION(mutex_perf_counter, OPT_BOOL, false) // enable/disable mutex perf counter
// This will be set to true when it is safe to start threads.
diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc
index 2343bd61b93..1ba93d8a7ae 100644
--- a/src/rgw/rgw_main.cc
+++ b/src/rgw/rgw_main.cc
@@ -730,13 +730,19 @@ int main(int argc, const char **argv)
olog->init(g_conf->rgw_ops_log_socket_path);
}
- struct mg_context *ctx;
- const char *options[] = {"listening_ports", "8080", "enable_keep_alive", "yes", NULL};
-
+ bool use_mongoose = (g_conf->rgw_standalone_server_port != 0);
+ struct mg_context *ctx = NULL;
RGWProcessEnv pe = { store, &rest, olog };
- ctx = mg_start((const char **)&options, &mongoose_callback, &pe);
- assert(ctx);
+ if (use_mongoose) {
+ char port_buf[32];
+ snprintf(port_buf, sizeof(port_buf), "%d", (int)g_conf->rgw_standalone_server_port);
+
+ const char *options[] = {"listening_ports", "8080", "enable_keep_alive", "yes", NULL};
+
+ ctx = mg_start((const char **)&options, &mongoose_callback, &pe);
+ assert(ctx);
+ }
RGWProcess *pprocess = new RGWProcess(g_ceph_context, &pe, g_conf->rgw_thread_pool_size);
@@ -750,7 +756,9 @@ int main(int argc, const char **argv)
pprocess->run();
- mg_stop(ctx);
+ if (use_mongoose) {
+ mg_stop(ctx);
+ }
derr << "shutting down" << dendl;