docker-compose up -d 这个命令会在后台启动Promtail容器。你可以通过以下命令来验证Promtail容器是否正在运行: bash docker-compose ps 如果Promtail容器正在运行,你应该能够看到它的状态为Up。此外,你还可以检查Promtail的日志以确保它没有遇到任何错误: bash docker-compose logs promtail 这样,你就成功地使用...
通过docker run 启动grafana容器。 docker cp拷贝出来后杀掉容器-"./grafana/grafana-storage:/var/lib/grafana"-"/etc/localtime:/etc/localtime:ro" 启动 一般是没问题的。到这,文件收集结束了。 剩下docker收集 docker-compose -f docker-compose.yml up -d 四、在要被监控的机器docker安装loki插件 loki2.2...
一、docker-compose安装loki和grafana 1.1 安装 docker-compose 命令 [root@loki ~]# curl -L https://get.daocloud.io/docker/compose/releases/download/1.21.1/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose[root@loki ~]# chmod +x /usr/bin/docker-compose 1.2 loki目录结构 [...
https://mirrors.aliyun.com/docker-toolbox/linux/compose/1.21.2/ 把脚本放在/usr/local/bin/下.名字为docker-compose ,加执行权限 ,docker-compose命令就有了 sudo wget https://mirrors.aliyun.com/docker-toolbox/linux/compose/1.21.2/docker-compose-Linux-x86_64 sudo chmod +x /usr/local/bin/docke...
vim docker-compose-grafana-promtail-loki.yml # docker-compose配置参考:https://github.com/grafana/loki/blob/master/production/docker-compose.yaml version: "3" # 网桥loki -> 方便相互通讯 networks: loki: services: # Loki日志系统 loki:
clients:-url:http://127.0.0.1:3100/loki/api/v1/push scrape_configs:-job_name:app static_configs:-targets:-localhost labels:job:app __path__:/var/log/app/**/*.log ps:可以把127.0.0.1 换成接收端的内网ip
Docker-compose.yml 可以参考Loki的文档介绍,开箱即用。 version: "3" networks: loki: services: loki: image: grafana/loki:1.5.0 ports: - "3100:3100" command: -config.file=/etc/loki/local-config.yaml networks: - loki promtail: image: grafana/promtail:1.5.0 ...
环境:基于docker compose部署loki+promtail服务,用于采集日志信息。已有现成的grafana服务,故此处部署为囊括grafana 1.docker-compose.yml配置文件 version: '2' services: loki: image: grafana/loki container_name: loki restart: always ports: - "3100:3100" ...
编辑docker-compose.yml文件 version: '3.5' networks: loki: services: loki: image: grafana/loki:latest container_name: loki restart: unless-stopped ports: - 3100:3100 volumes: - ./config:/etc/loki/config - ./loki/index:/opt/loki/index - ./loki/chunks:/opt/loki/chunks command: -config....
cat > docker-compose.yml << EOF version: "3.7" services: promtail: image: grafana/promtail container_name: promtail restart: always volumes: # 要收集三方日志,需要映射路径# - ./config.yml:/etc/promtail/config.yml # 日志路径 - /var/lib/docker/containers:/var/log ...