0% found this document useful (0 votes)
62 views

Basic Usage - Clustrix Documentation

This document outlines basic utilities for ClustrixDB including load balancing, accessing the database from the command line, loading data, administering the cluster through a web GUI, examining server logs, using the clx command line utility, monitoring with STATD, upgrading, expanding or reducing capacity, and backing up and restoring in parallel. It provides brief descriptions of these tools and processes.

Uploaded by

CSK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Basic Usage - Clustrix Documentation

This document outlines basic utilities for ClustrixDB including load balancing, accessing the database from the command line, loading data, administering the cluster through a web GUI, examining server logs, using the clx command line utility, monitoring with STATD, upgrading, expanding or reducing capacity, and backing up and restoring in parallel. It provides brief descriptions of these tools and processes.

Uploaded by

CSK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

7/7/2016 Basic 

Usage ­ Clustrix Documentation ­

Clustrix Documentation Clustrix v7.5 Home Basic Usage

Basic Usage
This page outlines some frequently used utilities and tools available within ClustrixDB.

Load Balancing ClustrixDB


Accessing ClustrixDB from the Command Line
Loading Data onto ClustrixDB
Web-based Cluster Administration 
Examining ClustrixDB Server Logs
Using CLX - Cluster-Wide Command Line Utility
Monitoring ClustrixDB Using STATD
Upgrading ClustrixDB
Expanding/Reducing Your Cluster’s Capacity
Parallel Backup and Restore

Load Balancing ClustrixDB
ClustrixDB requires an external TCP load balancer to balance queries across a cluster. Clustrix recommends HAProxy as a load
balancer. For more information, see Load Balancing ClustrixDB with HAProxy.

Accessing ClustrixDB from the Command Line
To access ClustrixDB from the command line, run MySQL from a command line prompt. 

shell> mysql

sql>  SELECT * FROM test.sample ORDER BY birth;  

+­­­­­­­­­­­­+­­­­­­­­­­­­+­­­­­­­­­­­­+­­­­­+
| name       | birth      | death      | sex |
+­­­­­­­­­­­­+­­­­­­­­­­­­+­­­­­­­­­­­­+­­­­­+
| Rowinsky   | 1952­08­01 | NULL       | F   |
| Snyder     | 1955­11­26 | 2014­05­17 | M   |
| Thompson   | 1965­03­09 | NULL       | F   |
| Johnson    | 1980­06­11 | NULL       | M   |
+­­­­­­­­­­­­+­­­­­­­­­­­­+­­­­­­­­­­­­+­­­­­+
4 rows in set (0.00 sec)

Because ClustrixDB is MySQL compatible, many third party tools such as MySQLWorkbench, TOAD, etc. will work seamlessly with
ClustrixDB.

Loading Data onto ClustrixDB
Depending on your specific needs, there are numerous options for loading data onto ClustrixDB: 

http://docs.clustrix.com/display/CLXDOC/Basic+Usage 1/3
7/7/2016 Basic Usage ­ Clustrix Documentation ­

Clustrix recommends using clustrix_import if your source database is MySQL or you have a mysqldump file available. This is
the fastest method for loading data onto ClustrixDB from another system. 
To cut over a production environment from MySQL to ClustrixDB, you can use MySQL replication as outlined in Migrating to
ClustrixDB from MySQL.
To transfer user accounts and permissions, use clustrix_clone_users as documented in Migrating User Permissions.  
Load Data Infile can also be used to import data directly to ClustrixDB from a csv file.

See also Loading Data Onto ClustrixDB.

Web­based Cluster Administration 
The v7.5 release of ClustrixDB offers a new ClustrixGUI - Administrative UI (beta) for cluster administration.  Clustrix Insight, the
previous web-based UI, remains available, but only one GUI may be in use at a time.

The choice of a GUI tool is left to the user. See Selecting and Installing a GUI for information on deploying the GUI of your choice.

Examining ClustrixDB Server Logs
ClustrixDB’s server logs enable users and Customer Support to understand the queries and events that occur on a ClustrixDB
cluster. All the logs created by ClustrixDB are placed, by default, in the /data/clustrix/log directory (this is configurable) and there
are a separate set of logs for each node of your cluster. The logs used most frequently are query.log and clustrix.log.

