Merge branch '2.2' into develop
This commit is contained in:
commit
0da0306ace
@ -375,41 +375,7 @@ GET /v1/services/:name/listeners
|
||||
}
|
||||
```
|
||||
|
||||
### Get service listeners
|
||||
|
||||
Get the listeners of a service. The _:name_ in the URI must be a valid service
|
||||
name with all whitespace replaced with hyphens.
|
||||
|
||||
```
|
||||
GET /v1/services/:name/listeners
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
`Status: 200 OK`
|
||||
|
||||
```javascript
|
||||
{
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/services/Read-Connection-Router/listeners"
|
||||
},
|
||||
"data": [
|
||||
{
|
||||
"attributes": {
|
||||
"parameters": {
|
||||
"port": 4008,
|
||||
"protocol": "MariaDBClient",
|
||||
"authenticator": "MySQLAuth"
|
||||
}
|
||||
},
|
||||
"id": "Read-Connection-Listener",
|
||||
"type": "listeners"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Get a sigle service listener
|
||||
### Get a single service listener
|
||||
|
||||
Get the listeners of a service. The _:name_ in the URI must be a valid service
|
||||
name and _:listener_ must be a valid listener name, both with all whitespace
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version")
|
||||
set(MAXSCALE_VERSION_MINOR "1" CACHE STRING "Minor version")
|
||||
set(MAXSCALE_VERSION_PATCH "17" CACHE STRING "Patch version")
|
||||
set(MAXSCALE_VERSION_PATCH "18" CACHE STRING "Patch version")
|
||||
|
||||
# This should only be incremented if a package is rebuilt
|
||||
set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number")
|
||||
|
@ -10,7 +10,7 @@ elseif(EXISTS ${SLES_FNC})
|
||||
elseif(EXISTS ${DEB_FNC})
|
||||
set(USE_DEB TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
|
||||
else()
|
||||
message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.")
|
||||
message(STATUS "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, will not install init scripts.")
|
||||
endif()
|
||||
|
||||
if(USE_DEB)
|
||||
@ -18,7 +18,10 @@ if(USE_DEB)
|
||||
elseif(USE_RPM)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||
elseif(USE_SLES)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||
else()
|
||||
# Use a dummy file that tells the user that init scripts aren't supported on this platform
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/fallback/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY)
|
||||
|
4
etc/fallback/maxscale.in
Executable file
4
etc/fallback/maxscale.in
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Init scripts are not supported on this platform, use either systemd or launch MaxScale manually"
|
||||
exit 1
|
@ -10,28 +10,31 @@ int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
|
||||
auto do_test = [&]()
|
||||
{
|
||||
test.set_timeout(20);
|
||||
test.maxscales->connect();
|
||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
||||
test.maxscales->disconnect();
|
||||
test.stop_timeout();
|
||||
};
|
||||
|
||||
test.tprintf("Testing with both master and slave up");
|
||||
test.maxscales->connect();
|
||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
||||
test.maxscales->disconnect();
|
||||
do_test();
|
||||
|
||||
test.tprintf("Testing with only the master");
|
||||
test.repl->block_node(0);
|
||||
sleep(5);
|
||||
test.maxscales->connect();
|
||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
||||
test.maxscales->disconnect();
|
||||
test.maxscales->wait_for_monitor();
|
||||
do_test();
|
||||
test.repl->unblock_node(0);
|
||||
sleep(5);
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
test.tprintf("Testing with only the slave");
|
||||
test.repl->block_node(1);
|
||||
sleep(5);
|
||||
test.maxscales->connect();
|
||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
||||
test.maxscales->disconnect();
|
||||
test.maxscales->wait_for_monitor();
|
||||
do_test();
|
||||
test.repl->unblock_node(1);
|
||||
sleep(5);
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
test.tprintf("Checking that both the master and slave are used");
|
||||
std::vector<MYSQL*> connections;
|
||||
@ -45,10 +48,12 @@ int main(int argc, char** argv)
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
// Open a connection and make sure it works
|
||||
test.set_timeout(20);
|
||||
MYSQL* conn = open_conn(test.maxscales->readconn_master_port[0], test.maxscales->IP[0],
|
||||
"mxs1743", "mxs1743", false);
|
||||
test.try_query(conn, "SELECT 1");
|
||||
connections.push_back(conn);
|
||||
test.stop_timeout();
|
||||
}
|
||||
|
||||
// Give the connections a few seconds to establish
|
||||
|
@ -73,7 +73,7 @@ void AuroraMonitor::update_server_status(MXS_MONITORED_SERVER* monitored_server)
|
||||
int status = SERVER_SLAVE;
|
||||
|
||||
/** The master will return a row with two identical non-NULL fields */
|
||||
if (row[0] && row[1] && strcmp(row[0], row[1]) == 0)
|
||||
if (row && row[0] && row[1] && strcmp(row[0], row[1]) == 0)
|
||||
{
|
||||
status = SERVER_MASTER;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user