@@ -37,6 +37,8 @@ struct rados_kv_parameter {
char *userid;
/** Pool for client info */
char *pool;
+ /** Node ID for this cluster node */
+ uint32_t nodeid;
};
extern struct rados_kv_parameter rados_kv_param;
@@ -32,6 +32,8 @@ static struct config_item rados_kv_params[] = {
rados_kv_parameter, userid),
CONF_ITEM_STR("pool", 1, MAXPATHLEN, DEFAULT_POOL,
rados_kv_parameter, pool),
+ CONF_ITEM_UI32("nodeid", 0, UINT32_MAX, UINT32_MAX,
+ rados_kv_parameter, nodeid),
CONFIG_EOL
};
@@ -350,8 +352,8 @@ void rados_kv_init(void)
int ret;
char host[NI_MAXHOST];
- if (nfs_param.core_param.clustered) {
- snprintf(host, sizeof(host), "node%d", g_nodeid);
+ if (rados_kv_param.nodeid != UINT32_MAX) {
+ snprintf(host, sizeof(host), "node%d", rados_kv_param.nodeid);
} else {
ret = gethostname(host, sizeof(host));
if (ret) {
@@ -117,8 +117,8 @@ static void rados_ng_init(void)
char host[NI_MAXHOST];
rados_write_op_t op;
- if (nfs_param.core_param.clustered) {
- snprintf(host, sizeof(host), "node%d", g_nodeid);
+ if (rados_kv_param.nodeid != UINT32_MAX) {
+ snprintf(host, sizeof(host), "node%d", rados_kv_param.nodeid);
} else {
ret = gethostname(host, sizeof(host));
if (ret) {
@@ -730,6 +730,8 @@ RADOS_KV {}
pool(string, no default)
+ nodeid(uint32, default UINT32_MAX)
+
RADOS_URLS {}
--------
@@ -305,3 +305,7 @@ userid(path, no default)
pool(string, no default)
Pool for client info.
+
+nodeid(uint32, range 0 to UINT32_MAX, default UINT32_MAX)
+ The nodeid value for this cluster node. Defaults to UINT32_MAX which is a
+ special value meaning "non-clustered".