ClickHouse CMS VM by Anarion Technologies
ClickHouse is an open-source, columnar database management system designed to handle online analytical processing (OLAP) at high speeds. It is specifically engineered to perform complex analytical queries and process large volumes of data in real time. Unlike traditional row-based databases, ClickHouse uses a columnar storage format, which significantly enhances data retrieval performance and compression efficiency. This makes it particularly well-suited for scenarios where fast querying and data analysis are crucial.
The system’s architecture supports distributed processing, allowing it to scale horizontally across multiple nodes. This distributed approach not only ensures high availability but also enables ClickHouse to manage extensive datasets effectively. Its ability to execute queries quickly and handle massive amounts of data makes it a valuable tool for businesses that rely on real-time data insights for decision-making and operational efficiency.
ClickHouse is commonly used in a variety of applications, from business intelligence and data warehousing to real-time analytics and log analysis. Its robust performance, combined with its open-source nature, makes it a popular choice for organizations seeking a powerful and scalable solution for their data processing needs.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – ClickHouse
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a Virtual Machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group Click Go to Resource Group
Copy the Public IP Address
SSH into Terminal and Run these commands:
$ sudo su
$ sudo apt update
Create User
$ sudo useradd -r -s /bin/false clickhouse
$ sudo groupadd clickhouse
$ sudo usermod -aG clickhouse clickhouse
Check File Permissions: Ensure that the ClickHouse configuration files and directories have the correct permissions and ownership.
$ sudo chown -R clickhouse:clickhouse /etc/clickhouse-server
$ sudo chown -R clickhouse:clickhouse /var/lib/clickhouse
$ sudo chown -R clickhouse:clickhouse /var/log/clickhouse-server
Reload Systemd: After making changes, reload the systemd daemon to apply the updated service file.
$ sudo systemctl daemon-reload
$ sudo systemctl restart clickhouse-server
$ sudo systemctl status clickhouse-server
Create Client Password
$ nano /etc/clickhouse-server/users.xml
Search with CTRL+W and Add your PASSWORD
Save the changes and restart the ClickHouse server:
$ sudo systemctl restart clickhouse-server
Create Databases and Tables
In ClickHouse, you can create and delete databases by executing SQL statements directly in the interactive database prompt. Statements consist of commands following a particular syntax that tell the database server to perform a requested operation along with any data required. You create databases by using the CREATE DATABASE table_name
syntax. To create a database, first start a client session by running the following command:
$ clickhouse-client –password
Now that you’re inside the ClickHouse command prompt, create your test
database by executing:
: )CREATE DATABASE test;
Now that you have an overview of table creation, you’ll create a table. Start by confirming the database you’ll be
modifying:
: ) USE test;
Create your visits table by running this command:
CREATE TABLE visits (
id UInt64,
duration Float64,
url String,
created DateTime
) ENGINE = MergeTree()
PRIMARY KEY id
ORDER BY id;
Inserting, Updating and
Deleting
: ) INSERT INTO visits VALUES (1, 10.5, ‘http://example.com’, ‘2019-01-01 00:01:01’);
Add a column named location
that will store the location of the visits to a website
by running the following statement:
: ) ALTER TABLE visits ADD COLUMN location String;
To test deleting data, run the following statement to remove all rows that have a duration
of less than 5
:
: ) ALTER TABLE visits DELETE WHERE duration < 5;
Quering Data
: ) SELECT url, duration FROM visits WHERE url = ‘http://example2.com’ LIMIT 2;
ThankYou!!!