跳至主要內容
hertzbeat
#监控
docker run -d -p 1157:1157 -p 1158:1158 -e LANG=zh_CN.UTF-8 -e TZ=Asia/Shanghai -v /root/hertzbeat//data:/opt/hertzbeat/data -v /root/hertzbeat/logs:/opt/hertzbeat/logs -v /r

oot/hertzbeat/application.yml:/opt/hertzbeat/config/application.yml -v /root/hertzbeat/sureness.yml:/opt/hertzbeat/config/sureness.yml --restart=always --name hertzbeat tancloud/hertzbeat

# 采集器
docker run -d -e IDENTITY=custom-collector-name -e MODE=public -e MANAGER_HOST=127.0.0.1 -e MANAGER_PORT=1158 --name hertzbeat-collector tancloud/hertzbeat-collector

爱喝水的木子...小于 1 分钟dockerdocker
docker-hadoop

docker-compose.yml

services:
  namenode:
    image: bde2020/hadoop-namenode:2.0.0-hadoop3.2.1-java8
    container_name: namenode
    ports:
      - 9870:9870
      - 9000:9000
    volumes:
      - ./hadoop/dfs/name:/hadoop/dfs/name
      - ./input:/input
    environment:
      - CLUSTER_NAME=test
    env_file:
      - ./hadoop.env

  datanode:
    image: bde2020/hadoop-datanode:2.0.0-hadoop3.2.1-java8
    container_name: datanode
    depends_on:
      - namenode
    volumes:
      - ./hadoop/dfs/data:/hadoop/dfs/data
    environment:
      SERVICE_PRECONDITION: "namenode:9870"
    env_file:
      - ./hadoop.env
  
  resourcemanager:
    image: bde2020/hadoop-resourcemanager:2.0.0-hadoop3.2.1-java8
    container_name: resourcemanager
    environment:
      SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864"
    env_file:
      - ./hadoop.env

  nodemanager1:
    image: bde2020/hadoop-nodemanager:2.0.0-hadoop3.2.1-java8
    container_name: nodemanager
    environment:
      SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 resourcemanager:8088"
    env_file:
      - ./hadoop.env
  
  historyserver:
    image: bde2020/hadoop-historyserver:2.0.0-hadoop3.2.1-java8
    container_name: historyserver
    environment:
      SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 resourcemanager:8088"
    volumes:
      - ./hadoop/yarn/timeline:/hadoop/yarn/timeline
    env_file:
      - ./hadoop.env

爱喝水的木子...小于 1 分钟devdockerhadoopdev
简单搭建mongodb环境

拉镜像

docker pull mongo:4.4-rc

启动

windows指定数据存放路径
docker run --rm --name mongo -d -p 27017:27017 -v D:\Mongodb\master\data:/data/db mongo:4.4-rc

爱喝水的木子...小于 1 分钟dockermongodbdocker
简单搭建neo4j环境

dockerfile.yaml

# docker-compose.yaml
version: "3"
services:
  neo4j:
    image: neo4j
    volumes:

      - ./db/neo4j/conf:/var/lib/neo4j/conf:rw
      - ./db/neo4j/mnt:/var/lib/neo4j/import:rw
      - ./db/neo4j/plugins:/plugins:rw
      - ./db/neo4j/data:/data:rw
      - ./db/neo4j/logs:/var/lib/neo4j/logs:rw

    restart: always
    ports:

      - 7474:7474
      - 7687:7687

    environment:

      - NEO4J_dbms_memory_heap_maxSize=4G
      - NEO4J_AUTH=neo4j/123456 #修改默认用户密码


爱喝水的木子...小于 1 分钟dockerneo4jdocker
docker配置加速
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://registry.hub.docker.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://mirror.baidubce.com",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://docker.nju.edu.cn"
  ]
}

爱喝水的木子...小于 1 分钟dockerwindowsdockermongo环境
docker-容器自动重启

容器未创建时

docker run -d --restart=always --name 设置容器名 使用的镜像
--restart具体参数值详细信息:
    no        // 默认策略,容器退出时不重启容器;
    on-failure    // 在容器非正常退出时(退出状态非0)才重新启动容器;
    on-failure:3    // 在容器非正常退出时重启容器,最多重启3次;
    always      // 无论退出状态是如何,都重启容器;
    unless-stopped  // 在容器退出时总是重启容器,但是不考虑在 Docker 守护进程启动时就已经停止了的容器。

爱喝水的木子...小于 1 分钟devdockerrestartdev