clickhouse新建服务器流程

1、sudo apt-get install -y apt-transport-https ca-certificates dirmngr

2、sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754

3、echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee  /etc/apt/sources.list.d/clickhouse.list

4、sudo apt-get update

5、sudo apt-get install -y clickhouse-server clickhouse-client

输入密码 admin

6、sudo service clickhouse-server start

7、clickhouse-client --password admin
8、查看表创建命令 show create table default.wd

CREATE TABLE default.wd
(
    `IMEI` UInt64,
    `temperature` Float32,
    `humidity` Float32,
    `signal` UInt8,
    `voltage` UInt8,
    `collectTime` DateTime,
    `admin_id` UInt8
)
ENGINE = ReplacingMergeTree(IMEI)
PARTITION BY toYYYYMM(collectTime)
PRIMARY KEY IMEI
ORDER BY (IMEI, collectTime)
SETTINGS index_granularity = 8192

你可能感兴趣的:(clickhouse,服务器,运维)