Clickhouse Linux Installation

Source: Internet
Author: User
Tags curl

1. Install the Curl System Package

#yum Install-y Curl

2. Install Clickhouse repositories

#curl-S https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh |bash

3. Query Clickhouse Package

#yum list ' clickhouse* '
Loaded Plugins:fastestmirror
Loading mirror speeds from cached hostfile

    • base:mirror.bit.edu.cn
    • extras:mirror.bit.edu.cn
    • updates:mirror.bit.edu.cn
      Available Packages
      clickhouse-client.x86_64 1.1.54343-1.el7 Altinity_clickhouse
      clickhouse-compressor.x86_64 1.1.54336-3.el7 Altinity_clickhouse
      clickhouse-debuginfo.x86_64 1.1.54343-1.el7 Altinity_clickhouse
      clickhouse-server.x86_64 1.1.54343-1.el7 Altinity_clickhouse
      clickhouse-server-common.x86_64 1.1.54343-1.el7 Altinity_clickhouse
      clickhouse-test.x86_64 1.1.54343-1.el7 Altinity_clickhouse
4. Install the Clickhouse package

#yum install-y ' clickhouse* '

#yum list installed ' clickhouse* '
Loaded Plugins:fastestmirror
Loading mirror speeds from cached hostfile

    • base:mirror.bit.edu.cn
    • extras:mirror.bit.edu.cn
    • updates:mirror.bit.edu.cn
      Installed Packages
      clickhouse-client.x86_64 1.1.54343-1.el7 @Altinity_clickhouse
      clickhouse-debuginfo.x86_64 1.1.54343-1.el7 @Altinity_clickhouse
      clickhouse-server.x86_64 1.1.54343-1.el7 @Altinity_clickhouse
      clickhouse-server-common.x86_64 1.1.54343-1.el7 @Altinity_clickhouse
      clickhouse-test.x86_64 1.1.54343-1.el7 @Altinity_clickhouse
5. Start the database

#/etc/init.d/clickhouse-server restart
Start clickhouse-server service:path to Data directory In/etc/clickhouse-server/config.xml:/var/lib/clickhouse/
Done

6. Connect to the database
#clickhouse-client
Clickhouse Client version 1.1.54343.
Connecting to localhost:9000.
Connected to Clickhouse server version 1.1.54343.

:)
:)
:) CREATE database TestDB;

CREATE DATABASE TestDB

Ok.

0 rows in set. elapsed:0.003 sec.

:)

:) Use TestDB

Use TestDB

Ok.

0 rows in set. elapsed:0.001 sec.

:)

:) CREATE TABLE Arrays_test (S String, arr Array (UInt8)) ENGINE = Memory;

CREATE TABLE Arrays_test
(
S String,
Arr Array (UInt8)
)
ENGINE = Memory

Ok.

0 rows in set. elapsed:0.003 sec.

:)

:) INSERT into arrays_test VALUES (' Hello ', [+]), (' World ', [3,4,5]), (' Goodbye ', [])

INSERT into Arrays_test VALUES

Ok.

3 rows in set. elapsed:0.060 sec.

:)

:) SELECT * from Arrays_test

SELECT *
From Arrays_test

┌─s───────┬─arr─────┐
│hello│[1,2]│
│world│[3,4,5]│
│goodbye│[]│
└─────────┴─────────┘

3 rows in set. elapsed:0.003 sec.

:)

:) SELECT s, arr from arrays_test ARRAY JOIN arr

SELECT
S
Arr
From Arrays_test
ARRAY JOIN arr

┌─s─────┬─arr─┐
│hello│1│
│hello│2│
│world│3│
│world│4│
│world│5│
└───────┴─────┘

5 rows in set. elapsed:0.003 sec.

:)

Clickhouse Linux Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.