Merge branch '2.2' into develop
This commit is contained in:
@ -375,41 +375,7 @@ GET /v1/services/:name/listeners
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Get service listeners
|
### Get a single service listener
|
||||||
|
|
||||||
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 the listeners of a service. The _:name_ in the URI must be a valid service
|
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
|
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_MAJOR "2" CACHE STRING "Major version")
|
||||||
set(MAXSCALE_VERSION_MINOR "1" CACHE STRING "Minor 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
|
# This should only be incremented if a package is rebuilt
|
||||||
set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number")
|
set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number")
|
||||||
|
@ -10,7 +10,7 @@ elseif(EXISTS ${SLES_FNC})
|
|||||||
elseif(EXISTS ${DEB_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.")
|
set(USE_DEB TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
|
||||||
else()
|
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()
|
endif()
|
||||||
|
|
||||||
if(USE_DEB)
|
if(USE_DEB)
|
||||||
@ -19,6 +19,9 @@ elseif(USE_RPM)
|
|||||||
configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||||
elseif(USE_SLES)
|
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()
|
endif()
|
||||||
|
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY)
|
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);
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
test.tprintf("Testing with both master and slave up");
|
auto do_test = [&]()
|
||||||
|
{
|
||||||
|
test.set_timeout(20);
|
||||||
test.maxscales->connect();
|
test.maxscales->connect();
|
||||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
||||||
test.maxscales->disconnect();
|
test.maxscales->disconnect();
|
||||||
|
test.stop_timeout();
|
||||||
|
};
|
||||||
|
|
||||||
|
test.tprintf("Testing with both master and slave up");
|
||||||
|
do_test();
|
||||||
|
|
||||||
test.tprintf("Testing with only the master");
|
test.tprintf("Testing with only the master");
|
||||||
test.repl->block_node(0);
|
test.repl->block_node(0);
|
||||||
sleep(5);
|
test.maxscales->wait_for_monitor();
|
||||||
test.maxscales->connect();
|
do_test();
|
||||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
|
||||||
test.maxscales->disconnect();
|
|
||||||
test.repl->unblock_node(0);
|
test.repl->unblock_node(0);
|
||||||
sleep(5);
|
test.maxscales->wait_for_monitor();
|
||||||
|
|
||||||
test.tprintf("Testing with only the slave");
|
test.tprintf("Testing with only the slave");
|
||||||
test.repl->block_node(1);
|
test.repl->block_node(1);
|
||||||
sleep(5);
|
test.maxscales->wait_for_monitor();
|
||||||
test.maxscales->connect();
|
do_test();
|
||||||
test.try_query(test.maxscales->conn_master[0], "SELECT 1");
|
|
||||||
test.maxscales->disconnect();
|
|
||||||
test.repl->unblock_node(1);
|
test.repl->unblock_node(1);
|
||||||
sleep(5);
|
test.maxscales->wait_for_monitor();
|
||||||
|
|
||||||
test.tprintf("Checking that both the master and slave are used");
|
test.tprintf("Checking that both the master and slave are used");
|
||||||
std::vector<MYSQL*> connections;
|
std::vector<MYSQL*> connections;
|
||||||
@ -45,10 +48,12 @@ int main(int argc, char** argv)
|
|||||||
for (int i = 0; i < 20; i++)
|
for (int i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
// Open a connection and make sure it works
|
// 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],
|
MYSQL* conn = open_conn(test.maxscales->readconn_master_port[0], test.maxscales->IP[0],
|
||||||
"mxs1743", "mxs1743", false);
|
"mxs1743", "mxs1743", false);
|
||||||
test.try_query(conn, "SELECT 1");
|
test.try_query(conn, "SELECT 1");
|
||||||
connections.push_back(conn);
|
connections.push_back(conn);
|
||||||
|
test.stop_timeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give the connections a few seconds to establish
|
// 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;
|
int status = SERVER_SLAVE;
|
||||||
|
|
||||||
/** The master will return a row with two identical non-NULL fields */
|
/** 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;
|
status = SERVER_MASTER;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user