SingleStore DB

Location and Management

The tracelog is located in the tracelogs directory with the file name memsql.log. When the server is started, it opens this file in append mode and begins to log messages.

You can rotate the log by moving the memsql.log file and then sending SIGHUP to the memsqld process. This will trigger the server to reopen memsql.log and continue writing.

SingleStore DB manages code compilation with a separate process. This process also maintains a tracelog named command.log.

Use the logrotate utility combined with a configuration file to automatically manage SingleStore DB log rotation. The example shown below rotates two log files.

Note: The example paths use the default folder location for SingleStore DB with an example ID value in the folder name for a master aggregator node. You should replace them with the values for your node. Also, this example assumes you are logged in as root when running logrotate.

# cat > /var/tmp/logrotate.conf <<EOF
/var/lib/memsql/master-3306-MI4478312f/tracelogs/memsql.log /var/lib/memsql/master-3306-MI4478312f/tracelogs/query.log {
         rotate 7
             # Send SIGHUP to both memsqld processes
             killall -q -s1 memsqld

Manually run logrotate and point to the configuration file created above.

# logrotate -f /var/tmp/logrotate.conf

List the compressed log files.

# ls /var/lib/memsql/master-3306-MI4478312f/tracelogs/*.gz

For more information about logrotate, see the logrotate manpage.