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, and mutations.
- 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:
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:
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 3 - 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; 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:
The Table Schema tab
The Table Schema tab displays the
table’s schema via the CREATE
statement that created it:
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:
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:
The key_flags
data indicates whether a given column is the partition key, the primary key, the sorting key, and/or the sampling key.
The Workload tab
The Workload tab shows you what’s happening in the system now:
Figure 4 - 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 Running Queries tab
The Running Queries tab shows the details of all the currently running queries:
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:
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:
The Replication Queue tab
The Replication Queue tab displays any replications that are in progress:
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:
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 DBA Tools tab
Figure 5 - The DBA Tools tab
It has five 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 Errors tab
The Errors tab, as you would expect, displays any errors that have occurred:
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:
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:
The Rebalance tab lets you, well, rebalance your data:
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.
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:
[ClickHouse rarely crashes, so we don’t have an example to show here.]
Importing a dataset
The Cluster Explorer makes it easy to import a sample dataset. When you click the IMPORT DATASET button, you’ll see this dialog:
Select the dataset you want and click NEXT. Next you’ll be asked about the database schema:
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:
Clicking the Processes tab link takes you to the Running Queries tab.