[安装]
[YUM]
1.添加官方存储库
sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo sudo yum install -y clickhouse-server clickhouse-client sudo /etc/init.d/clickhouse-server start clickhouse-client # or "clickhouse-client --password" if you set up a password.
2.安装
sudo yum install clickhouse-server clickhouse-client
3.启动服务
/etc/init.d/clickhouse-server start
手动启动:
clickhouse-server --config-file=/etc/clickhouse-server/config.xml
日志文件将输出在/var/log/clickhouse-server/文件夹。 检查/etc/clickhouse-server/config.xml中的配置。
4.客户端链接使用
clickhouse-client #指定端口连接 clickhouse-client --port 9020
5.修改端口与远程连接
ClickHouse安装后,默认client连接端口是9000 默认配置文件是只读, 首先需要修改配置文件权限:
chmod u+w /etc/clickhouse-server/config.xml <!-- Port for interaction by native protocol with: - clickhouse-client and other native ClickHouse tools (clickhouse-benchmark, clickhouse-copier); - clickhouse-server with other clickhouse-servers for distributed query processing; - ClickHouse drivers and applications supporting native protocol (this protocol is also informally called as "the TCP protocol"); See also 'tcp_port_secure' for secure connections. --> <tcp_port>9020</tcp_port> tcp_port 端口进行修改
远程连接:
找到<listen_host>::</listen_host>的配置项,取消注释,这样就同时支持IPv4和IPv6了。 也可以选择取消注释<listen_host>0.0.0.0</listen_host>,就仅支持IPv4,不允许IPv6。