ceph config-key dump
-Subcommand ``put`` puts configuration key and value.
+Subcommand ``set`` puts configuration key and value.
Usage::
- ceph config-key put <key> {<val>}
+ ceph config-key set <key> {<val>}
daemon
also be necessary to configure them separately. The hostname and port
can be changed via the configuration key facility::
- ceph config-key put mgr/dashboard/$name/server_addr $IP
- ceph config-key put mgr/dashboard/$name/server_port $PORT
+ ceph config-key set mgr/dashboard/$name/server_addr $IP
+ ceph config-key set mgr/dashboard/$name/server_port $PORT
where ``$name`` is the ID of the ceph-mgr who is hosting this
dashboard web app.
These settings can also be configured cluster-wide and not manager
specific. For example,::
- ceph config-key put mgr/dashboard/server_addr $IP
- ceph config-key put mgr/dashboard/server_port $PORT
+ ceph config-key set mgr/dashboard/server_addr $IP
+ ceph config-key set mgr/dashboard/server_port $PORT
If the port is not configured, the web app will bind to port ``7000``.
If the address it not configured, the web app will bind to ``::``,
By default the module will accept HTTP requests on port ``9283`` on all
IPv4 and IPv6 addresses on the host. The port and listen address are both
-configurable with ``ceph config-key put``, with keys
+configurable with ``ceph config-key set``, with keys
``mgr/prometheus/server_addr`` and ``mgr/prometheus/server_port``.
This port is registered with Prometheus's `registry <https://github.com/prometheus/prometheus/wiki/Default-port-allocations>`_.
The ``restful.crt`` should then be signed by your organization's CA
(certificate authority). Once that is done, you can set it with::
- ceph config-key put mgr/restful/$name/crt -i restful.crt
- ceph config-key put mgr/restful/$name/key -i restful.key
+ ceph config-key set mgr/restful/$name/crt -i restful.crt
+ ceph config-key set mgr/restful/$name/key -i restful.key
where ``$name`` is the name of the ``ceph-mgr`` instance (usually the
hostname). If all manager instances are to share the same certificate,
you can leave off the ``$name`` portion::
- ceph config-key put mgr/restful/crt -i restful.crt
- ceph config-key put mgr/restful/key -i restful.key
+ ceph config-key set mgr/restful/crt -i restful.crt
+ ceph config-key set mgr/restful/key -i restful.key
Configuring IP and port
also be necessary to configure them separately. The IP and port
can be changed via the configuration key facility::
- ceph config-key put mgr/restful/$name/server_addr $IP
- ceph config-key put mgr/restful/$name/server_port $PORT
+ ceph config-key set mgr/restful/$name/server_addr $IP
+ ceph config-key set mgr/restful/$name/server_port $PORT
where ``$name`` is the ID of the ceph-mgr daemon (usually the hostname).
These settings can also be configured cluster-wide and not manager
specific. For example,::
- ceph config-key put mgr/restful/server_addr $IP
- ceph config-key put mgr/restful/server_port $PORT
+ ceph config-key set mgr/restful/server_addr $IP
+ ceph config-key set mgr/restful/server_port $PORT
If the port is not configured, *restful* will bind to port ``8003``.
If the address it not configured, the *restful* will bind to ``::``,
::
- ceph config-key put <key> <value>
+ ceph config-key set <key> <value>
For example:
::
- ceph config-key put mgr/zabbix/zabbix_host zabbix.localdomain
- ceph config-key put mgr/zabbix/identifier ceph.eu-ams02.local
+ ceph config-key set mgr/zabbix/zabbix_host zabbix.localdomain
+ ceph config-key set mgr/zabbix/identifier ceph.eu-ams02.local
Debugging
---------
function test_mon_stdin_stdout()
{
- echo foo | ceph config-key put test_key -i -
+ echo foo | ceph config-key set test_key -i -
ceph config-key get test_key -o - | grep -c foo | grep -q 1
}
MON_TESTS+=" mon_misc"
MON_TESTS+=" mon_mon"
MON_TESTS+=" mon_osd"
+MON_TESTS+=" mon_config_key"
MON_TESTS+=" mon_crush"
MON_TESTS+=" mon_osd_create_destroy"
MON_TESTS+=" mon_osd_pool"
],
'config-key':[
{
- 'pre':'config-key put foo bar',
+ 'pre':'config-key set foo bar',
'cmd':('config-key get', 'key=foo', 'r')
},
{
- 'pre':'config-key put foo bar',
+ 'pre':'config-key set foo bar',
'cmd':('config-key del', 'key=foo', 'rw')
}
]
if rc:
#uuid is not yet set.
uid = str(uuid.uuid4())
- (rc, o, e) = run_command(['ceph', 'config-key', 'put',
+ (rc, o, e) = run_command(['ceph', 'config-key', 'set',
CLUSTER_UUID_NAME, uid])
if rc:
- raise RuntimeError("\'ceph config-key put\' failed -" + e)
+ raise RuntimeError("\'ceph config-key set\' failed -" + e)
return uid
JSONFormatter jf;
jf.open_object_section("cmd");
- jf.dump_string("prefix", "config-key put");
+ jf.dump_string("prefix", "config-key set");
jf.dump_string("key", global_key);
jf.dump_string("val", val);
jf.close_section();
set_cmd.wait();
if (set_cmd.r != 0) {
- // config-key put will fail if mgr's auth key has insufficient
+ // config-key set will fail if mgr's auth key has insufficient
// permission to set config keys
// FIXME: should this somehow raise an exception back into Python land?
- dout(0) << "`config-key put " << global_key << " " << val << "` failed: "
+ dout(0) << "`config-key set " << global_key << " " << val << "` failed: "
<< cpp_strerror(set_cmd.r) << dendl;
dout(0) << "mon returned " << set_cmd.r << ": " << set_cmd.outs << dendl;
}
}
ss << "obtained '" << key << "'";
- } else if (prefix == "config-key put") {
+ } else if (prefix == "config-key put" ||
+ prefix == "config-key set") {
if (!mon->is_leader()) {
mon->forward_request_leader(op);
// we forward the message; so return now.
StringConstraint constraint(StringConstraint::MATCH_TYPE_PREFIX,
"daemon-private/mgr/");
profile_grants.push_back(MonCapGrant("config-key get", "key", constraint));
+ profile_grants.push_back(MonCapGrant("config-key set", "key", constraint));
profile_grants.push_back(MonCapGrant("config-key put", "key", constraint));
profile_grants.push_back(MonCapGrant("config-key exists", "key", constraint));
profile_grants.push_back(MonCapGrant("config-key delete", "key", constraint));
string prefix = string("daemon-private/") + stringify(name) + string("/");
profile_grants.push_back(MonCapGrant("config-key get", "key", constraint));
profile_grants.push_back(MonCapGrant("config-key put", "key", constraint));
+ profile_grants.push_back(MonCapGrant("config-key set", "key", constraint));
profile_grants.push_back(MonCapGrant("config-key exists", "key", constraint));
profile_grants.push_back(MonCapGrant("config-key delete", "key", constraint));
}
COMMAND("config-key get " \
"name=key,type=CephString", \
"get <key>", "config-key", "r", "cli,rest")
-COMMAND("config-key put " \
+COMMAND("config-key set " \
"name=key,type=CephString " \
"name=val,type=CephString,req=false", \
- "put <key>, value <val>", "config-key", "rw", "cli,rest")
+ "set <key> to value <val>", "config-key", "rw", "cli,rest")
+COMMAND_WITH_FLAG("config-key put " \
+ "name=key,type=CephString " \
+ "name=val,type=CephString,req=false", \
+ "put <key>, value <val>", "config-key", "rw", "cli,rest",
+ FLAG(DEPRECATED))
COMMAND("config-key del " \
"name=key,type=CephString", \
"delete <key>", "config-key", "rw", "cli,rest")
::
- ceph config-key put mgr/dashboard/server_addr ::
+ ceph config-key set mgr/dashboard/server_addr ::
Restart the ceph-mgr daemon after modifying the setting to load the module.
server_addr = self.get_localized_config('server_addr', '::')
server_port = self.get_localized_config('server_port', '7000')
if server_addr is None:
- raise RuntimeError('no server_addr configured; try "ceph config-key put mgr/dashboard/server_addr <ip>"')
+ raise RuntimeError('no server_addr configured; try "ceph config-key set mgr/dashboard/server_addr <ip>"')
log.info("server_addr: %s server_port: %s" % (server_addr, server_port))
cherrypy.config.update({
'server.socket_host': server_addr,
server_addr = self.get_localized_config('server_addr', '::')
if server_addr is None:
- raise RuntimeError('no server_addr configured; try "ceph config-key put mgr/restful/server_addr <ip>"')
+ raise RuntimeError('no server_addr configured; try "ceph config-key set mgr/restful/server_addr <ip>"')
server_port = int(self.get_localized_config('server_port', '8003'))
self.log.info('server_addr: %s server_port: %d',
server_addr, server_port)
value = self.get_localized_config(key, default)
if value is None:
raise RuntimeError('Configuration key {0} not set; "ceph '
- 'config-key put mgr/zabbix/{0} '
+ 'config-key set mgr/zabbix/{0} '
'<value>"'.format(key))
self.set_config_option(key, value)
timeout 360 ceph --mon-host $MON mon stat || return 1
export CEPH_ARGS="--mon_host $MON "
- ceph config-key put mgr/x/dashboard/server_port 7001
+ ceph config-key set mgr/x/dashboard/server_port 7001
MGR_ARGS+="--mgr_module_path=${CEPH_ROOT}/src/pybind/mgr "
run_mgr $dir x ${MGR_ARGS} || return 1
name, "", "config-key get", ca, true, true, true));
ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
name, "", "config-key put", ca, true, true, true));
+ ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
+ name, "", "config-key set", ca, true, true, true));
ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
name, "", "config-key exists", ca, true, true, true));
ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
host = $HOSTNAME
EOF
- ceph_adm config-key put mgr/dashboard/$name/server_port $MGR_PORT
+ ceph_adm config-key set mgr/dashboard/$name/server_port $MGR_PORT
DASH_URLS+="http://$IP:$MGR_PORT/"
MGR_PORT=$(($MGR_PORT + 1000))
- ceph_adm config-key put mgr/restful/$name/server_port $MGR_PORT
+ ceph_adm config-key set mgr/restful/$name/server_port $MGR_PORT
RESTFUL_URLS+="https://$IP:$MGR_PORT"
MGR_PORT=$(($MGR_PORT + 1000))