mirror of
https://github.com/ceph/ceph
synced 2025-01-08 20:21:33 +00:00
mon: 'config-key put' -> 'config-key set'
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
ee06dc6996
commit
4eb1a518e3
@ -207,11 +207,11 @@ Usage::
|
||||
|
||||
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
|
||||
|
@ -23,8 +23,8 @@ Since each ``ceph-mgr`` hosts its own instance of dashboard, it may
|
||||
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.
|
||||
@ -32,8 +32,8 @@ 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 ``::``,
|
||||
|
@ -24,7 +24,7 @@ Configuration
|
||||
|
||||
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>`_.
|
||||
|
||||
|
@ -40,15 +40,15 @@ can be generated with a command similar to::
|
||||
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
|
||||
@ -62,16 +62,16 @@ Since each ``ceph-mgr`` hosts its own instance of *restful*, it may
|
||||
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 ``::``,
|
||||
|
@ -79,14 +79,14 @@ these are usually Monitors where the *client.admin* key is present.
|
||||
|
||||
::
|
||||
|
||||
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
|
||||
---------
|
||||
|
@ -2403,7 +2403,7 @@ function test_mon_tell_help_command()
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@ -2476,6 +2476,7 @@ MON_TESTS+=" auth_profiles"
|
||||
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"
|
||||
|
@ -265,11 +265,11 @@ def test_all():
|
||||
],
|
||||
'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')
|
||||
}
|
||||
]
|
||||
|
@ -226,10 +226,10 @@ def get_uuid():
|
||||
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
|
||||
|
||||
|
@ -592,7 +592,7 @@ void PyModules::set_config(const std::string &handle,
|
||||
|
||||
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();
|
||||
@ -603,10 +603,10 @@ void PyModules::set_config(const std::string &handle,
|
||||
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;
|
||||
}
|
||||
|
@ -184,7 +184,8 @@ bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
|
||||
}
|
||||
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.
|
||||
|
@ -201,6 +201,7 @@ void MonCapGrant::expand_profile_mon(const EntityName& name) const
|
||||
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));
|
||||
@ -213,6 +214,7 @@ void MonCapGrant::expand_profile_mon(const EntityName& name) const
|
||||
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));
|
||||
}
|
||||
|
@ -1015,10 +1015,15 @@ COMMAND("osd tier add-cache " \
|
||||
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")
|
||||
|
@ -39,7 +39,7 @@ IPv4 and IPv6 addresses.
|
||||
|
||||
::
|
||||
|
||||
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.
|
||||
|
||||
|
@ -794,7 +794,7 @@ class Module(MgrModule):
|
||||
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,
|
||||
|
@ -272,7 +272,7 @@ class Module(MgrModule):
|
||||
|
||||
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)
|
||||
|
@ -87,7 +87,7 @@ class Module(MgrModule):
|
||||
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)
|
||||
|
@ -33,7 +33,7 @@ function run() {
|
||||
|
||||
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
|
||||
|
||||
|
@ -236,6 +236,8 @@ TEST(MonCap, ProfileOSD) {
|
||||
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,
|
||||
|
@ -658,11 +658,11 @@ start_mgr() {
|
||||
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))
|
||||
|
Loading…
Reference in New Issue
Block a user