标签归档:docker

docker安装启动node-exporter

docker pull prom/node-exporter
docker run -d --name node-exporter -v "/proc:/host/proc" -v "/sys:/host/sys" -v "/:/rootfs" --net="host" prom/node-exporter --path.procfs=/host/proc --path.sysfs=/host/proc --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
 docker run -d --net='host' -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml  -v $PWD/alert.rules:/etc/prometheus/alert.rules  --name prometheus  prom/prometheus  --config.file=/etc/prometheus/prometheus.yml 
docker run -d –net=’host’ –name=mongo -v $PWD/mongo:/data/db mongo
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.3

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
version: '2.2'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.3
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"

    ulimits:
      memlock:
        soft: -1
        hard: -1

    volumes:
      - esdata1:/usr/share/elasticsearch/data

    ports:
      - 9200:9200

    networks:
      - esnet

  elasticsearch2:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.3
    container_name: elasticsearch2
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - "discovery.zen.ping.unicast.hosts=elasticsearch"

    ulimits:
      memlock:
        soft: -1
        hard: -1

    volumes:
      - esdata2:/usr/share/elasticsearch/data

    networks:
      - esnet



volumes:
  esdata1:
    driver: local

  esdata2:
    driver: local

networks:
  esnet: