Merge branch 'develop' into MAX-348
This commit is contained in:
@ -139,7 +139,6 @@ install(FILES ${ERRMSG} DESTINATION mysql)
|
|||||||
install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION .)
|
install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION .)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION .)
|
install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION .)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION .)
|
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION .)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/SETUP DESTINATION .)
|
|
||||||
install(DIRECTORY DESTINATION log)
|
install(DIRECTORY DESTINATION log)
|
||||||
|
|
||||||
# Install startup scripts and ldconfig files
|
# Install startup scripts and ldconfig files
|
||||||
|
|||||||
@ -6,7 +6,7 @@ The tee filter is a filter module for MaxScale is a "plumbing" fitting in the Ma
|
|||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
|
|
||||||
The configuration block for the TEE filter requires the minimal filter parameters in it’s section within the MaxScale.cnf file, stored in $MAXSCALE_HOME/etc/MaxScale.cnf, that defines the filter to load and the service to send the duplicates to.
|
The configuration block for the TEE filter requires the minimal filter parameters in it’s section within the MaxScale.cnf file, stored in $MAXSCALE_HOME/etc/MaxScale.cnf, that defines the filter to load and the service to send the duplicates to. Currently the tee filter does not support multi-statements.
|
||||||
|
|
||||||
[DataMartFilter]
|
[DataMartFilter]
|
||||||
|
|
||||||
|
|||||||
2
README
2
README
@ -29,7 +29,7 @@ issues and communicate with the MaxScale community.
|
|||||||
or use the [forum](http://groups.google.com/forum/#!forum/maxscale) interface
|
or use the [forum](http://groups.google.com/forum/#!forum/maxscale) interface
|
||||||
|
|
||||||
Bugs can be reported in the MariaDB Corporation bugs database
|
Bugs can be reported in the MariaDB Corporation bugs database
|
||||||
[bug.mariadb.com](http://bugs.mariadb.com)
|
[https://mariadb.atlassian.net/secure/CreateIssue!default.jspa](https://mariadb.atlassian.net/secure/CreateIssue!default.jspa) under project MXS.
|
||||||
|
|
||||||
\section Documentation
|
\section Documentation
|
||||||
|
|
||||||
|
|||||||
33
SETUP
33
SETUP
@ -1,33 +0,0 @@
|
|||||||
Installation and startup
|
|
||||||
|
|
||||||
Untar the binary distribution in the desired location,
|
|
||||||
e.g. /usr/local/skysql
|
|
||||||
|
|
||||||
Alternatively build from the source code using the instructions
|
|
||||||
in the README file and execute make install.
|
|
||||||
|
|
||||||
Simply set the environment variable MAXSCALE_HOME to point to the
|
|
||||||
MaxScale directory, found inside the path into which the files have been copied,
|
|
||||||
e.g. MAXSCALE_HOME=/usr/local/skysql/maxscale
|
|
||||||
|
|
||||||
Also you will need to optionaly set LD_LIBRARY_PATH to include the 'lib' folder,
|
|
||||||
found inside the path into which the files have been copied,
|
|
||||||
e.g. LD_LIBRARY_PATH=/usr/local/skysql/maxscale/lib
|
|
||||||
|
|
||||||
To start MaxScale execute the command 'maxscale' from the bin folder,
|
|
||||||
e.g. /usr/local/skysql/maxscale/bin/maxscale or by using the
|
|
||||||
installed init.d script.
|
|
||||||
|
|
||||||
Configuration
|
|
||||||
|
|
||||||
You need to create and edit the file MaxScale.cnf in $MAXSCALE_HOME/etc.
|
|
||||||
You should define the set of server definitions you require, with the addresses
|
|
||||||
and ports of those servers. Also define the listening ports for your
|
|
||||||
various services.
|
|
||||||
|
|
||||||
In order to view the internal activity of MaxScale you can telnet to
|
|
||||||
the port defined for the telnet listener. Initially you may login with
|
|
||||||
the user name of "admin" and the password "skysql". Once connected type
|
|
||||||
help for an overview of the commands and help <command> for the more
|
|
||||||
detailed help on commands. Use the 'add user' command to add a new user
|
|
||||||
which will also remove the admin/skysql user.
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# maxscale: The MariaDB Corporation MaxScale database proxy
|
# maxscale: The MariaDB Corporation MaxScale database proxy
|
||||||
#
|
#
|
||||||
@ -58,7 +58,7 @@ RETVAL=0
|
|||||||
|
|
||||||
start() {
|
start() {
|
||||||
log_daemon_msg "Starting MaxScale"
|
log_daemon_msg "Starting MaxScale"
|
||||||
start_daemon -p $MAXSCALE_PIDFILE $DAEMON 2> /dev/null
|
start_daemon -p $MAXSCALE_PIDFILE $DAEMON 2> /dev/null > /dev/null
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
|
|||||||
@ -52,6 +52,8 @@ static int prevval;
|
|||||||
static simple_mutex_t msg_mutex;
|
static simple_mutex_t msg_mutex;
|
||||||
#endif
|
#endif
|
||||||
static int highprec = 0;
|
static int highprec = 0;
|
||||||
|
static int do_syslog = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Variable holding the enabled logfiles information.
|
* Variable holding the enabled logfiles information.
|
||||||
* Used from log users to check enabled logs prior calling
|
* Used from log users to check enabled logs prior calling
|
||||||
@ -392,7 +394,13 @@ static bool logmanager_init_nomutex(
|
|||||||
fw = &lm->lm_filewriter;
|
fw = &lm->lm_filewriter;
|
||||||
fn->fn_state = UNINIT;
|
fn->fn_state = UNINIT;
|
||||||
fw->fwr_state = UNINIT;
|
fw->fwr_state = UNINIT;
|
||||||
|
|
||||||
|
if(!do_syslog)
|
||||||
|
{
|
||||||
|
free(syslog_id_str);
|
||||||
|
syslog_id_str = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/** Initialize configuration including log file naming info */
|
/** Initialize configuration including log file naming info */
|
||||||
if (!fnames_conf_init(fn, argc, argv))
|
if (!fnames_conf_init(fn, argc, argv))
|
||||||
{
|
{
|
||||||
@ -1703,11 +1711,14 @@ static bool fnames_conf_init(
|
|||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
/** record list of log file ids for syslogged */
|
/** record list of log file ids for syslogged */
|
||||||
|
if(do_syslog)
|
||||||
|
{
|
||||||
if (syslog_id_str != NULL)
|
if (syslog_id_str != NULL)
|
||||||
{
|
{
|
||||||
free (syslog_id_str);
|
free (syslog_id_str);
|
||||||
}
|
}
|
||||||
syslog_id_str = optarg;
|
syslog_id_str = optarg;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm':
|
case 'm':
|
||||||
@ -1720,6 +1731,7 @@ static bool fnames_conf_init(
|
|||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
/** record list of log file ids for later use */
|
/** record list of log file ids for later use */
|
||||||
|
if(do_syslog)
|
||||||
shmem_id_str = optarg;
|
shmem_id_str = optarg;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -3083,7 +3095,21 @@ void skygw_log_sync_all(void)
|
|||||||
skygw_message_wait(lm->lm_clientmes);
|
skygw_message_wait(lm->lm_clientmes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle high precision logging
|
||||||
|
* @param val 0 for disabled, 1 for enabled
|
||||||
|
*/
|
||||||
void skygw_set_highp(int val)
|
void skygw_set_highp(int val)
|
||||||
{
|
{
|
||||||
highprec = val;
|
highprec = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle syslog logging
|
||||||
|
* @param val 0 for disabled, 1 for enabled
|
||||||
|
*/
|
||||||
|
void logmanager_enable_syslog(int val)
|
||||||
|
{
|
||||||
|
do_syslog = val;
|
||||||
}
|
}
|
||||||
@ -120,6 +120,7 @@ int skygw_log_enable(logfile_id_t id);
|
|||||||
int skygw_log_disable(logfile_id_t id);
|
int skygw_log_disable(logfile_id_t id);
|
||||||
void skygw_log_sync_all(void);
|
void skygw_log_sync_all(void);
|
||||||
void skygw_set_highp(int);
|
void skygw_set_highp(int);
|
||||||
|
void logmanager_enable_syslog(int);
|
||||||
EXTERN_C_BLOCK_END
|
EXTERN_C_BLOCK_END
|
||||||
|
|
||||||
const char* get_trace_prefix_default(void);
|
const char* get_trace_prefix_default(void);
|
||||||
|
|||||||
@ -150,6 +150,7 @@ static struct option long_options[] = {
|
|||||||
{"config", required_argument, 0, 'f'},
|
{"config", required_argument, 0, 'f'},
|
||||||
{"nodaemon", no_argument, 0, 'd'},
|
{"nodaemon", no_argument, 0, 'd'},
|
||||||
{"log", required_argument, 0, 'l'},
|
{"log", required_argument, 0, 'l'},
|
||||||
|
{"syslog", required_argument, 0, 's'},
|
||||||
{"version", no_argument, 0, 'v'},
|
{"version", no_argument, 0, 'v'},
|
||||||
{"help", no_argument, 0, '?'},
|
{"help", no_argument, 0, '?'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
@ -995,6 +996,8 @@ static void usage(void)
|
|||||||
" (default: $MAXSCALE_HOME/etc/MaxScale.cnf)\n"
|
" (default: $MAXSCALE_HOME/etc/MaxScale.cnf)\n"
|
||||||
" -l|--log=... log to file or shared memory\n"
|
" -l|--log=... log to file or shared memory\n"
|
||||||
" -lfile or -lshm - defaults to shared memory\n"
|
" -lfile or -lshm - defaults to shared memory\n"
|
||||||
|
" -s|--syslog= log messages to syslog"
|
||||||
|
" true or false - defaults to true"
|
||||||
" -v|--version print version info and exit\n"
|
" -v|--version print version info and exit\n"
|
||||||
" -?|--help show this help\n"
|
" -?|--help show this help\n"
|
||||||
, progname);
|
, progname);
|
||||||
@ -1057,6 +1060,7 @@ int main(int argc, char **argv)
|
|||||||
void* log_flush_thr = NULL;
|
void* log_flush_thr = NULL;
|
||||||
int option_index;
|
int option_index;
|
||||||
int logtofile = 0; /* Use shared memory or file */
|
int logtofile = 0; /* Use shared memory or file */
|
||||||
|
int syslog_enabled = 1; /** Log to syslog */
|
||||||
ssize_t log_flush_timeout_ms = 0;
|
ssize_t log_flush_timeout_ms = 0;
|
||||||
sigset_t sigset;
|
sigset_t sigset;
|
||||||
sigset_t sigpipe_mask;
|
sigset_t sigpipe_mask;
|
||||||
@ -1096,7 +1100,7 @@ int main(int argc, char **argv)
|
|||||||
goto return_main;
|
goto return_main;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ((opt = getopt_long(argc, argv, "dc:f:l:v?",
|
while ((opt = getopt_long(argc, argv, "dc:f:l:vs:?",
|
||||||
long_options, &option_index)) != -1)
|
long_options, &option_index)) != -1)
|
||||||
{
|
{
|
||||||
bool succp = true;
|
bool succp = true;
|
||||||
@ -1201,7 +1205,17 @@ int main(int argc, char **argv)
|
|||||||
succp = false;
|
succp = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
if(strstr(optarg,"="))
|
||||||
|
{
|
||||||
|
strtok(optarg,"= ");
|
||||||
|
syslog_enabled = config_truth_value(strtok(NULL,"= "));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
syslog_enabled = config_truth_value(optarg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
usage();
|
usage();
|
||||||
rc = EXIT_SUCCESS;
|
rc = EXIT_SUCCESS;
|
||||||
@ -1563,6 +1577,8 @@ int main(int argc, char **argv)
|
|||||||
argv[0] = "MaxScale";
|
argv[0] = "MaxScale";
|
||||||
argv[1] = "-j";
|
argv[1] = "-j";
|
||||||
argv[2] = buf;
|
argv[2] = buf;
|
||||||
|
|
||||||
|
logmanager_enable_syslog(syslog_enabled);
|
||||||
|
|
||||||
if (logtofile)
|
if (logtofile)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -116,9 +116,20 @@ HKTASK *task, *ptr;
|
|||||||
ptr = ptr->next;
|
ptr = ptr->next;
|
||||||
}
|
}
|
||||||
if (ptr)
|
if (ptr)
|
||||||
|
{
|
||||||
|
if (strcmp(ptr->name, name) == 0)
|
||||||
|
{
|
||||||
|
spinlock_release(&tasklock);
|
||||||
|
free(task->name);
|
||||||
|
free(task);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
ptr->next = task;
|
ptr->next = task;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
tasks = task;
|
tasks = task;
|
||||||
|
}
|
||||||
spinlock_release(&tasklock);
|
spinlock_release(&tasklock);
|
||||||
|
|
||||||
return task->nextdue;
|
return task->nextdue;
|
||||||
|
|||||||
Reference in New Issue
Block a user