'docker'에 해당되는 글 2건

도커 용량 초과

docker 2024. 5. 28. 14:44

출처


https://ngela.tistory.com/90

https://shg-engineer.tistory.com/18

https://choco-life.tistory.com/41


https://choco-life.tistory.com/41

 

 

 

$ sudo bash -c 'du -sh /var/lib/docker/*'
2.2M    /var/lib/docker/buildkit
228K    /var/lib/docker/containers
4.0K    /var/lib/docker/engine-id
1.3M    /var/lib/docker/image
72K     /var/lib/docker/network
881M    /var/lib/docker/overlay2
0       /var/lib/docker/plugins
0       /var/lib/docker/runtimes
0       /var/lib/docker/swarm
0       /var/lib/docker/tmp
24K     /var/lib/docker/volumes
[ec2-user]$


$ df -Th
Filesystem       Type      Size  Used Avail Use% Mounted on
devtmpfs         devtmpfs  4.0M     0  4.0M   0% /dev
tmpfs            tmpfs     1.9G     0  1.9G   0% /dev/shm
tmpfs            tmpfs     766M  828K  765M   1% /run
/dev/nvme0n1p1   xfs       8.0G  3.8G  4.2G  48% /
tmpfs            tmpfs     1.9G     0  1.9G   0% /tmp
/dev/nvme0n1p128 vfat       10M  1.3M  8.7M  13% /boot/efi
tmpfs            tmpfs     383M     0  383M   0% /run/user/1000



$ du -h --max-depth=2
4.0K    ./.ssh
447M    ./market/market-docker
447M    ./market
136K    ./.docker/buildx
140K    ./.docker
8.0K    ./promtail
0       ./.config/procps
0       ./.config
447M    .



# du -hs *
40K     36b8eb11a99e9d22d719c2da652a266076cd96f7ead83f20648df07c2bd48580
649M    67372f8bc0510b890991bce2c70a39b1cd4a9d978b00cd9677687c2374b67c7a
48K     765b3adbc02abae7a2405979d6ec64d2a91fd5f265941f0fa6bbede54604c7a8











 



$ vi /etc/logrotate.d/docker



/var/lib/docker/containers/*/*.log {
  rotate 3
  daily
  compress
  missingok
  copytruncate
}

$ logrotate -fv /etc/logrotate.d/docker




 

vi /etc/docker/daemon.json

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m",
    "max-file": "5",
    "labels": "production_status",
    "env": "os,customer"
  }
}

'docker' 카테고리의 다른 글

docker-compse Elasticsearch 설치  (0) 2023.05.18
블로그 이미지

iesay

,

출처 : https://soyoung-new-challenge.tistory.com/110

 

root 디렉토리에   

mkdir elastic 

생성 후  

힙 사이즈를 늘린뒤 실행 시킨다.

sysctl -w vm.max_map_count=262144

7.7버전이 키바나가 죽어서 8.4.3으로 실행해 본다.

vi docker-compose.yml

version: '2.2'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.4.3
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic

  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.4.3
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data02:/usr/share/elasticsearch/data
    ports:
      - 9201:9201
    networks:
      - elastic

  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.4.3
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/usr/share/elasticsearch/data
    ports:
      - 9202:9202
    networks:
      - elastic

  kib01:
    image: docker.elastic.co/kibana/kibana:8.4.3
    container_name: kib01
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_URL: http://127.0.0.1:9200
      ELASTICSEARCH_HOSTS: http://127.0.0.1:9200
    networks:
      - elastic

volumes:
  data01:
    driver: local
  data02:
    driver: local
  data03:
    driver: local

networks:
  elastic:
    driver: bridge

 

잘 되면 좋곘다.

 

'docker' 카테고리의 다른 글

도커 용량 초과  (0) 2024.05.28
블로그 이미지

iesay

,