Skip to content

Commit

Permalink
memo : promtail -> loki 파일 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
imenuuu committed Jun 7, 2024
1 parent 7841857 commit e6b0427
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .ebextensions-dev/promtail.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
packages:
yum:
wget: []
unzip: []

commands:
01_download_promtail:
command: |
wget https://github.com/grafana/loki/releases/download/v2.2.1/promtail-linux-amd64.zip -O /tmp/promtail-linux-amd64.zip
unzip /tmp/promtail-linux-amd64.zip -d /tmp
mv /tmp/promtail-linux-amd64 /usr/local/bin/promtail
chmod +x /usr/local/bin/promtail

files:
"/etc/promtail/promtail-config.yaml":
content: |
server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

clients:
- url: http://grafana.winey.shop:3100/loki/api/v1/push

scrape_configs:
- job_name: beanstalk
static_configs:
- targets:
- localhost
labels:
job: beanstalk
__path__: /var/log/webstd.out
mode: "000644"
owner: root
group: root

"/etc/systemd/system/promtail.service":
content: |
[Unit]
Description=Promtail service
After=network.target

[Service]
ExecStart=/usr/local/bin/promtail -config.file=/etc/promtail/promtail-config.yaml
Restart=always

[Install]
WantedBy=multi-user.target
mode: "000644"
owner: root
group: root

commands:
02_enable_promtail:
command: |
systemctl daemon-reload
systemctl enable promtail
systemctl start promtail

0 comments on commit e6b0427

Please sign in to comment.