环境说明
操作系统: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可执行文件。
- clickhouse-server 包:包含要作为服务端运行的ClickHouse配置文件。
服务器配置文件位于/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
创建database
clickhouse-client --password 123456 --query "CREATE DATABASE IF NOT EXISTS tutorial"
查看数据库
clickhouse-client --password 123456 --query "show databases"
允许远程连接
vi /etc/clickhouse-server/config.xml
<listen_host>::</listen_host>