Showing entries 1 to 6
Displaying posts with tag: command (reset)
Zero-Downtime Cluster Maintenance: Comparing the Procedures for Upgrades versus DB/OS Maintenance

Overview The Skinny

Part of the power of Tungsten Clustering for MySQL / MariaDB is the ability to perform true zero-downtime maintenance, allowing client applications full access to the database layer, while taking out individual nodes for maintenance and upgrades. In this blog post we cover various types of maintenance scenarios, the best practices associated with each type of action, and the key steps to ensure the highest availability.

Important Questions Understand the Environment as a Whole First

There are a number of questions to ask when planning cluster maintenance that are critical to understand before starting.

For example:

  1. What is the cluster topology?
    • Standalone (connectors write to single cluster master)
      Single cluster: …
[Read more]
In a proxy-ed world, where do connections come from?

Overview The Skinny

Database Proxies provide a single entry point into MySQL for the calling client applications.

Proxies are wonderful tools to handle various situations like a master role switch to another node for maintenance, or for transparency with read and write connections.

However, when the time comes to perform the switch action, all of the calling clients have been funneled through the proxy, so identification of the calling host from the database itself becomes difficult.

The Problem What is going on?

Let’s illustrate how not knowing the source of a client connection can be an issue for the database administrator…

In the following diagram, three client applications connect to a Tungsten Cluster via the Connector proxy:

[Read more]
How to move the Relay role to another node in a Composite Tungsten Cluster

The Question Recently, a customer asked us:

How would we manually move the relay role from a failing node to a slave in a Composite Tungsten Cluster passive site?

The Answer The Long and the Short of It

There are two ways to handle this procedure manually when the usual switch command fails to work as expected. One is short and reasonably automated, and the other is much more detailed and manual.

Of course, the usual procedure is to just issue the switch command in the passive cluster:

use west
set policy maintenance
set policy automatic

The below article describes what to do when the switch command does not move the relay role to another node.


Below is the list of cctrl commands that would be run for the basic, short version, which (aside from handling policy changes) is really only …

[Read more]
Slick Command-Line Tricks for a Tungsten MySQL / MariaDB Database Cluster

Overview The Skinny

Tungsten Clustering provides high availability, disaster recovery, and a host of other benefits for MySQL / MariaDB / Percona Server databases. In this blog post we will explore some of the shell aliases I use every day to administer various Tungsten Clusters.

Shell Aliases: A Quick Review Quick and Easy

A shell alias is simply a way to create a shortcut for frequently-used command sequences.

For example, I like to shorten the command clear to cls, i.e.

shell> alias cls=clear
shell> cls

If you create an alias on the fly it will be lost when the shell exits.

To save aliases so they are available to all shell sessions, update your shell’s profile or rc script.

For example, add the below line to the bottom of …

[Read more]
How to execute mysql query from a file in your mysql client terminal?

Being a terminal fan myself, I usually find myself running queries in the mysql client instead of a UI interface as it is much faster. You get to see the results instantaneously.

One thing which is pretty tedious is editing a big query again after once running it as the whole multi-line formatted query now appears on a single line, thus reducing its readability.

But no problems, you can edit your query from a file and run the file from your mysql client terminal as many times as you want with as many edits.

To do so, follow the below steps:

1. Open your terminal and cd into the folder you want to store our sample mysql file. Then save your query in a sample file called my_query.sql

$ cd /path/to/folder
$ vim my_query.sql

Save a sample query like:

SELECT * FROM employees

[Read more]
MySQL Command Line Help

I tend to use MySQL from the interactive command line shell quite a bit (SSH to your db server and type the command mysql to start). I noticed today that there is a pretty extensive built in help system in this command.

You can access it by typing help COMMAND, so for instance if you type help ALTER TABLE you get a quick reference for constructing an ALTER TABLE statement.

If you can't remember what command you want to use, then typing help contents is your friend. It will output:

For more information, type 'help item', where item is
one of the following categories:
Column Types
Data Definition
Data Manipulation
Geographic features

So if your looking for that command that outputs all the columns in a table, but don't know what it's called, you might now try help administration

[Read more]
Showing entries 1 to 6