環(huán)境說明
操作系統(tǒng):Ubuntu 16.04.4
ip:192.168.18.61
安裝
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee \ /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-server clickhouse-client
sudo service clickhouse-server start
包含軟件包:
- clickhouse-client 包:包含clickhouse-client客戶端枢泰,它是交互式ClickHouse控制臺客戶端屹培。
- clickhouse-common 包:包含一個ClickHouse可執(zhí)行文件。
- clickhouse-server 包:包含要作為服務(wù)端運(yùn)行的ClickHouse配置文件。
服務(wù)器配置文件位于/etc/clickhouse-server/config.xml
By default, it connects to localhost:9000 on behalf of the user default without a password. It can also be used to connect to a remote server using --host argument.
測試
客戶端連接
clickhouse-client -password 123456
創(chuàng)建database
clickhouse-client --password 123456 --query "CREATE DATABASE IF NOT EXISTS tutorial"
查看數(shù)據(jù)庫
clickhouse-client --password 123456 --query "show databases"
允許遠(yuǎn)程連接
vi /etc/clickhouse-server/config.xml
<listen_host>::</listen_host>