1.安装curl系统包 #yum install -y curl 2.安装clickhouse repositories #curl -s https://packagecloud.io/install/r
#yum install -y curl
#curl -s https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh |bash
#yum list 'clickhouse*'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
#yum install -y 'clickhouse*'
#yum list installed 'clickhouse*'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
#/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.连接数据库
#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', [1,2]), ('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.
:)
--结束END--
本文标题: clickhouse linux安装
本文链接: https://www.lsjlt.com/news/44848.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0