Merge branch '2.3' into develop
This commit is contained in:
@ -53,17 +53,17 @@ All command accept the following global options.
|
|||||||
--tsv Print tab separated output [boolean] [default: false]
|
--tsv Print tab separated output [boolean] [default: false]
|
||||||
|
|
||||||
HTTPS/TLS Options:
|
HTTPS/TLS Options:
|
||||||
-s, --secure Enable HTTPS requests [boolean] [default: false]
|
-s, --secure Enable HTTPS requests [boolean] [default: false]
|
||||||
--tls-key Path to TLS private key [string]
|
--tls-key Path to TLS private key [string]
|
||||||
--tls-cert Path to TLS public certificate [string]
|
--tls-passphrase Password for the TLS private key [string]
|
||||||
--tls-ca-cert Path to TLS CA certificate [string]
|
--tls-cert Path to TLS public certificate [string]
|
||||||
--tls-verify-server-cert Whether to verify server TLS certificates
|
--tls-ca-cert Path to TLS CA certificate [string]
|
||||||
|
-n, --tls-verify-server-cert Whether to verify server TLS certificates
|
||||||
[boolean] [default: true]
|
[boolean] [default: true]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--version Show version number [boolean]
|
--version Show version number [boolean]
|
||||||
--tls-passphrase Password for the TLS private key [string]
|
--help Show help [boolean]
|
||||||
--help Show help [boolean]
|
|
||||||
|
|
||||||
If no commands are given, maxctrl is started in interactive mode. Use `exit` to
|
If no commands are given, maxctrl is started in interactive mode. Use `exit` to
|
||||||
exit the interactive mode.
|
exit the interactive mode.
|
||||||
@ -83,7 +83,7 @@ Commands:
|
|||||||
filters List filters
|
filters List filters
|
||||||
modules List loaded modules
|
modules List loaded modules
|
||||||
threads List threads
|
threads List threads
|
||||||
users List created network users
|
users List created users
|
||||||
commands List module commands
|
commands List module commands
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -140,7 +140,8 @@ List all worker threads.
|
|||||||
|
|
||||||
`Usage: list users`
|
`Usage: list users`
|
||||||
|
|
||||||
List the users that can be used to connect to the MaxScale REST API.
|
List network the users that can be used to connect to the MaxScale REST API as
|
||||||
|
well as enabled local accounts.
|
||||||
|
|
||||||
### list commands
|
### list commands
|
||||||
|
|
||||||
@ -298,6 +299,10 @@ Usage: set <command>
|
|||||||
Commands:
|
Commands:
|
||||||
server <server> <state> Set server state
|
server <server> <state> Set server state
|
||||||
|
|
||||||
|
Set options:
|
||||||
|
--force Forcefully close all connections to the target server
|
||||||
|
[boolean] [default: false]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### set server
|
### set server
|
||||||
@ -471,6 +476,8 @@ The last argument to this command is a list of key=value parameters given as the
|
|||||||
service parameters. If the --servers or --filters options are used, they must be
|
service parameters. If the --servers or --filters options are used, they must be
|
||||||
defined after the service parameters.
|
defined after the service parameters.
|
||||||
|
|
||||||
|
Note that the `user` and `password` parameters must be defined.
|
||||||
|
|
||||||
### create filter
|
### create filter
|
||||||
|
|
||||||
`Usage: filter <name> <module> [params...]`
|
`Usage: filter <name> <module> [params...]`
|
||||||
@ -610,7 +617,7 @@ Usage: start <command>
|
|||||||
Commands:
|
Commands:
|
||||||
service <name> Start a service
|
service <name> Start a service
|
||||||
monitor <name> Start a monitor
|
monitor <name> Start a monitor
|
||||||
maxscale Start MaxScale by starting all services
|
services Start all services [aliases: maxscale]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -626,9 +633,9 @@ This starts a service stopped by `stop service <name>`
|
|||||||
|
|
||||||
This starts a monitor stopped by `stop monitor <name>`
|
This starts a monitor stopped by `stop monitor <name>`
|
||||||
|
|
||||||
### start maxscale
|
### start services
|
||||||
|
|
||||||
`Usage: start maxscale`
|
`Usage: start [services|maxscale]`
|
||||||
|
|
||||||
This command will execute the `start service` command for all services in
|
This command will execute the `start service` command for all services in
|
||||||
MaxScale.
|
MaxScale.
|
||||||
@ -641,7 +648,7 @@ Usage: stop <command>
|
|||||||
Commands:
|
Commands:
|
||||||
service <name> Stop a service
|
service <name> Stop a service
|
||||||
monitor <name> Stop a monitor
|
monitor <name> Stop a monitor
|
||||||
maxscale Stop MaxScale by stopping all services
|
services Stop all services [aliases: maxscale]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -660,9 +667,9 @@ until they are closed.
|
|||||||
Stopping a monitor will pause the monitoring of the servers. This can be used to
|
Stopping a monitor will pause the monitoring of the servers. This can be used to
|
||||||
manually control server states with the `set server` command.
|
manually control server states with the `set server` command.
|
||||||
|
|
||||||
### stop maxscale
|
### stop services
|
||||||
|
|
||||||
`Usage: stop maxscale`
|
`Usage: stop [services|maxscale]`
|
||||||
|
|
||||||
This command will execute the `stop service` command for all services in
|
This command will execute the `stop service` command for all services in
|
||||||
MaxScale.
|
MaxScale.
|
||||||
@ -679,6 +686,7 @@ Commands:
|
|||||||
service-filters <service> [filters...] Alter filters of a service
|
service-filters <service> [filters...] Alter filters of a service
|
||||||
logging <key> <value> Alter logging parameters
|
logging <key> <value> Alter logging parameters
|
||||||
maxscale <key> <value> Alter MaxScale parameters
|
maxscale <key> <value> Alter MaxScale parameters
|
||||||
|
user <name> <password> Alter admin user passwords
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -698,8 +706,11 @@ To display the monitor parameters, execute `show monitor <monitor>`
|
|||||||
|
|
||||||
`Usage: alter service <service> <key> <value>`
|
`Usage: alter service <service> <key> <value>`
|
||||||
|
|
||||||
To display the service parameters, execute `show service <service>`. The
|
To display the service parameters, execute `show service <service>`. Some
|
||||||
following list of parameters can be altered at runtime:
|
routers support runtime configuration changes to all parameters. Currently all
|
||||||
|
readconnroute, readwritesplit and schemarouter parameters can be changed at
|
||||||
|
runtime. In addition to module specific parameters, the following list of common
|
||||||
|
service parameters can be altered at runtime:
|
||||||
|
|
||||||
[
|
[
|
||||||
"user",
|
"user",
|
||||||
@ -712,7 +723,8 @@ following list of parameters can be altered at runtime:
|
|||||||
"strip_db_esc",
|
"strip_db_esc",
|
||||||
"localhost_match_wildcard_host",
|
"localhost_match_wildcard_host",
|
||||||
"max_slave_connections",
|
"max_slave_connections",
|
||||||
"max_slave_replication_lag"
|
"max_slave_replication_lag",
|
||||||
|
"retain_last_statements"
|
||||||
]
|
]
|
||||||
|
|
||||||
### alter service-filters
|
### alter service-filters
|
||||||
@ -747,9 +759,22 @@ of parameters can be altered at runtime:
|
|||||||
"auth_write_timeout",
|
"auth_write_timeout",
|
||||||
"admin_auth",
|
"admin_auth",
|
||||||
"admin_log_auth_failures",
|
"admin_log_auth_failures",
|
||||||
"passive"
|
"passive",
|
||||||
|
"ms_timestamp",
|
||||||
|
"skip_permission_checks",
|
||||||
|
"query_retries",
|
||||||
|
"query_retry_timeout",
|
||||||
|
"retain_last_statements",
|
||||||
|
"dump_last_statements"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
### alter user
|
||||||
|
|
||||||
|
`Usage: alter user <name> <password>`
|
||||||
|
|
||||||
|
Changes the password for a user. To change the user type, destroy the user and
|
||||||
|
then create it again.
|
||||||
|
|
||||||
## rotate
|
## rotate
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -197,7 +197,8 @@ exports.builder = function(yargs) {
|
|||||||
.command('service <name> <router> <params...>', 'Create a new service', function(yargs) {
|
.command('service <name> <router> <params...>', 'Create a new service', function(yargs) {
|
||||||
return yargs.epilog('The last argument to this command is a list of key=value parameters ' +
|
return yargs.epilog('The last argument to this command is a list of key=value parameters ' +
|
||||||
'given as the service parameters. If the --servers or --filters options ' +
|
'given as the service parameters. If the --servers or --filters options ' +
|
||||||
'are used, they must be defined after the service parameters.')
|
'are used, they must be defined after the service parameters.' +
|
||||||
|
'\n\nNote that the `user` and `password` parameters must be defined.')
|
||||||
.usage('Usage: service <name> <router> <params...>')
|
.usage('Usage: service <name> <router> <params...>')
|
||||||
.group(['servers', 'filters'], 'Create service options:')
|
.group(['servers', 'filters'], 'Create service options:')
|
||||||
.option('servers', {
|
.option('servers', {
|
||||||
|
@ -42,17 +42,18 @@ struct WORKER_STATISTICS
|
|||||||
N_QUEUE_TIMES = 30
|
N_QUEUE_TIMES = 30
|
||||||
};
|
};
|
||||||
|
|
||||||
int64_t n_read = 0; /*< Number of read events */
|
int64_t n_read = 0; /*< Number of read events */
|
||||||
int64_t n_write = 0; /*< Number of write events */
|
int64_t n_write = 0; /*< Number of write events */
|
||||||
int64_t n_error = 0; /*< Number of error events */
|
int64_t n_error = 0; /*< Number of error events */
|
||||||
int64_t n_hup = 0; /*< Number of hangup events */
|
int64_t n_hup = 0; /*< Number of hangup events */
|
||||||
int64_t n_accept = 0; /*< Number of accept events */
|
int64_t n_accept = 0; /*< Number of accept events */
|
||||||
int64_t n_polls = 0; /*< Number of poll cycles */
|
int64_t n_polls = 0; /*< Number of poll cycles */
|
||||||
int64_t n_pollev = 0; /*< Number of polls returning events */
|
int64_t n_pollev = 0; /*< Number of polls returning events */
|
||||||
int64_t evq_avg = 0; /*< Average event queue length */
|
int64_t evq_avg = 0; /*< Average event queue length */
|
||||||
int64_t evq_max = 0; /*< Maximum event queue length */
|
int64_t evq_max = 0; /*< Maximum event queue length */
|
||||||
int64_t maxqtime = 0;
|
int64_t maxqtime = 0;
|
||||||
int64_t maxexectime = 0;
|
int64_t maxexectime = 0;
|
||||||
|
|
||||||
std::array<int64_t, MAXNFDS> n_fds {}; /*< Number of wakeups with particular n_fds value */
|
std::array<int64_t, MAXNFDS> n_fds {}; /*< Number of wakeups with particular n_fds value */
|
||||||
std::array<uint32_t, N_QUEUE_TIMES + 1> qtimes {};
|
std::array<uint32_t, N_QUEUE_TIMES + 1> qtimes {};
|
||||||
std::array<uint32_t, N_QUEUE_TIMES + 1> exectimes {};
|
std::array<uint32_t, N_QUEUE_TIMES + 1> exectimes {};
|
||||||
|
@ -523,9 +523,19 @@ bool Worker::call(function<void ()> func, execute_mode_t mode)
|
|||||||
bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2)
|
bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2)
|
||||||
{
|
{
|
||||||
// NOTE: No logging here, this function must be signal safe.
|
// NOTE: No logging here, this function must be signal safe.
|
||||||
MessageQueue::Message message(msg_id, arg1, arg2);
|
bool rval = false;
|
||||||
|
|
||||||
return m_pQueue->post(message);
|
// TODO: Enable and fix this in develop and/or 2.4: The deletion of rworker_local is done after the
|
||||||
|
// workers have stopped and it triggers this assertion.
|
||||||
|
// mxb_assert(state() != Worker::STOPPED);
|
||||||
|
|
||||||
|
if (state() != Worker::STOPPED)
|
||||||
|
{
|
||||||
|
MessageQueue::Message message(msg_id, arg1, arg2);
|
||||||
|
rval = m_pQueue->post(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Worker::run(mxb::Semaphore* pSem)
|
void Worker::run(mxb::Semaphore* pSem)
|
||||||
|
@ -420,6 +420,7 @@ bool mxs_admin_init()
|
|||||||
void mxs_admin_shutdown()
|
void mxs_admin_shutdown()
|
||||||
{
|
{
|
||||||
MHD_stop_daemon(http_daemon);
|
MHD_stop_daemon(http_daemon);
|
||||||
|
MXS_NOTICE("Stopped MaxScale REST API");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mxs_admin_https_enabled()
|
bool mxs_admin_https_enabled()
|
||||||
|
@ -2248,9 +2248,6 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
main_worker->run();
|
main_worker->run();
|
||||||
|
|
||||||
/** Stop administrative interface */
|
|
||||||
mxs_admin_shutdown();
|
|
||||||
|
|
||||||
/*< Stop all monitors */
|
/*< Stop all monitors */
|
||||||
MonitorManager::stop_all_monitors();
|
MonitorManager::stop_all_monitors();
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "internal/maxscale.hh"
|
#include "internal/maxscale.hh"
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
|
#include "internal/admin.hh"
|
||||||
|
|
||||||
static time_t started;
|
static time_t started;
|
||||||
|
|
||||||
@ -51,12 +52,18 @@ int maxscale_shutdown()
|
|||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
{
|
{
|
||||||
if (mxs::MainWorker::created())
|
auto func = []() {
|
||||||
{
|
if (mxs::MainWorker::created())
|
||||||
mxs::MainWorker::get().shutdown();
|
{
|
||||||
}
|
mxs::MainWorker::get().shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
mxs::RoutingWorker::shutdown_all();
|
mxs_admin_shutdown();
|
||||||
|
mxs::RoutingWorker::shutdown_all();
|
||||||
|
};
|
||||||
|
|
||||||
|
auto w = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
|
||||||
|
w->execute(func, nullptr, mxs::RoutingWorker::EXECUTE_QUEUED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return n + 1;
|
return n + 1;
|
||||||
|
Reference in New Issue
Block a user