如何网站后台清理缓存,linux 配置网站域名,打广告的平台,沈阳黄页88企业名录前言
最近有个物联网项目#xff0c;需要存储物联网终端发送过来的信息#xff08;类似log日志#xff0c;但又要存储在数据库里#xff0c;方便后期聚合统计#xff09;#xff0c;本来想写文件的奈何客户要求聚合统计#xff0c;所以只能用数据库才能达到更高的计算效…前言
最近有个物联网项目需要存储物联网终端发送过来的信息类似log日志但又要存储在数据库里方便后期聚合统计本来想写文件的奈何客户要求聚合统计所以只能用数据库才能达到更高的计算效率当然mysql对这种日志型数据库并没有优势数据量上去后反而不利于计算所以就研究了一下列式数据库看到宝塔有clickhouse就研究了一下但是期间遇到很多坑这里把解决方案分享出来供大家参考
踩坑
1号坑 docker内部无法访问宿主机的clickhouse
[error] failed to initialize database, got error dial tcp 172.17.0.1:9000: connect: connection refused解决方案 1 使用网卡docker0的ip地址访问,在宿主机执行ip add即可看到这个网卡 我的env配置如下
DB_CLICK_HOST172.17.0.12上面ip配置后依然无法访问提示connect: connection refused这里还要修改配置文件,在端口下面添加listen_host即可
listen_host0.0.0.0/listen_host3上面ip配置后依然无法访问提示connect: connection refused这里还要进行宝塔安全系统防火墙端口放行如果需要外网访问clickhouse那还需要到运营商那边放开对应端口只是docker容器访问不需要到运营商放
2号坑 能链接了但是提示密码或者用户不对
报错如下
[0m[31m[error] [0mfailed to initialize database, got error code: 516, message: default: Authentication failed: password is incorrect, or there is no user with such name.If you have installed ClickHouse and forgot password you can reset it in the configuration file.
The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml
and deleting this file will reset the password.
See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed.
出现这个问题需要将密码放到user.xml配置中去clickhouse面板配置的密码好像无效这个问题我反馈给宝塔官方了看这里https://www.bt.cn/bbs/thread-139714-1-1.html