Cluster Explorer Guide
The Altinity Cloud Manager UI provides the Cluster Explorer, a panel that lets you run queries against your ClickHouse® databases, work with database schemas, look at processes running inside the cluster, and use a number of useful DBA tools.
If you’re looking for help on a particular aspect of the Cluster Explorer, you can skip ahead to any of the tasks:
- The Query tab - Run queries against your data, create tables, delete data…anything you can do with a SQL statement.
- The Schema tab - Look at the details of tables within your databases.
- The Workload tab - See what’s happening in the system now, including running queries, replications, mutations, and connections to Kafka servers.
- The DBA Tools tab - Use system-level tools to investigate errors, check for schema consistency errors, rebalance storage across your cluster’s disks, and look at detached parts.
- Importing a dataset - Load large, publicly available datasets into your ClickHouse cluster.
Panel buttons and menus
The top of every tab looks like this:
Figure 1 - Cluster Explorer menus and buttons
The functions of the buttons and menus are:
- - The back button. Takes you back to the cluster view for this cluster.
- CLUSTER menu - Clicking this menu displays a dropdown list of all of the clusters in this environment. Whatever you do in the Cluster Explorer will be done on the selected cluster.
- RUN DDLs ON CLUSTER - If selected, Distributed DDL Queries are run on the cluster.
- NODE menu - Lets you select the scope of anything you do in the Cluster Explorer. For the
maddie-byok
cluster, the menu looks like this: Selecting Any means everything you do will be executed on a single node selected by the load balancer. All executes everything on every node. Beyond those two choices, you can select a node from the list of all nodes in this cluster. - - lets you import a sample dataset into your ClickHouse cluster. See Importing a dataset below.
- - The refresh button. Refreshes the display, as you would expect.
The Query tab
When you open the Cluster Explorer, you’ll be on the Query tab:
Figure 2 - The Query tab
The text area at the top of the panel lets you run SQL statements by clicking the EXECUTE button. (You can also keep your hands on the keyboard by typing Ctrl or CMD + Enter.)
Beneath the text area are helpful notes with links to ClickHouse documentation and a couple of example queries.
When you execute a query, the results appear under the text area:
Figure 3 - Query results
Above the text area, the left and right arrows let you move through the queries you’ve executed. The button brings up the Select User dialog:
Figure 4 - Changing the user to access the cluster
This lets you select the user (and their permissions) to run the query. The down arrow lets you choose from the users defined for this cluster. If your account has the necessary permissions, you can also click the link in Manage ClickHouse users here to go directly to the user management panel.
The Schema tab
The Schema tab lets you view the databases and tables in your cluster. You can then select a table and see its details.
Figure 5 - The Schema tab
You can click the Show system tables checkbox to see the system tables as well. All of the table names are links. You can also click the filter icon to show only the tables that match a particular value. This example filters the display to show only tables from the mindsdb
database:
Figure 6 - Filtering to tables from a single database
You can create as many filters as you want; you could add a filter to the display in Figure 6 to show only tables in the mindsdb
database with a MaterializedView
engine.
When you’re ready to see more details on a particular table, click on a table name to see the Table Details dialog, which has four subtabs:
- The Table Description tab - Lists dozens of properties of the table, including its engine, size, number of rows, partition key, and sorting key.
- The Table Schema tab - Displays the table schema via the
CREATE
statement that created it. - The Sample Rows tab - Shows some rows from the table.
- The Column Compression tab - Details the compression ratios of each column in the table.
The Table Description tab
The Table Description tab has a table of the table’s properties. There are dozens of them, some of which are shown here:
Figure 7 - The Table Description tab
The Table Schema tab
The Table Schema tab displays the table’s schema via the CREATE
statement that created it:
Figure 8 - The Table Schema tab
Click the Copy to Clipboard link to put the schema on the clipboard.
The Sample Rows tab
The Sample Rows tab shows randomly selected rows from the table:
Figure 9 - The Sample Rows tab
The Column Compression tab
Finally, the Column Compression tab shows the details of the columns in the table and how much they have been compressed:
Figure 10 - The Column Compression tab
The key_flags
data indicates whether a given column is the partition key, the primary key, the sorting key, and/or the sampling key. In the example in the dialog, .xx.
means this column is in the primary key and the sorting key.
The Workload tab
The Workload tab shows you what’s happening in the system now:
Figure 11 - The Workload tab
It has four subtabs:
- The Running Queries tab - Lists all of the currently running queries.
- The Query Stats tab - Displays statistics for the queries run against this database.
- The Replication Queue tab - Shows any replications in progress.
- The Mutations tab - Lists all mutations currently in progress, with an option to see completed mutations as well.
- The Kafka tab - Lists the tables that interact with Kafka servers and metrics for those tables.
The Running Queries tab
The Running Queries tab shows the details of all the currently running queries:
Figure 12 - The Running Queries tab
Selecting one or more queries activates the button. Be aware that not all queries can be killed; if you’d like to know more, see the Altinity Knowledge Base article on killing queries.
The Query Stats tab
The Query Stats tab gives you insight on how your queries are performing:
Figure 13 - The Query Stats tab
Statistics include the average run time for a query, the maximum run time for a query, the average memory used, and how many bytes were read or written for a query. You can see statistics for queries across different time frames (an hour, a day, a week, or a month).
Clicking on an individual query displays a long list of details for that query, such as its status, when it was run, how long it took to execute, and how many bytes and rows were read and written. Here are a few of those details:
Figure 14 - Details of a query
The Replication Queue tab
The Replication Queue tab displays any replications that are in progress:
Figure 15 - The Replication Queue tab
Statistics include the database and table involved for each replication, details about exceptions, postponed replications, and the number of times a replication was tried.
The Mutations tab
The Mutations tab displays information about mutations (ALTER TABLE
commands), with the option to display details for any completed mutations:
Figure 16 - The Mutations tab
For each mutation, the display includes information about the host, database, and table being mutated, the command used, and any failures, along with other useful data.
Selecting one or more mutations activates the button.
See the ClickHouse documentation for more details on the ALTER TABLE command.
The Kafka tab
The Kafka tab displays information about the tables connected to Kafka servers and metrics about those tables.
Figure 17 - The Kafka tab
When you visit this tab, you must select a node or all nodes to view the data. The Kafka tab has two subtabs: Tables, which lists the tables connected to Kafka servers, and Metrics, which displays metrics for those tables as they ingest data from Kafka.
The Tables subtab looks ike this:
Figure 18 - The Kafka tables subtab
The Metrics subtab looks like this:
Figure 19 - The Kafka metrics subtab
The table shows a variety of statistics for the Kafka-connected tables on this node. Only non-zero values are displayed; you can click the Show empty values slider to see every metric if you want.
The DBA Tools tab
Figure 20 - The DBA Tools tab
It has six subtabs:
- The Errors tab - Displays details for errors that have occurred.
- The Schema Consistency tab - Shows any schema inconsistencies.
- The Disks Balance tab - Graphs the disks used by your ClickHouse cluster, with the option to rebalance them.
- The Detached Parts tab - Lists any detached parts in your ClickHouse cluster.
- The Crashes tab - Provides details on any crashes in your ClickHouse cluster.
- The Audit Report tab - Lets you create audit reports on your system or look at any previous reports.
The Errors tab
The Errors tab, as you would expect, displays any errors that have occurred:
Figure 21 - The Errors tab
Details include the last time an error occurred, how many times it has occurred, and the error message.
The Schema Consistency tab
The Schema Consistency tab displays any schema consistency issues. Hopefully you have no issues and see this:
Figure 22 - The Schema Consistency tab
The Disks Balance tab
The Disks Balance tab has two tabs itself: The Distribution tab, which shows all of the disks in your ClickHouse cluster and how much free space is available on each, and the Rebalance tab, which lets you rebalance your data among your cluster’s disks.
The Distribution tab displays a graph of your disks and how much free space is available on each:
Figure 23 - The Rebalance subtab of the Disks Balance tab
The Rebalance tab lets you, well, rebalance your data:
Figure 24 - The Rebalance subtab of the Disks Balance tab
Clicking the button rebalances the cluster’s disks. You should only rebalance your disks if you’ve gotten an alert that one of your disks is nearly full and you have at least one disk with plenty of space. Note that the ACM will not rebalance your disks if none of them have significant free space, and it will not rebalance the disks unless a significant amount of storage is involved.
The Detached Parts tab
The Detached Parts tab displays any detached parts in your ClickHouse cluster.
Figure 25 - The Detached Parts tab
Selecting one or more parts activates the button.
See the Altinity Knowledge Base article on Detached Parts for more information.
The Crashes tab
The Crashes tab displays the details of any crash that may have occurred:
Figure 26 - The Crashes tab
[ClickHouse rarely crashes, so we don’t have an example to show here.]
The Audit Report tab
The Audit Report tab lets you create new audit reports and lists any reports previously created:
Figure 27 - The Audit Report tab
Clicking the button creates a new report. Clicking the button downloads an HTML file to your machine. The report format is straightforward:
Figure 28 - A sample Audit Report
If you’re inclined to print the report, be aware that it may be hundreds of pages long.
Importing a dataset
The Cluster Explorer makes it easy to import a sample dataset. When you click the button, you’ll see this dialog:
Figure 29 - The Import Dataset wizard
Select the dataset you want and click NEXT. Next you’ll be asked about the database schema:
Figure 30 - The Schema tab of the Import Dataset wizard
In this example, three tables will be created when you click the button: central_park_weather_observations
, taxi_zones
, and tripdata
. You can expand each of the entries to look at the CREATE
statement and change the engine parameters if you want. Clicking the button restores the original statement.
Click to import the data:
Figure 31 - Tracking dataset import progress
Clicking the Processes tab link takes you to the Running Queries tab.