0
컨텍스트 컨텍스트가 없기 때문에 Prometheus 2.0 centos 서비스가 시작되지 않습니다. prometheus 2.0을 포함한 일부 모니터링 도구를 설치하기 위해 빈 centos VM에 스크립트를 추가했습니다."저장소 열기 실패, 권한 거부"
문제 : 일단 루트가 아닌 sudo는 사용자의 홈 디렉토리에 설치, 나는 내가 sudo systemctl daemon-reload, sudo systemctl enable prometheus.service, sudo systemctl start prometheus.service
실행을 "은/etc/systemd/시스템"을 쓴 prometheus.service을 복사하지만 서비스가 실패합니다.
참고 : 동일한 명령을 사용하여 터미널에서 prometheus 이진 파일을 직접 실행할 수는 있지만 서비스로 실행할 수는 없습니다.
이[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network-online.target
[Service]
User=centos
ExecStart=/home/centos/prometheus/prometheus --config.file="/home/centos/prometheus/prometheus.yml" --storage.tsdb.path="/home/centos/prometheus/data"
[Install]
WantedBy=multi-user.target
여기에 로그의 일부입니다 :
가 여기 내 .service 파일의
...
Nov 21 12:41:55 localhost.localdomain prometheus[1554]: level=info ts=2017-11-21T17:41:55.114757834Z caller=main.go:314 msg="Starting TSDB"
Nov 21 12:41:55 localhost.localdomain prometheus[1554]: level=error ts=2017-11-21T17:41:55.114819195Z caller=main.go:323 msg="Opening storage failed" err="mkdir \": permission denied"
Nov 21 12:41:55 localhost.localdomain systemd[1]: prometheus.service: control process exited, code=exited status=1
Nov 21 12:41:55 localhost.localdomain systemd[1]: Failed to start Prometheus Server.
...
나는 리눅스 서비스 관리에 대한 새로운 해요, 온라인 독서 시간을 많이 소비했지만 서비스에 대한 사용 권한이 어떻게 작동하는지, 그리고 왜 생성해야하는 디렉토리를 만들 수 없는지 잘 모르겠습니다.
나는 시도했다 :
- 는 "SELINUX = 수행 및 변경" "SELINUX = 허용"
777
에 프로 메테우스 디렉토리에 대한 권한을 변경하는 ...