惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

ike‘s blog

mac软件推荐 用Siri来控制Windows电脑开机关机吧 clickhouse的一些优化建议和工具 2023sumppary 记录一下我的第一个网页游戏Mazeball 如何使用Clickhouse的索引 如何从zookeeper切换为clickhouse—keeper cloki分布式查询和clickhouse副本存储 使用ilogtail+cloki+clickhouse来做日志系统吧 clickhouse集群部署指南 快速部署thanos架构 如何使用go的jwt 如何修改git commit记录 业务容器化需要注意的一些地方 游戏企划 Prometheus Metrics精简优化2 来在线听音乐吧 Chatgpt的API入门 简单搭建国内也可以使用的chatgpt Prometheus Metrics精简优化 Kubernetes的探针机制 本地部署chatAI【chatglm】 AI绘画工具webui简单入门 之 高清化 写在地下城邂逅Ⅳ·灾厄篇·完结之后 如何部署gitalk作为评论系统 AI绘画工具webui简单入门 之 工具安装 grafanadb迁移到mysql kubectl常用命令 开始写博客啦 隐私政策URL Markdown Example Include Video in the Posts Markdown Extended Features Simple Guides for Fuwari Golang net/http & HTTP Serve 源码分析
快速安装部署clickhouse和cloki
2023-07-28 · via ike‘s blog

安装#

clickhouse#

yum install -y yum-utils
yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
yum install -y clickhouse-server clickhouse-client
chmod a+x /etc/clickhouse-server/*

等待安装完成后修改/etc/clickhouse-server/config.xml文件,把listen_host标签取消注释

    <listen_host>::1</listen_host>
    <listen_host>127.0.0.1</listen_host>

如果需要添加密码的话修改/etc/clickhouse-server/user.xml文件,把明文密码加到password标签中即可,或者也可以使用SHA256加密后的密码,请将其放置在 password_sha256_hex 配置段。

#shell生成加密密码的示例
  PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-'

最后启动clickhouse-server.service systemctl start clickhouse-server.service

启动后可以lsof -i:8123 查看端口是否有,systemctl status clickhouse-server.service服务是否正常启动。

没问题后执行clickhouse-client后即可登陆clickhouse。

cloki#

安装命令

yum install npm
npm install nodejs
npm install -g cloki pm2

安装完成后启动,记得把yourpassword修改下

cd $(dirname $(readlink -f `which cloki`)) \
  && CLICKHOUSE_SERVER="localhost" CLICKHOUSE_AUTH="default:yourpassword" CLICKHOUSE_DB="cloki" \
  pm2 start cloki --name "cloki"

查看状态

pm2 status cloki
pm2 save
pm2 startup

使用#

cloki是支持promtail、logstash、fluentd等常用的日志采集工具,这边用promtail为例。 config.yaml

server:
  http_listen_port: 29080
  grpc_listen_port: 0

positions:
  filename: /opt/promtail/positions.yaml

clients:
  - url: http://172.0.0.100:3100/loki/api/v1/push

scrape_configs:
- job_name: test-log
  pipeline_stages:
  static_configs:
  - targets:
      - localhost
    labels:
      hostname: test
      cluster: sz-test
      app: test
      __path__: /var/log/*log

配置完毕后启动promtail就可以采集路径下的日志并push到loki的api并存储到clickhouse中。

登陆部署的服务器3100端口即可访问cloki的查询界面,示例:

参考#

官方GITHUB