The query.log shows information for SQL statements used within ClustrixDB. From the query.log you can identify slow queries as
well as query syntax errors. For information see Query Logging.

The clustrix.log is a chronology of events that occur on your cluster. It includes alerts that are also logged to a separate log file -
alert.log. If you have selected Clustrix Insight as your UI, see Configuring Alerts to establish alert recipients. For ClustrixGUI (beta)
users, please contact Clustrix Support to configure alerts via the command line. 

Using CLX ­ Cluster­Wide Command Line Utility
ClustrixDB includes a general-purpose command line utility called clx for monitoring and managing a cluster. A single clx command
is automatically processed in parallel on all nodes of a cluster. It is located in the /opt/clustrix/bin/ directory.

The full list of clx commands and options are outlined in The CLX Command-Line Administration Tool. The following commands are
used most frequently:

Frequently Used CLX Commands Description

clx status     Displays the status, IP, and disk utilization of each node in a cluster.

clx cmd cmd issues a Linux command to all nodes of a cluster and, if applicable, coalesces the results
before returning them. Think of cmd as the tool to allow the parallel execution of Linux
commands on all nodes of the cluster.

This command is particularly helpful in assessing logs. For example, this sample interrogates
all logs named query.log stored in the directory /data/clustrix/log on each node. It will
return log messages that were posted between 08­01­2015 and 08­05­2015 into a file called
recent_query.log.

clx cmd 'grep "^2015­08­0[1­5]" /data/clustrix/log/query.log' > ~/recent_query.log

http://docs.clustrix.com/display/CLXDOC/Basic+Usage 2/3
7/7/2016 Basic Usage ­ Clustrix Documentation ­

clx dbstop Stops ClustrixDB on all nodes.

clx dbstart   Starts ClustrixDB on all nodes.

clx dbrestart Restarts ClustrixDB on all nodes. (Use in lieu of dbstop/dbstart when applicable.)

ClustrixDB’s clx utility also communicates with another critical element of the system called nanny. The nanny is a database cluster
process that provides monitoring to ensure that all processes vital to ClustrixDB node functionality are running. It is activated at
system startup. If any critical ClustrixDB component fails at any point, for any reason, nanny restarts it automatically.

For a list of the processes that nanny monitors and controls, please refer to this Overview of Nanny.

Monitoring ClustrixDB Using STATD
Performance statistics are automatically collected by statd in the clustrix_statd database. The resulting statistics can be assessed
by querying the tables directly or by viewing them with Clustrix Insight or with the ClustrixGUI administrative tool.

For a recap of the statistics gathered and some potential ways to analyze them, see Monitoring Your Cluster Using STATD.

Upgrading ClustrixDB
Clustrix regularly provides both major and minor releases to continuously improve its product's performance, functionality,
scalability, and stability. Each release passes a thorough and rigorous quality assurance process before it is released to our
customers.

For specifics on how to upgrade ClustrixDB, see Upgrading ClustrixDB.

Expanding/Reducing Your Cluster’s Capacity
Your application and database may experience fluctuating transaction volumes due to seasonal changes. The underlying design of
ClustrixDB enables it to easily and uniquely adapt to those changes. To increase your cluster’s capacity, simply add more nodes.
Conversely, if transaction volume subsequently declines, removing nodes to decrease costs is equally painless. See Flex Up and Flex
Down for specifics.

Parallel Backup and Restore
ClustrixDB includes a fast parallel backup and restore feature. For backups, each ClustrixDB node sends its data directly to the
backup target in parallel, allowing for concurrency and for backup performance to scale with cluster size. Similarly, the restore
operation is initiated on one node and that node coordinates with all other nodes of the cluster to read from the backup file and
restore data throughout the cluster in parallel.

The ClustrixDB database backups contain schema definitions, metadata relative to the backup, compacted row data, and
information to ensure data consistency. For more information, see ClustrixDB Fast Backup and Restore. 

http://docs.clustrix.com/display/CLXDOC/Basic+Usage 3/3

You might also like