yum install -y curl
curl -s https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh | sudo bash
yum list 'clickhouse*'yum list 'clickhouse*'
yum install -y clickhouse-server clickhouse-client
yum list installed 'clickhouse*'
wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/6/clickhouse-server-common-19.3.6-1.el6.x86_64.rpm/download.rpm
wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/6/clickhouse-server-19.3.6-1.el6.x86_64.rpm/download.rpm
wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/6/clickhouse-common-static-19.3.6-1.el6.x86_64.rpm/download.rpm
wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/6/clickhouse-client-19.3.6-1.el6.x86_64.rpm/download.rpm
yum install clickhouse-*
vim /etc/clickhouse-server/config.xml
修改log路径
<log>/data/clickhouse/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/data/clickhouse/log/clickhouse-server/clickhouse-server.err.log</errorlog>
修改数据路径
<!-- Path to data directory, with trailing slash. -->
<path>/data/clickhouse/</path>
<!-- Path to temporary data for processing hard queries. -->
<tmp_path>/data/clickhouse/tmp/</tmp_path>
<!-- Directory with user provided files that are accessible by 'file' table function. -->
<user_files_path>/data/clickhouse/user_files/</user_files_path>
运行服务
service clickhouse-server start
在控制台中直接启动服务:
clickhouse-server --config-file=/etc/clickhouse-server/config.xml
客户端连接服务
clickhouse-client
默认情况下它使用‘default’用户无密码的与localhost:9000服务建立连接。 客户端也可以用于连接远程服务,例如:
clickhouse-client --host=example.com
clickhouse 开启运程访问
vim /etc/clickhouse-server/config.xml
把注释掉的<listen_host>::</listen_host>取消注释,然后重启服务:
systemctl restart clickhouse-server