-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.json
More file actions
1 lines (1 loc) · 4.89 KB
/
index.json
File metadata and controls
1 lines (1 loc) · 4.89 KB
1
[{"categories":["docker"],"contents":" /etc/docker/daemon.json 에서 엔진의 소켓 값을 설정할 수 있음. /lib/systemd/system/docker.service 에서 엔진의 소켓 값을 설정할 수 있음. 위의 두 설정 값이 겹치게 되면 도커 엔진을 실행할 수 없게 됨. 이 글은 서버 도커 설정 문제를 해결하며 알게 된 내용들을 정리한 글입니다.\n 도커가 안 켜져! 얼마 전, 방치해뒀던 한 서버의 도커가 올바르게 동작하지 않는 문제가 발생했습니다.\n$ docker ps Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? $ sudo systemctl start docker.service Job for docker.service failed because the control process exited with error code. See \u0026#34;systemctl status docker.service\u0026#34; and \u0026#34;journalctl -xe\u0026#34; for details. 도커 데몬이 올바르게 시작되지 않는 문제가 발생한 것이었는데, 오랫동안 만지지 않고 있던 서버라서 문제가 발생한 원인은 알 수 없었습니다.\n조사를 해보자 에러 메시지에 나온대로 systemctl status docker.service와 journalctl -xe를 통해서 로그를 확인 해 본 결과 아래와 같은 내용을 확인할 수 있었습니다.\n$ systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit-hit) since 날짜 Docs: https://docs.docker.com Process: 24454 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 24454 (code=exited, status=1/FAILURE) journalctl -xe의 경우에는 로그의 양이 많아서 도커 관련 로그만 따로 뽑아서 보면 다음과 같았습니다. 다만, 로그가 너무 길어서 처음에는 그냥 지나쳐 버리고 말았습니다.\n$ sudo journalctl -b -u docker.service unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: hosts: (from flag: [fd://], from file: [tcp://0.0.0.0:2375 unix:///var/run/docker.sock]) 즉, 실행시에 hosts 값이 실행 시점에 flag 값과 설정 파일에 중복 되어 있어서 발생하는 문제라는 뜻입니다. 로그를 살펴보면 아래의 항목들을 찾아볼 수 있습니다.\n from flag: fd:// from file: tcp://0.0.0.0:2375, unix:///var/run/docker.sock 여기서 flag는 찾아본 결과 /lib/systemd/system/docker.service의 ExecStart 값으로 설정되고 file은 /etc/docker/daemon.json 파일에서 설정됩니다.\n따라서 두 설정 값 중에 하나만 사용할 수 있도록 수정해주면 문제 없이 도커 엔진을 실행시킬 수 있게 됩니다.\n해결! # /etc/docker/daemon.json {\u0026#34;hosts\u0026#34;: [\u0026#34;tcp://0.0.0.0:2375\u0026#34;, \u0026#34;unix:///var/run/docker.sock\u0026#34;]} # /lib/systemd/system/docker.serivce [Service] ... ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock 내 경우에는 위의 두 경우처럼 설정이 되어 있었다. 따라서 아래의 docker.service 파일의 -H fd:// 옵션 부분을 제거해서 daemon.json으로만 소켓 설정을 할 수 있도록 하는 것으로 해결했다.\n/lib/systemd/system/docker.service 파일을 수정하게 되면\n$ sudo systemctl daemon-reload 위의 명령을 통해 해당 데몬을 Reload 해주어야 한다.\n$ sudo systemctl start docker.service 그리고 데몬을 실행시켜주면 해결완료!\n","permalink":"/posts/docker-service-failed/","tags":["docker","server"],"title":"Job for docker.service failed"},{"categories":null,"contents":"This file exists solely to respond to /search URL with the related search layout template.\nNo content shown here is rendered, all content is based in the template layouts/page/search.html\nSetting a very low sitemap priority will tell search engines this is not important content.\nThis implementation uses Fusejs, jquery and mark.js\nInitial setup Search depends on additional output content type of JSON in config.toml ``` [outputs] home = [\u0026ldquo;HTML\u0026rdquo;, \u0026ldquo;JSON\u0026rdquo;] ```\nSearching additional fileds To search additional fields defined in front matter, you must add it in 2 places.\nEdit layouts/_default/index.JSON This exposes the values in /index.json i.e. add category ``` \u0026hellip; \u0026ldquo;contents\u0026rdquo;:{{ .Content | plainify | jsonify }} {{ if .Params.tags }}, \u0026ldquo;tags\u0026rdquo;:{{ .Params.tags | jsonify }}{{end}}, \u0026ldquo;categories\u0026rdquo; : {{ .Params.categories | jsonify }}, \u0026hellip; ```\nEdit fuse.js options to Search static/js/search.js ``` keys: [ \u0026ldquo;title\u0026rdquo;, \u0026ldquo;contents\u0026rdquo;, \u0026ldquo;tags\u0026rdquo;, \u0026ldquo;categories\u0026rdquo; ] ```\n","permalink":"/search/","tags":null,"title":"Search Results"}]