master c4e301a1a419 cached
184 files
170.7 KB
51.7k tokens
35 symbols
1 requests
Download .txt
Showing preview only (213K chars total). Download the full file or copy to clipboard to get everything.
Repository: FX-Max/docker-install-everything
Branch: master
Commit: c4e301a1a419
Files: 184
Total size: 170.7 KB

Directory structure:
gitextract_wnm2lqsh/

├── LICENSE
├── MinIO/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── MinIO-cluster/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── README.md
├── Yearning/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── apollo/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   ├── log/
│   │   └── .gitignore
│   └── sql/
│       ├── apolloconfigdb.sql
│       └── apolloportaldb.sql
├── beanstalkd/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── confluence/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── drawio/
│   ├── .gitignore
│   ├── Dockerfile
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── elk/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   ├── filebeat/
│   │   ├── Dockerfile
│   │   └── filebeat.yml
│   ├── log/
│   │   └── .gitignore
│   └── logstash/
│       ├── Dockerfile
│       └── logstash.conf
├── example/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── excalidraw/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── gitlab/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jenkins/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jira/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── mysql/
│   │   │   └── my.cnf
│   │   └── mysql-connector-java-5.1.48.jar
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jumpserver/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jumpserver-all-in-one/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── maxwell/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── maxwell/
│   │   │   └── config.properties
│   │   └── mysql/
│   │       └── mysql.cnf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── mongo/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── mongod.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── mongo-express/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── mongod.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── phpmyadmin/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── prometheus/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── alertmanager/
│   │   │   └── alertmanager.yml
│   │   └── prometheus/
│   │       ├── prometheus.yml
│   │       └── rules/
│   │           └── demo.rules
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── rabbitmq/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── rabbitmq.config
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── redis/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── redis.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── redis-cluster/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── redis-master.conf
│   │   ├── redis-sentinel1.conf
│   │   ├── redis-sentinel2.conf
│   │   ├── redis-sentinel3.conf
│   │   ├── redis-slave1.conf
│   │   ├── redis-slave2.conf
│   │   └── redis-slave3.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── wikijs/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── wordpress/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── my.cnf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
└── yapi/
    ├── .gitignore
    ├── README.md
    ├── conf/
    │   └── .gitignore
    ├── data/
    │   └── .gitignore
    ├── docker-compose.yml
    └── log/
        └── .gitignore

================================================
FILE CONTENTS
================================================

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2022 MaxFang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: MinIO/.gitignore
================================================
.env

================================================
FILE: MinIO/README.md
================================================
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d minio
```

访问: [http://127.0.0.1:9000](http://127.0.0.1:9000),使用 .env 中的默认用户`miniouser`,密码`miniopassword`登录。


一般会使用nginx代理访问该服务,下面为对应的 nginx 配置实例。

```
server {
 listen 80;
 server_name minio.example.com;

 ignore_invalid_headers off;
 client_max_body_size 0;
 proxy_buffering off;

 location / {
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header Host $http_host;

   proxy_connect_timeout 300;
   # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
   proxy_http_version 1.1;
   proxy_set_header Connection "";
   chunked_transfer_encoding off;

   proxy_pass http://localhost:9000;
 }
}
```

参考:[setup-nginx-proxy-with-minio](https://docs.min.io/docs/setup-nginx-proxy-with-minio)


================================================
FILE: MinIO/conf/.gitignore
================================================


================================================
FILE: MinIO/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: MinIO/docker-compose.yml
================================================
version: '3'
services:
  minio:
    image: minio/minio:${VERSION}
    container_name: minio
    ports:
      - ${PORT}:9000
    restart: always
    environment:
      TZ: ${TIMEZONE}
      MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
      MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
    volumes:
      - ./data/minio:/data
      - ./conf/config:/root/.minio
    command: server /data

================================================
FILE: MinIO/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: MinIO-cluster/.gitignore
================================================
.env

================================================
FILE: MinIO-cluster/README.md
================================================
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d minio1 minio2 minio3 minio4
```

一般会使用nginx代理访问该服务,下面为对应的 nginx 配置实例。
访问: [http://minio.example.com](http://minio.example.com),使用 .env 中的默认用户`miniouser`,密码`miniopassword`登录。

```

upstream minio {
  server localhost:9001;
  server localhost:9002;
  server localhost:9003;
  server localhost:9004;
}

server {
 listen 80;
 server_name minio.example.com;

 ignore_invalid_headers off;
 client_max_body_size 0;
 proxy_buffering off;

 location / {
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header Host $http_host;

   proxy_connect_timeout 300;
   # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
   proxy_http_version 1.1;
   proxy_set_header Connection "";
   chunked_transfer_encoding off;

   proxy_pass http://minio;
 }
}
```

参考:[setup-nginx-proxy-with-minio](https://docs.min.io/docs/setup-nginx-proxy-with-minio)


================================================
FILE: MinIO-cluster/conf/.gitignore
================================================


================================================
FILE: MinIO-cluster/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: MinIO-cluster/docker-compose.yml
================================================
version: '3'
services:
  minio1:
    image: minio/minio:${VERSION}
    container_name: minio1
    ports:
      - ${PORT_NODE1}:9000
#    restart: always
    environment:
      TZ: ${TIMEZONE}
      MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
      MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
    volumes:
      - ./data/minio1/1:/data1
      - ./data/minio1/2:/data2
      - ./conf/config1:/root/.minio
    command: server http://minio{1...4}/data{1...2}

  minio2:
    image: minio/minio:${VERSION}
    container_name: minio2
    ports:
      - ${PORT_NODE2}:9000
#    restart: always
    environment:
      TZ: ${TIMEZONE}
      MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
      MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
    volumes:
      - ./data/minio2/1:/data1
      - ./data/minio2/2:/data2
      - ./conf/config2:/root/.minio
    command: server http://minio{1...4}/data{1...2}

  minio3:
    image: minio/minio:${VERSION}
    container_name: minio3
    ports:
      - ${PORT_NODE3}:9000
#    restart: always
    environment:
      TZ: ${TIMEZONE}
      MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
      MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
    volumes:
      - ./data/minio3/1:/data1
      - ./data/minio3/2:/data2
      - ./conf/config3:/root/.minio
    command: server http://minio{1...4}/data{1...2} 

  minio4:
    image: minio/minio:${VERSION}
    container_name: minio4
    ports:
      - ${PORT_NODE4}:9000
#    restart: always
    environment:
      TZ: ${TIMEZONE}
      MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
      MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
    volumes:
      - ./data/minio4/1:/data1
      - ./data/minio4/2:/data2
      - ./conf/config4:/root/.minio
    command: server http://minio{1...4}/data{1...2}


================================================
FILE: MinIO-cluster/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: README.md
================================================
# docker-install-everything

> install all environments using docker-compose.
> 使用 docker-compose 安装各种服务。

## 项目特色

- 仅依赖 docker 和 docker-compose,无需本地复杂环境。
- 支持软件和服务多,并且在持续新增。
- 每个文件夹一组(套)服务,根据需要安装即可。
- 所有的文件夹相互独立,无互相依赖,降低使用难度。

## 使用方法

```
git clone https://github.com/FX-Max/docker-install-everything.git
cd docker-install-everything
# 进入里想要安装的服务文件夹后,按照文件夹内的 README 文件介绍使用。
# 以安装 redis 为例:
cd redis
# 根据目录下 README 中的说明操作即可
docker-compose up -d redis
```

## 支持列表

- apollo

    简要说明: [Apollo](https://github.com/apolloconfig/apollo/) 是一款可靠的分布式配置管理中心,诞生于携程框架研发部。

- beanstalkd

    简要说明: [beanstalkd](https://beanstalkd.github.io/),高性能,轻量级的分布式内存队列。

- drawio

    简要说明: [drawio](https://github.com/jgraph/drawio)是一款强大、免费的绘图工具。

- elk

    简要说明: 强大的日志收集和分析解决方案,Elasticsearch + Logstash + Kibana + Filebeat。

- excalidraw

    简要说明: [excalidraw](https://excalidraw.com/),非常流行的画图工具,在线白板。

- gitlab

    简要说明: [gitlab](https://about.gitlab.com/),非常流行的开源的Git代码仓库系统。

- jenkins

    简要说明: [jenkins](https://github.com/jenkinsci/jenkins) 是最流行的可扩展的持续集成引擎。

- jira

    简要说明: JIRA 是由 Atlassian 公司出品的,被业界公认为最好的项目管理和开发管理工具。

- jumpserver

    简要说明: [JumpServer](https://github.com/jumpserver/jumpserver) 是广受欢迎的开源堡垒机。

- jumpserver-all-in-one

    简要说明: 一键部署 jumpserver 全套环境,不依赖外部服务。

- Maxwell

    简要说明: [Maxwell](https://github.com/zendesk/maxwell),一个能实时读取MySQL二进制日志Binlog,并生成JSON格式的消息,作为生产者发送给Kafka等系统的应用程序。

- MinIO

    简要说明: [MinIO](https://github.com/minio/minio),基于 Golang 的一款开源的高性能分布式存储方案,兼容亚马逊S3云存储服务接口。本 docker 版本是单机版本。

- MinIO-cluster

    简要说明: [MinIO](https://github.com/minio/minio) 分布式集群版本。

- mongo

    简要说明: [MongoDB](https://www.mongodb.com/) 是一个基于分布式文件存储的数据库。

- mongo-express

    简要说明: [mongo-express](https://github.com/mongo-express/mongo-express) 是一个基于 Node.js 和 express 的开源的 MongoDB Web 管理工具。

- phpmyadmin

    简要说明: [phpmyadmin](https://github.com/phpmyadmin/phpmyadmin) 是一款基于 Web 的 MySQL 数据库管理工具。

- rabbitmq

    简要说明: [RabbitMQ](https://www.rabbitmq.com/) 是一款使用Erlang语言开发的,实现AMQP(高级消息队列协议)的开源消息中间件。

- redis

    简要说明: 快速搭建 [redis](https://github.com/redis/redis) 服务。

- redis-cluster

    简要说明: 快速搭建 [redis](https://github.com/redis/redis) 集群服务,1主多从多哨兵。

- wikijs

    简要说明: 自建开源的wiki/文档管理系统 [wiki.js](https://js.wiki/)。

- wordpress

    简要说明: [wordpress](https://github.com/WordPress/WordPress),最流行的免费建站系统。

- yapi

    简要说明: [YApi](https://github.com/YMFE/yapi) 是一个可本地部署的、打通前后端及QA的、可视化的接口管理平台。

- Yearning

	简要说明: [Yearning](https://github.com/cookieY/Yearning),基于 Go 的开箱即用的MYSQL SQL审核工具。


## 欢迎加入

- 如果在使用本项目的过程中发现了问题或有建议,欢迎交流提 issue。
- 欢迎 fork 代码,不断改进优化。

## 感谢关注

如果项目对您有帮助,请帮忙点点小星星,谢谢。

## Support

IDE for this project is supported by [Jetbrains](https://jb.gg/OpenSourceSupport).

[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png)](https://jb.gg/OpenSourceSupport)


================================================
FILE: Yearning/.gitignore
================================================
.env

================================================
FILE: Yearning/README.md
================================================
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d
```

> 若发现 mysql 起来了,Yearning 服务未起来。
> docker logs yearning
> 输出:mysql连接失败! 亲 数据库建了没? 配置填对了没?
> 可以再次执行: docker-compose up -d


访问: [http://127.0.0.1:8000](http://127.0.0.1:8000)


================================================
FILE: Yearning/conf/.gitignore
================================================


================================================
FILE: Yearning/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: Yearning/docker-compose.yml
================================================
version: '3'

services:
    yearning:
        image: chaiyd/yearning:latest
        container_name: yearning
        environment:
           MYSQL_USER: ${MYSQL_USER}
           MYSQL_PASSWORD: ${MYSQL_PASSWORD}
           MYSQL_ADDR: mysql
           MYSQL_DB: ${MYSQL_DATABASE}
           SECRET_KEY: ${YEARNING_SECRET_KEY}
           IS_DOCKER: is_docker
        ports:
           - ${YEARNING_PORT}:8000
        # 首次使用请先初始化
        command: /bin/bash -c "./Yearning install && ./Yearning run"
        depends_on:
           - mysql
        restart: always

    mysql:
        image: mysql:5.7
        environment:
           MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
           MYSQL_DATABASE: ${MYSQL_DATABASE}
           MYSQL_USER: ${MYSQL_USER}
           MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        command:
           - --character-set-server=utf8mb4
           - --collation-server=utf8mb4_general_ci
        volumes:
           - ./data/mysql:/var/lib/mysql

================================================
FILE: Yearning/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: apollo/.gitignore
================================================
.env

================================================
FILE: apollo/README.md
================================================
# example

## Usage

1. 添加配置,创建网络
```bash
cp .env.example .env

docker network create apollo
```

2. 启动数据库服务,账号授权
```bash
docker-compose up -d apollo-db

docker exec -it apollo-db /bin/bash

root@4a8959ee8f6c:/# mysql -uroot -p123456

mysql> GRANT ALL PRIVILEGES ON `ApolloPortalDB`.* TO 'apollo'@'%';
```

3. 启动其他服务
```bash
docker-compose up -d apollo-adminservice  apollo-portal apollo-configservice
```

访问:

apollo-portal: [http://127.0.0.1:8070](http://127.0.0.1:8070) 
	默认账号: apollo 默认密码:admin

apollo-configservice: [http://127.0.0.1:8080](http://127.0.0.1:8080)

apollo-adminservice: [http://127.0.0.1:8090](http://127.0.0.1:8090)

================================================
FILE: apollo/conf/.gitignore
================================================


================================================
FILE: apollo/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: apollo/docker-compose.yml
================================================
version: '3'
services:
  apollo-configservice:
    image: apolloconfig/apollo-configservice
    container_name: apollo-configservice
    ports:
      - '8080:8080'
    volumes:
      - './log/apollo-configservice:/opt/logs'
    networks:
      - apollo
    environment:
      - TZ='Asia/Shanghai'
      - >-
        SPRING_DATASOURCE_URL=jdbc:mysql://apollo-db:3306/ApolloConfigDB?characterEncoding=utf8
      - 'SPRING_DATASOURCE_USERNAME=${MYSQL_USER}'
      - 'SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}'
    depends_on:
      - apollo-db
  apollo-portal:
    image: apolloconfig/apollo-portal
    container_name: apollo-portal
    ports:
      - '8070:8070'
    volumes:
      - './log/apollo-portal:/opt/logs'
    networks:
      - apollo
    environment:
      - >-
        SPRING_DATASOURCE_URL=jdbc:mysql://apollo-db:3306/ApolloPortalDB?characterEncoding=utf8
      - 'SPRING_DATASOURCE_USERNAME=${MYSQL_USER}'
      - 'SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}'
      - 'DEV_META=http://apollo-configservice:8080'
    depends_on:
      - apollo-db
  apollo-adminservice:
    image: apolloconfig/apollo-adminservice
    container_name: apollo-adminservice
    ports:
      - '8090:8090'
    volumes:
      - './log/apollo-adminservice:/opt/logs'
    networks:
      - apollo
    environment:
      - >-
        SPRING_DATASOURCE_URL=jdbc:mysql://apollo-db:3306/ApolloConfigDB?characterEncoding=utf8
      - 'SPRING_DATASOURCE_USERNAME=${MYSQL_USER}'
      - 'SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}'
    depends_on:
      - apollo-db
  apollo-db:
    image: 'mysql:5.7'
    container_name: apollo-db
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
      MYSQL_DATABASE: '${MYSQL_DATABASE}'
      MYSQL_USER: '${MYSQL_USER}'
      MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
    ports:
      - '3306:3306'
    volumes:
      - './sql:/docker-entrypoint-initdb.d'
      - './data/mysql:/var/lib/mysql'
    networks:
      - apollo
networks:
  apollo:
    external:
      name: apollo


================================================
FILE: apollo/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: apollo/sql/apolloconfigdb.sql
================================================
--
-- Copyright 2022 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

# Create Database
# ------------------------------------------------------------
CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4;

Use ApolloConfigDB;

# Dump of table app
# ------------------------------------------------------------

DROP TABLE IF EXISTS `App`;

CREATE TABLE `App` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
  `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
  `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
  `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
  `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_Name` (`Name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';



# Dump of table appnamespace
# ------------------------------------------------------------

DROP TABLE IF EXISTS `AppNamespace`;

CREATE TABLE `AppNamespace` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
  `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
  `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
  `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
  `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
  KEY `Name_AppId` (`Name`,`AppId`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';



# Dump of table audit
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Audit`;

CREATE TABLE `Audit` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名',
  `EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID',
  `OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型',
  `Comment` varchar(500) DEFAULT NULL COMMENT '备注',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表';



# Dump of table cluster
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Cluster`;

CREATE TABLE `Cluster` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字',
  `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id',
  `ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
  KEY `IX_ParentClusterId` (`ParentClusterId`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群';



# Dump of table commit
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Commit`;

CREATE TABLE `Commit` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `ChangeSets` longtext NOT NULL COMMENT '修改变更集',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
  `Comment` varchar(500) DEFAULT NULL COMMENT '备注',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`),
  KEY `AppId` (`AppId`(191)),
  KEY `ClusterName` (`ClusterName`(191)),
  KEY `NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表';

# Dump of table grayreleaserule
# ------------------------------------------------------------

DROP TABLE IF EXISTS `GrayReleaseRule`;

CREATE TABLE `GrayReleaseRule` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
  `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
  `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name',
  `Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则',
  `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release',
  `BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表';


# Dump of table instance
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Instance`;

CREATE TABLE `Instance` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  `DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name',
  `Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`),
  KEY `IX_IP` (`Ip`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例';



# Dump of table instanceconfig
# ------------------------------------------------------------

DROP TABLE IF EXISTS `InstanceConfig`;

CREATE TABLE `InstanceConfig` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id',
  `ConfigAppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id',
  `ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name',
  `ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name',
  `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
  `ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`),
  KEY `IX_ReleaseKey` (`ReleaseKey`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息';



# Dump of table item
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Item`;

CREATE TABLE `Item` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
  `Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
  `Value` longtext NOT NULL COMMENT '配置项值',
  `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
  `LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `IX_GroupId` (`NamespaceId`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目';



# Dump of table namespace
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Namespace`;

CREATE TABLE `Namespace` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
  `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_ClusterName_NamespaceName_DeletedAt` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191),`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间';



# Dump of table namespacelock
# ------------------------------------------------------------

DROP TABLE IF EXISTS `NamespaceLock`;

CREATE TABLE `NamespaceLock` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_NamespaceId_DeletedAt` (`NamespaceId`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁';



# Dump of table release
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Release`;

CREATE TABLE `Release` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
  `Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字',
  `Comment` varchar(256) DEFAULT NULL COMMENT '发布说明',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
  `Configurations` longtext NOT NULL COMMENT '发布配置',
  `IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_ReleaseKey_DeletedAt` (`ReleaseKey`,`DeletedAt`),
  KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布';


# Dump of table releasehistory
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ReleaseHistory`;

CREATE TABLE `ReleaseHistory` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
  `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名',
  `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id',
  `PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId',
  `Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度',
  `OperationContext` longtext NOT NULL COMMENT '发布上下文信息',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`),
  KEY `IX_ReleaseId` (`ReleaseId`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史';


# Dump of table releasemessage
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ReleaseMessage`;

CREATE TABLE `ReleaseMessage` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容',
  `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_Message` (`Message`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息';



# Dump of table serverconfig
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ServerConfig`;

CREATE TABLE `ServerConfig` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
  `Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群',
  `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
  `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_Key_Cluster_DeletedAt` (`Key`,`Cluster`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';

# Dump of table accesskey
# ------------------------------------------------------------

DROP TABLE IF EXISTS `AccessKey`;

CREATE TABLE `AccessKey` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret',
  `IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_Secret_DeletedAt` (`AppId`,`Secret`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥';

# Config
# ------------------------------------------------------------
INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)
VALUES
    ('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'),
    ('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'),
    ('item.value.length.limit', 'default', '20000', 'item value最大长度限制'),
    ('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!'),
    ('item.key.length.limit', 'default', '128', 'item key 最大长度限制');

# Sample Data
# ------------------------------------------------------------
INSERT INTO `App` (`AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmail`)
VALUES
  ('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com');

INSERT INTO `AppNamespace` (`Name`, `AppId`, `Format`, `IsPublic`, `Comment`)
VALUES
  ('application', 'SampleApp', 'properties', 0, 'default app namespace');

INSERT INTO `Cluster` (`Name`, `AppId`)
VALUES
  ('default', 'SampleApp');

INSERT INTO `Namespace` (`Id`, `AppId`, `ClusterName`, `NamespaceName`)
VALUES
  (1, 'SampleApp', 'default', 'application');


INSERT INTO `Item` (`NamespaceId`, `Key`, `Value`, `Comment`, `LineNum`)
VALUES
  (1, 'timeout', '100', 'sample timeout配置', 1);

INSERT INTO `Release` (`ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`)
VALUES
  ('20161009155425-d3a0749c6e20bc15', '20161009155424-release', 'Sample发布', 'SampleApp', 'default', 'application', '{\"timeout\":\"100\"}');

INSERT INTO `ReleaseHistory` (`AppId`, `ClusterName`, `NamespaceName`, `BranchName`, `ReleaseId`, `PreviousReleaseId`, `Operation`, `OperationContext`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)
VALUES
  ('SampleApp', 'default', 'application', 'default', 1, 0, 0, '{}', 'apollo', 'apollo');

INSERT INTO `ReleaseMessage` (`Message`)
VALUES
  ('SampleApp+default+application');

/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

================================================
FILE: apollo/sql/apolloportaldb.sql
================================================
--
-- Copyright 2022 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

# Create Database
# ------------------------------------------------------------
CREATE DATABASE IF NOT EXISTS ApolloPortalDB DEFAULT CHARACTER SET = utf8mb4;

Use ApolloPortalDB;

# Dump of table app
# ------------------------------------------------------------

DROP TABLE IF EXISTS `App`;

CREATE TABLE `App` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
  `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
  `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
  `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
  `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_Name` (`Name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';



# Dump of table appnamespace
# ------------------------------------------------------------

DROP TABLE IF EXISTS `AppNamespace`;

CREATE TABLE `AppNamespace` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
  `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
  `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
  `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
  `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
  KEY `Name_AppId` (`Name`,`AppId`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';



# Dump of table consumer
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Consumer`;

CREATE TABLE `Consumer` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
  `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
  `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
  `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
  `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='开放API消费者';



# Dump of table consumeraudit
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ConsumerAudit`;

CREATE TABLE `ConsumerAudit` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id',
  `Uri` varchar(1024) NOT NULL DEFAULT '' COMMENT '访问的Uri',
  `Method` varchar(16) NOT NULL DEFAULT '' COMMENT '访问的Method',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_ConsumerId` (`ConsumerId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer审计表';



# Dump of table consumerrole
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ConsumerRole`;

CREATE TABLE `ConsumerRole` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id',
  `RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_ConsumerId_RoleId_DeletedAt` (`ConsumerId`,`RoleId`,`DeletedAt`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_RoleId` (`RoleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer和role的绑定表';



# Dump of table consumertoken
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ConsumerToken`;

CREATE TABLE `ConsumerToken` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'ConsumerId',
  `Token` varchar(128) NOT NULL DEFAULT '' COMMENT 'token',
  `Expires` datetime NOT NULL DEFAULT '2099-01-01 00:00:00' COMMENT 'token失效时间',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_Token_DeletedAt` (`Token`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer token表';

# Dump of table favorite
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Favorite`;

CREATE TABLE `Favorite` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `UserId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '收藏的用户',
  `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  `Position` int(32) NOT NULL DEFAULT '10000' COMMENT '收藏顺序',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_UserId_AppId_DeletedAt` (`UserId`,`AppId`,`DeletedAt`),
  KEY `AppId` (`AppId`(191)),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COMMENT='应用收藏表';

# Dump of table permission
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Permission`;

CREATE TABLE `Permission` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `PermissionType` varchar(32) NOT NULL DEFAULT '' COMMENT '权限类型',
  `TargetId` varchar(256) NOT NULL DEFAULT '' COMMENT '权限对象类型',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_TargetId_PermissionType_DeletedAt` (`TargetId`,`PermissionType`,`DeletedAt`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='permission表';



# Dump of table role
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Role`;

CREATE TABLE `Role` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `RoleName` varchar(256) NOT NULL DEFAULT '' COMMENT 'Role name',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_RoleName_DeletedAt` (`RoleName`,`DeletedAt`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';



# Dump of table rolepermission
# ------------------------------------------------------------

DROP TABLE IF EXISTS `RolePermission`;

CREATE TABLE `RolePermission` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
  `PermissionId` int(10) unsigned DEFAULT NULL COMMENT 'Permission Id',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_RoleId_PermissionId_DeletedAt` (`RoleId`,`PermissionId`,`DeletedAt`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_PermissionId` (`PermissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和权限的绑定表';



# Dump of table serverconfig
# ------------------------------------------------------------

DROP TABLE IF EXISTS `ServerConfig`;

CREATE TABLE `ServerConfig` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
  `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
  `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_Key_DeletedAt` (`Key`,`DeletedAt`),
  KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';



# Dump of table userrole
# ------------------------------------------------------------

DROP TABLE IF EXISTS `UserRole`;

CREATE TABLE `UserRole` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `UserId` varchar(128) DEFAULT '' COMMENT '用户身份标识',
  `RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
  `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
  `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_UserId_RoleId_DeletedAt` (`UserId`,`RoleId`,`DeletedAt`),
  KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
  KEY `IX_RoleId` (`RoleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和role的绑定表';

# Dump of table Users
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Users`;

CREATE TABLE `Users` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `Username` varchar(64) NOT NULL DEFAULT 'default' COMMENT '用户登录账户',
  `Password` varchar(512) NOT NULL DEFAULT 'default' COMMENT '密码',
  `UserDisplayName` varchar(512) NOT NULL DEFAULT 'default' COMMENT '用户名称',
  `Email` varchar(64) NOT NULL DEFAULT 'default' COMMENT '邮箱地址',
  `Enabled` tinyint(4) DEFAULT NULL COMMENT '是否有效',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UK_Username` (`Username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';


# Dump of table Authorities
# ------------------------------------------------------------

DROP TABLE IF EXISTS `Authorities`;

CREATE TABLE `Authorities` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  `Username` varchar(64) NOT NULL,
  `Authority` varchar(50) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


# Config
# ------------------------------------------------------------
INSERT INTO `ServerConfig` (`Key`, `Value`, `Comment`)
VALUES
    ('apollo.portal.envs', 'dev', '可支持的环境列表'),
    ('organizations', '[{\"orgId\":\"TEST1\",\"orgName\":\"样例部门1\"},{\"orgId\":\"TEST2\",\"orgName\":\"样例部门2\"}]', '部门列表'),
    ('superAdmin', 'apollo', 'Portal超级管理员'),
    ('api.readTimeout', '10000', 'http接口read timeout'),
    ('consumer.token.salt', 'someSalt', 'consumer token salt'),
    ('admin.createPrivateNamespace.switch', 'true', '是否允许项目管理员创建私有namespace'),
    ('configView.memberOnly.envs', 'dev', '只对项目成员显示配置信息的环境列表,多个env以英文逗号分隔'),
    ('apollo.portal.meta.servers', '{}', '各环境Meta Service列表');

INSERT INTO `Users` (`Username`, `Password`, `UserDisplayName`, `Email`, `Enabled`)
VALUES
    ('apollo', '$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS', 'apollo', 'apollo@acme.com', 1);

INSERT INTO `Authorities` (`Username`, `Authority`) VALUES ('apollo', 'ROLE_user');

# Sample Data
# ------------------------------------------------------------
INSERT INTO `App` (`AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmail`)
VALUES
  ('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com');

INSERT INTO `AppNamespace` (`Name`, `AppId`, `Format`, `IsPublic`, `Comment`)
VALUES
  ('application', 'SampleApp', 'properties', 0, 'default app namespace');

INSERT INTO `Permission` (`Id`, `PermissionType`, `TargetId`)
VALUES
  (1, 'CreateCluster', 'SampleApp'),
  (2, 'CreateNamespace', 'SampleApp'),
  (3, 'AssignRole', 'SampleApp'),
  (4, 'ModifyNamespace', 'SampleApp+application'),
  (5, 'ReleaseNamespace', 'SampleApp+application');

INSERT INTO `Role` (`Id`, `RoleName`)
VALUES
  (1, 'Master+SampleApp'),
  (2, 'ModifyNamespace+SampleApp+application'),
  (3, 'ReleaseNamespace+SampleApp+application');

INSERT INTO `RolePermission` (`RoleId`, `PermissionId`)
VALUES
  (1, 1),
  (1, 2),
  (1, 3),
  (2, 4),
  (3, 5);

INSERT INTO `UserRole` (`UserId`, `RoleId`)
VALUES
  ('apollo', 1),
  ('apollo', 2),
  ('apollo', 3);

-- spring session (https://github.com/spring-projects/spring-session/blob/faee8f1bdb8822a5653a81eba838dddf224d92d6/spring-session-jdbc/src/main/resources/org/springframework/session/jdbc/schema-mysql.sql)
CREATE TABLE SPRING_SESSION (
  PRIMARY_ID CHAR(36) NOT NULL,
  SESSION_ID CHAR(36) NOT NULL,
  CREATION_TIME BIGINT NOT NULL,
  LAST_ACCESS_TIME BIGINT NOT NULL,
  MAX_INACTIVE_INTERVAL INT NOT NULL,
  EXPIRY_TIME BIGINT NOT NULL,
  PRINCIPAL_NAME VARCHAR(100),
  CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;

CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID);
CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME);
CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME);

CREATE TABLE SPRING_SESSION_ATTRIBUTES (
  SESSION_PRIMARY_ID CHAR(36) NOT NULL,
  ATTRIBUTE_NAME VARCHAR(200) NOT NULL,
  ATTRIBUTE_BYTES BLOB NOT NULL,
  CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME),
  CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) REFERENCES SPRING_SESSION(PRIMARY_ID) ON DELETE CASCADE
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;

/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

================================================
FILE: beanstalkd/.gitignore
================================================
.env

================================================
FILE: beanstalkd/README.md
================================================
# example

## Usage

```bash
docker-compose up -d beanstalkd
docker-compose up -d beanstalkd-console
```

beanstalkd 管理界面访问: [http://127.0.0.1:2080](http://127.0.0.1:2080)


================================================
FILE: beanstalkd/conf/.gitignore
================================================


================================================
FILE: beanstalkd/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: beanstalkd/docker-compose.yml
================================================
version: "3"
services:
  beanstalkd:
    image: schickling/beanstalkd
    container_name: beanstalkd
    ports:
      - 11300:11300
    volumes:
      - ./data/beanstalk:/data # binlog日志存储
    command: "-p 11300 -b /data"

  beanstalkd-console:
    image: schickling/beanstalkd-console
    container_name: beanstalkd-console
    ports:
      - 2080:2080
    environment:
      BEANSTALKD_PORT_11300_TCP_ADDR: beanstalkd
    links:
      - beanstalkd

================================================
FILE: beanstalkd/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: confluence/.gitignore
================================================
.env

================================================
FILE: confluence/README.md
================================================
# example

## Usage

```bash
cp .env.example .env # 如有
docker-compose up -d xxx
```

访问: [http://127.0.0.1:80](http://127.0.0.1:80)


================================================
FILE: confluence/conf/.gitignore
================================================


================================================
FILE: confluence/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: confluence/docker-compose.yml
================================================
version: '3'
services:
  confluence:
    image: cptactionhank/atlassian-confluence:latest
    container_name: confluence
    ports:
      - "8090:8090"
      - "8091:8091"
#    restart: always
    depends_on:
      - db
    volumes:
      - ./log/confluence:/opt/atlassian/confluence/logs
      - ./data/confluence:/var/atlassian/confluence
  db:
    image: postgres:latest
    container_name: confluence-db
    ports:
      - "5432:5432"
#    restart: always
    environment:
      - POSTGRES_PASSWORD=zvg786nadgz
    volumes:
      - ./data/pgsql:/var/lib/postgresql/data


================================================
FILE: confluence/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: drawio/.gitignore
================================================
.env

================================================
FILE: drawio/Dockerfile
================================================
FROM frekele/ant:1.10.3-jdk8 as BUILD
RUN apt-get update && \
    apt-get install git -y && \
    mkdir /usr/build && \
    git clone https://github.com/jgraph/drawio.git && \
    mv drawio/* /usr/build/ && \
    cd /usr/build/etc/build/ && \
    ant war

FROM tomcat:9.0 as TARGET
COPY --from=BUILD /usr/build/build/draw.war /usr/local/tomcat/webapps/
EXPOSE 8080
CMD ["catalina.sh", "run"]

================================================
FILE: drawio/README.md
================================================
# example

## Usage

```bash
docker-compose up -d drawio
```

构建过程可能比较长,请耐心等待。

访问: [http://127.0.0.1:8080/draw/](http://127.0.0.1:8080/draw/)


================================================
FILE: drawio/conf/.gitignore
================================================


================================================
FILE: drawio/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: drawio/docker-compose.yml
================================================
version: "3"
services: 
  drawio:
    build: "."
    container_name: "drawio"
#    restart: "always"
    ports: 
      - "8080:8080"

================================================
FILE: drawio/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: elk/.gitignore
================================================
.env

================================================
FILE: elk/README.md
================================================
# example

## Usage

```bash
cp .env.example .env

# 修改 docker-compose.yml 文件中的内容,改成你宿主机 IP
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.197.121:9092 #宿主机IP

docker network create --gateway 172.28.1.1 --subnet 172.28.0.1/16 net_elk

docker-compose up -d
```

访问: [http://127.0.0.1:5601](http://127.0.0.1:5601)


================================================
FILE: elk/conf/.gitignore
================================================


================================================
FILE: elk/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: elk/docker-compose.yml
================================================
version: "3"
services:

  zookeeper:
    image: wurstmeister/zookeeper
    container_name: zookeeper
    ports:
      - "2181:2181"
    networks:
      net_elk:
        ipv4_address: ${ZK_IP}

  kafka:
    image: wurstmeister/kafka
    container_name: kafka
    privileged: true
    ports:
      - "9092:9092"
    depends_on:
      - zookeeper
    environment:
      KFAKA_BROKER_ID: 1
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.197.121:9092 #宿主机IP
      KAFKA_LISTENERS: PLAINTEXT://:9092
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data/kafka:/kafka
    networks:
      net_elk:
        ipv4_address: ${KAFKA_IP}

  logstash:
    build:
      ./logstash
    container_name: logstash
    privileged: true
    environment:
      LS_JAVA_OPTS: "-Xmx1g -Xms1g"
    depends_on:
      - elasticsearch
    networks:
      net_elk:
        ipv4_address: ${LOGSTASH_IP}

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
    container_name: elasticsearch
    privileged: true
    environment:
      - "discovery.type=single-node"
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - "TAKE_FILE_OWNERSHIP=true"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./data/elasticsearch:/usr/share/elasticsearch/data
      - ./log/elasticsearch:/usr/share/elasticsearch/logs
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      net_elk:
        ipv4_address: ${ES_IP}

  kibana:
    image: docker.elastic.co/kibana/kibana:7.9.2
    container_name: kibana
    environment:
      SERVER_HOST: 0.0.0.0
      ELASTICSEARCH_HOSTS: http://${ES_IP}:9200
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch
    networks:
      net_elk:
        ipv4_address: ${KIBANA_IP}

  filebeat:
    build:
      ./filebeat
    container_name: filebeat
    command: filebeat -e -strict.perms=false
    user: root
    privileged: true
    volumes:
      - ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
      - ./log/filebeat:/usr/share/filebeat/logs
      - ./data/filebeat:/usr/share/filebeat/data
      - /var/lib/docker/containers:/var/lib/docker/containers:ro
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - kibana
    networks:
      net_elk:
        ipv4_address: ${FILEBEAT_IP}

networks:
  net_elk:
    external: true


================================================
FILE: elk/filebeat/Dockerfile
================================================
FROM docker.elastic.co/beats/filebeat:7.9.2

COPY filebeat.yml /usr/share/filebeat/filebeat.yml

USER root
RUN chown root:filebeat /usr/share/filebeat/filebeat.yml

USER filebeat


================================================
FILE: elk/filebeat/filebeat.yml
================================================
###################### Filebeat Configuration Example #########################

# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html

# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.

# ============================== Filebeat inputs ===============================

filebeat.inputs:

  - type: log

    # Change to true to enable this input configuration.
    #  enabled: false
    enabled: true

    # Paths that should be crawled and fetched. Glob based paths.
    paths:
      - /var/log/nginx/*.log
    file_identity.path: ~

    # Exclude lines. A list of regular expressions to match. It drops the lines that are
    # matching any regular expression from the list.
    #exclude_lines: ['^DBG']

    # Include lines. A list of regular expressions to match. It exports the lines that are
    # matching any regular expression from the list.
    #include_lines: ['^ERR', '^WARN']

    # Exclude files. A list of regular expressions to match. Filebeat drops the files that
    # are matching any regular expression from the list. By default, no files are dropped.
    #exclude_files: ['.gz$']

    # Optional additional fields. These fields can be freely picked
    # to add additional information to the crawled log files for filtering
    fields:
      topic: eris.log
    #  review: 1

    ### Multiline options

    # Multiline can be used for log messages spanning multiple lines. This is common
    # for Java Stack Traces or C-Line Continuation

    # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
    multiline.pattern: ^\[\d{4}\-\d{2}\-\d{2}\s(\d{2}:){2}\d{2}\]

    # Defines if the pattern set under pattern should be negated or not. Default is false.
    multiline.negate: true

    # Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
    # that was (not) matched before or after or as long as a pattern is not matched based on negate.
    # Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
    multiline.match: after

# ============================== Filebeat modules ==============================

filebeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

  # Period on which files under path should be checked for changes
  #reload.period: 10s

# ======================= Elasticsearch template setting =======================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false


# ================================== General ===================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
#  env: staging

# ================================= Dashboards =================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

# Kibana Host
# Scheme and port can be left out and will be set to the default (http and 5601)
# In case you specify and additional path, the scheme is required: http://localhost:5601/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
#host: "localhost:5601"

# Kibana Space ID
# ID of the Kibana Space into which the dashboards should be loaded. By default,
# the Default Space will be used.
#space.id:

# =============================== Elastic Cloud ================================

# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.
output.kafka:
  hosts: ["kafka:9092"]

  #  topic: 'erp-log'
  topic: '%{[fields.topic]}'
  partition.round_robin:
    reachable_only: false

  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

  # ---------------------------- Elasticsearch Output ----------------------------
  # output.elasticsearch:
  # Array of hosts to connect to.
  # hosts: ["localhost:9200"]

  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  #username: "elastic"
  #password: "changeme"

  # ------------------------------ Logstash Output -------------------------------
  #output.logstash:
  # The Logstash hosts
  #hosts: ["localhost:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

# ================================= Processors =================================
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~
  - drop_fields:
      fields: ["input", "ecs", "agent", "@metadata"]

    # ================================== Logging ===================================

    # Sets log level. The default log level is info.
    # Available log levels are: error, warning, info, debug
    #logging.level: debug

    # At debug level, you can selectively enable logging only for some components.
    # To enable all selectors use ["*"]. Examples of other selectors are "beat",
    # "publish", "service".
    #logging.selectors: ["*"]

    # ============================= X-Pack Monitoring ==============================
    # Filebeat can export internal metrics to a central Elasticsearch monitoring
    # cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
    # reporting is disabled by default.

    # Set to true to enable the monitoring reporter.
    #monitoring.enabled: false

    # Sets the UUID of the Elasticsearch cluster under which monitoring data for this
    # Filebeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
    # is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
    #monitoring.cluster_uuid:

    # Uncomment to send the metrics to Elasticsearch. Most settings from the
    # Elasticsearch output are accepted here as well.
    # Note that the settings should point to your Elasticsearch *monitoring* cluster.
    # Any setting that is not set is automatically inherited from the Elasticsearch
    # output configuration, so if you have the Elasticsearch output configured such
    # that it is pointing to your Elasticsearch monitoring cluster, you can simply
    # uncomment the following line.
    #monitoring.elasticsearch:

    # ============================== Instrumentation ===============================

    # Instrumentation support for the filebeat.
    #instrumentation:
    # Set to true to enable instrumentation of filebeat.
    #enabled: false

    # Environment in which filebeat is running on (eg: staging, production, etc.)
    #environment: ""

    # APM Server hosts to report instrumentation results to.
    #hosts:
    #  - http://localhost:8200

    # API Key for the APM Server(s).
    # If api_key is set then secret_token will be ignored.
    #api_key:

    # Secret token for the APM Server(s).
    #secret_token:


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true


================================================
FILE: elk/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: elk/logstash/Dockerfile
================================================
FROM docker.elastic.co/logstash/logstash:7.9.2

RUN rm -f /usr/share/logstash/pipeline/logstash.conf

ADD logstash.conf /usr/share/logstash/pipeline/logstash.conf


================================================
FILE: elk/logstash/logstash.conf
================================================
input {

  kafka {
    type => "nginx-access-log"
    bootstrap_servers => "kafka:9092"
    client_id => "nginx-access-log"
    group_id => "nginx-access-log"
    auto_offset_reset => "earliest"
    consumer_threads => 1
    decorate_events => false
    topics => ["nginx.access.log"]
  }

  kafka {
    type => "nginx-error-log"
    bootstrap_servers => "kafka:9092"
    client_id => "nginx-error-log"
    group_id => "nginx-error-log"
    auto_offset_reset => "earliest"
    consumer_threads => 1
    decorate_events => false
    topics => ["nginx.error.log"]
  }
}

filter {
  json {
    source => "message"
  }

  if [type] == "nginx-access-log" {
    mutate {
      gsub => ["message","password=[^\&]+","password=******"]
    }
    grok {
      match => {
        "message" => '(?m)(?<remote_addr>(\d+\.){3}\d{1,3})\s-\s(?<remote_user>([^\s])+)\s\[(?<time_local>.+)\]\s"(?<request>.+?)"\s(?<status>\d{3})\s(?<body_bytes_sent>\d+)\s"(?<http_referer>.+?)"\s"(?<http_user_agent>.+?)"\s(?<request_time>\d+\.\d+)\s(?<upstream_response_time>(\d+\.\d+|-))\s(?<host_name>[^\s]+)\s(?<request_body>.+)'
      }
    }
    mutate {
      remove_field => [ "message" ]
    }
  }

  if [type] == "nginx-error-log" {
    grok {
      match => {
        "message" => '(?m)(?<time_local>\d{4}\/\d{2}\/\d{2}\s(\d{2}:){2}\d{2})\s\[(?<level>\w+)\]\s(?<msg>[^,]+)(,\sclient:\s(?<client>(\d{1,3}\.){3}\d{1,3}))?(,\sserver:\s(?<server>[^,]+))?(,\srequest:\s"(?<request>.+?)")?(,\supstream:\s"(?<upstream>.+?)")?(,\shost:\s"(?<host_name>.+?)")?(,\sreferrer:\s"(?<referrer>.+))?'
      }
    }
    mutate {
      remove_field => [ "message" ]
    }
    mutate {
      rename => ["msg", "message" ]
    }
  }
}

output {
  elasticsearch {
    hosts => ["http://elasticsearch:9200"]
    index => "%{[type]}-%{+YYYY.MM.dd}"
  }
}


================================================
FILE: example/.gitignore
================================================
.env

================================================
FILE: example/README.md
================================================
# example

## Usage

```bash
cp .env.example .env # 如有
docker-compose up -d xxx
```

访问: [http://127.0.0.1:80](http://127.0.0.1:80)


================================================
FILE: example/conf/.gitignore
================================================


================================================
FILE: example/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: example/docker-compose.yml
================================================


================================================
FILE: example/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: excalidraw/.gitignore
================================================
.env

================================================
FILE: excalidraw/README.md
================================================
# example

## Usage

```bash
docker-compose up -d excalidraw
```

访问: [http://127.0.0.1:5000](http://127.0.0.1:5000)


================================================
FILE: excalidraw/conf/.gitignore
================================================


================================================
FILE: excalidraw/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: excalidraw/docker-compose.yml
================================================
version: '3'
services:
  excalidraw:
    image: 'excalidraw/excalidraw:latest'
    container_name: excalidraw
#    restart: always
    ports:
      - '5000:80'
    environment:
      - TZ=Asia/Shanghai
    volumes:
      - './data/web:/app/web'


================================================
FILE: excalidraw/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: gitlab/.gitignore
================================================
.env

================================================
FILE: gitlab/README.md
================================================
# example

## Usage

```bash
docker-compose up -d gitlab
```

访问: [http://127.0.0.1:80](http://127.0.0.1:80) 

首次登录使用默认的 root 账密登录。
账号为 root 。
密码可以使用如下命令获取:
```
sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
```


================================================
FILE: gitlab/conf/.gitignore
================================================


================================================
FILE: gitlab/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: gitlab/docker-compose.yml
================================================
version: '3'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab
#    restart: always
    ports:
      - '80:80'
      - '443:443'
      - '38022:22'
    environment:
      - TZ=Asia/Shanghai
    volumes:
      - './conf:/etc/gitlab'
      - './log:/var/log/gitlab'
      - './data:/var/opt/gitlab'


================================================
FILE: gitlab/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: jenkins/.gitignore
================================================
.env

================================================
FILE: jenkins/README.md
================================================
# example

## Usage

启动容器
```bash
docker-compose up -d jenkins
```

查看容器日志
```bash
docker logs -f jenkins
```

访问: [http://127.0.0.1:8080](http://127.0.0.1:8080)
初次启动时,可能需要等待2-3分钟,jenkins 服务才会启动完成。

jenkins 启动好之后,按照要求输入管理员密码,内容在 `/var/jenkins_home/secrets/initialAdminPassword` 中,对应是本地当前文件夹下 `data/jenkins_home/secrets/initialAdminPassword`。



================================================
FILE: jenkins/conf/.gitignore
================================================


================================================
FILE: jenkins/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: jenkins/docker-compose.yml
================================================
version: '3'
services:
  jenkins:
    image: 'jenkins/jenkins:lts'
    container_name: jenkins
#    restart: always
    ports:
      - '8080:8080'
      - '50000:50000'
    environment:
     - JAVA_OPTS=-Djava.util.logging.config.file=/var/jenkins_home/log.properties
     - TZ=Asia/Shanghai
    volumes:
      - './data/jenkins_home:/var/jenkins_home'


================================================
FILE: jenkins/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: jira/.gitignore
================================================
.env

================================================
FILE: jira/README.md
================================================
# example

## Usage

```bash
cp .env.example .env 
docker-compose up -d jira-mysql jira
```

访问: [http://127.0.0.1:8081](http://127.0.0.1:8081)


================================================
FILE: jira/conf/.gitignore
================================================


================================================
FILE: jira/conf/mysql/my.cnf
================================================
[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_bin

================================================
FILE: jira/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: jira/docker-compose.yml
================================================
version: '3'
services:
  jira-mysql:
    image: mysql:5.7
    container_name: jira-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${ROOT_PASSWORD}
      - MYSQL_DATABASE=jiradb
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWORD}
      - TZ=${MYSQL_TIMEZONE}
    networks:
      - net-jira
    volumes:
      - ./conf/mysql/my.cnf:/etc/mysql/conf.d/mysqld_jira.cnf
      - ./data/mysql:/var/lib/mysql
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"

  jira:
    image: atlassian/jira-software
    container_name: jira
    hostname: jira
    depends_on:
      - jira-mysql
    ports:
      - "${WEB_PORT}:8080"
    networks:
      - net-jira
    volumes:
      - ./conf/mysql-connector-java-5.1.48.jar:/opt/atlassian/jira/lib/mysql-connector-java-5.1.48.jar
      - ./data/jira:/var/atlassian/application-data/jira
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"

networks:
  net-jira:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: ${DOCKER_SUBNET}

================================================
FILE: jira/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: jumpserver/.gitignore
================================================
.env

================================================
FILE: jumpserver/README.md
================================================
# example

## Usage

1. 添加配置。
```bash
cp .env.example .env
```

2. 根据实际情况修改 .env 中的配置,主要是 DB_HOST 和 REDIS_HOST 改成自己的 MySQL 和 Redis 服务地址。

3. 连接到 MySQL ,根据 .env 文件中的配置,创建数据库账号和分配权限。
```bash
create database jumpserver default charset 'utf8';
create user 'jumpserver'@'%' identified by 'nu4x599Wq7u0Bn8EABh3J91G';
grant all on jumpserver.* to 'jumpserver'@'%';
flush privileges;
```

4. 启动 core 服务。

```bash
docker-compose up -d core
```
需要等待几分钟才可以启动其他服务,因为启动 core 服务时,会初始化数据表,可以通过查看日志观察进度。

```bash
docker logs -f jms-core
```

5. 启动其余服务。
```bash
docker-compose up -d
```

6. 访问后台界面。
访问: [http://127.0.0.1:80](http://127.0.0.1:80)
初始账号: admin
初始密码: admin




================================================
FILE: jumpserver/conf/.gitignore
================================================


================================================
FILE: jumpserver/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: jumpserver/docker-compose.yml
================================================
version: '3'
services:
  core:
    image: jumpserver/core:${Version}
    container_name: jms-core
#    restart: always
    tty: true
    command: start web
    environment:
      SECRET_KEY: $SECRET_KEY
      BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
      DEBUG: $DEBUG
      LOG_LEVEL: $LOG_LEVEL
      DB_HOST: $DB_HOST
      DB_PORT: $DB_PORT
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      REDIS_HOST: $REDIS_HOST
      REDIS_PORT: $REDIS_PORT
      REDIS_PASSWORD: $REDIS_PASSWORD
    healthcheck:
      test: "curl -fsL http://localhost:8080/api/health/ > /dev/null"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    volumes:
      - ${VOLUME_DIR}/data/core:/opt/jumpserver/data
      - ${VOLUME_DIR}/log/core:/opt/jumpserver/logs
    networks:
      - jms-net

  celery:
    image: jumpserver/core:${Version}
    container_name: jms-celery
#    restart: always
    tty: true
    command: start task
    environment:
      SECRET_KEY: $SECRET_KEY
      BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
      DEBUG: $DEBUG
      LOG_LEVEL: $LOG_LEVEL
      DB_HOST: $DB_HOST
      DB_PORT: $DB_PORT
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      REDIS_HOST: $REDIS_HOST
      REDIS_PORT: $REDIS_PORT
      REDIS_PASSWORD: $REDIS_PASSWORD
    depends_on:
      core:
        condition: service_healthy
    healthcheck:
      test: "bash /opt/jumpserver/utils/check_celery.sh"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 30s
    volumes:
      - ${VOLUME_DIR}/data/core:/opt/jumpserver/data
      - ${VOLUME_DIR}/log/core:/opt/jumpserver/logs
    networks:
      - jms-net

  koko:
    image: jumpserver/koko:${Version}
    container_name: jms-koko
#    restart: always
    privileged: true
    tty: true
    environment:
      CORE_HOST: http://core:8080
      BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
      LOG_LEVEL: $LOG_LEVEL
    depends_on:
      core:
        condition: service_healthy
    healthcheck:
      test: "curl -fsL http://localhost:5000/koko/health/ > /dev/null"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s
    volumes:
      - ${VOLUME_DIR}/data/koko:/opt/koko/data
    ports:
      - 2222:2222
    networks:
      - jms-net

  lion:
    image: jumpserver/lion:${Version}
    container_name: jms-lion
#    restart: always
    tty: true
    environment:
      CORE_HOST: http://core:8080
      BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
      LOG_LEVEL: $LOG_LEVEL
    depends_on:
      core:
        condition: service_healthy
    healthcheck:
      test: "curl -fsL http://localhost:8081/lion/health/ > /dev/null"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s
    volumes:
      - ${VOLUME_DIR}/data/lion:/opt/lion/data
    networks:
      - jms-net

  magnus:
    image: jumpserver/magnus:${Version}
    container_name: jms-magnus
#    restart: always
    tty: true
    environment:
      CORE_HOST: http://core:8080
      BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
      LOG_LEVEL: $LOG_LEVEL
    depends_on:
      core:
        condition: service_healthy
    healthcheck:
      test: "ps axu | grep -v 'grep' | grep magnus"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s
    volumes:
      - ${VOLUME_DIR}/data/magnus:/opt/magnus/data
    ports:
      - 33060:33060
      - 33061:33061
    networks:
      - jms-net

  web:
    image: jumpserver/web:${Version}
    container_name: jms-web
#    restart: always
    tty: true
    depends_on:
      core:
        condition: service_healthy
    healthcheck:
      test: "curl -fsL http://localhost/ > /dev/null"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s
    volumes:
      - ${VOLUME_DIR}/data/core:/opt/jumpserver/data
      - ${VOLUME_DIR}/log/nginx:/var/log/nginx
    ports:
      - 80:80
    networks:
      - jms-net

networks:
  jms-net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: $DOCKER_SUBNET

================================================
FILE: jumpserver/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: jumpserver-all-in-one/.gitignore
================================================
.env

================================================
FILE: jumpserver-all-in-one/README.md
================================================
# example

## Usage

```bash
cp .env.example .env # 如有
docker-compose up -d xxx
```

访问: [http://127.0.0.1:80](http://127.0.0.1:80)


================================================
FILE: jumpserver-all-in-one/conf/.gitignore
================================================


================================================
FILE: jumpserver-all-in-one/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: jumpserver-all-in-one/docker-compose.yml
================================================
version: '3'
services:
  jumpserver:
    image: jumpserver/jms_all:latest
    container_name: jms-all
#    restart: always
    ports:
      - 1080:80
      - 12222:2222
    environment:
      - SECRET_KEY=${SECRET_KEY}
      - BOOTSTRAP_TOKEN=${BOOTSTRAP_TOKEN}
      - TARGETARCH=${TARGETARCH}
      - LOG_LEVEL=${LOG_LEVEL}
      - COMPOSE_HTTP_TIMEOUT=${COMPOSE_HTTP_TIMEOUT}
      - DOCKER_CLIENT_TIMEOUT=${DOCKER_CLIENT_TIMEOUT}
      - DB_HOST=${MYSQL_HOST}
      - DB_PORT=${MYSQL_PORT}
      - DB_USER=${MYSQL_USER}
      - DB_PASSWORD=${MYSQL_PASSWORD}
      - DB_NAME=${MYSQL_DATABASE}
      - REDIS_HOST=${REDIS_HOST}
      - REDIS_PORT=${REDIS_PORT}
      - REDIS_PASSWORD=${REDIS_PASSWORD}
    volumes:
      - ${VOLUME_DIR}/data/jumpserver:/opt/jumpserver/data
      - ${VOLUME_DIR}/data/koko:/opt/koko/data
      - ${VOLUME_DIR}/data/lion:/opt/lion/data
    depends_on:
      - mysql
      - redis
  mysql:
    image: 'mysql:5.7'
    container_name: jms-mysql
#    restart: always
    command: --character-set-server=utf8 --collation-server=utf8_general_ci
    environment:
      MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
      MYSQL_DATABASE: '${MYSQL_DATABASE}'
      MYSQL_USER: '${MYSQL_USER}'
      MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
    ports:
      - '${MYSQL_PORT}:3306'
    healthcheck:
      test: "mysql -h127.0.0.1 -P3306 -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e 'SHOW DATABASES;'"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 30s
    volumes:
      - ${VOLUME_DIR}/data/mysql:/var/lib/mysql
  redis:
    image: redis:6.0
    container_name: jms-redis
#    restart: always
    command: redis-server --requirepass ${REDIS_PASSWORD} --loglevel warning --maxmemory-policy allkeys-lru
    environment:
      REDIS_PORT: 6379
      REDIS_PASSWORD: '${REDIS_PASSWORD}'
    ports:
      - '${REDIS_PORT}:6379'
    volumes:
      - ${VOLUME_DIR}/data/redis:/data
    healthcheck:
      test: "redis-cli -h 127.0.0.1 -p 6379 -a ${REDIS_PASSWORD} info Replication"
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s

================================================
FILE: jumpserver-all-in-one/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: maxwell/.gitignore
================================================
.env

================================================
FILE: maxwell/README.md
================================================
# example

## Usage

1. 添加配置,启动 mysql 和 redis
```bash
cp .env.example .env
docker-compose up -d maxwell-mysql maxwell-redis
```

2. 查看队列中数据,此时由于还未接入 maxwell,队列为空

```bash
docker exec -it maxwell-redis /bin/bash
root@0720765b7a68:/# redis-cli

127.0.0.1:6379> llen maxwell
(integer) 0
```

3. 新开一个终端,进入 mysql,添加账号分配权限
```bash
docker exec -it  maxwell-mysql /bin/bash
root@6d023f50a4ff:/# mysql -uroot -p123456

mysql> GRANT ALL on maxwell.* to 'maxwell'@'%';
mysql> GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE on *.* to 'maxwell'@'%';
mysql> flush privileges;
```

4. 启动 maxwell 
```bash
docker-compose up -d maxwell
```

5. 测试,进入 mysql 容器,插入测试数据
```bash
mysql> create database if not exists `test` default character set utf8;
mysql> use test;
mysql> create table test.test_table(id int not null, name varchar(100));
mysql> insert into test.test_table values(1, 'from master');
mysql> select * from test.test_table;
```

6. 再次进入 redis 容器,查看队列,数据库中的变化已同步到 redis 中
```bash
127.0.0.1:6379> llen maxwell
(integer) 1

127.0.0.1:6379> rpop maxwell
"{\"database\":\"test\",\"table\":\"test_table\",\"type\":\"insert\",\"ts\":1664653000,\"xid\":742,\"commit\":true,\"data\":{\"id\":1,\"name\":\"from master\"}}"
```


================================================
FILE: maxwell/conf/.gitignore
================================================


================================================
FILE: maxwell/conf/maxwell/config.properties
================================================
# tl;dr config
log_level=info

# mysql login info
host=maxwell-mysql
port=3306
user=maxwell
password=123456

producer=redis
redis_host=maxwell-redis
redis_port=6379
redis_type=lpush

#     *** general ***
# choose where to produce data to. stdout|file|kafka|kinesis|pubsub|sqs|rabbitmq|redis
#producer=kafka

# set the log level.  note that you can configure things further in log4j2.xml
#log_level=DEBUG # [DEBUG, INFO, WARN, ERROR]

# if set, maxwell will look up the scoped environment variables, strip off the prefix and inject the configs
#env_config_prefix=MAXWELL_

#     *** mysql ***

# mysql host to connect to
#host=hostname

# mysql port to connect to
#port=3306

# mysql user to connect as.  This user must have REPLICATION SLAVE permissions,
# as well as full access to the `maxwell` (or schema_database) database
#user=maxwell

# mysql password
#password=maxwell

# options to pass into the jdbc connection, given as opt=val&opt2=val2
#jdbc_options=opt1=100&opt2=hello

# name of the mysql database where maxwell keeps its own state
#schema_database=maxwell

# whether to use GTID or not for positioning
#gtid_mode=true

# maxwell will capture an initial "base" schema containing all table and column information,
# and then keep delta-updates on top of that schema.  If you have an inordinate amount of DDL changes,
# the table containing delta changes will grow unbounded (and possibly too large) over time.  If you
# enable this option Maxwell will periodically compact its tables.
#max_schemas=10000

# SSL/TLS options
# To use VERIFY_CA or VERIFY_IDENTITY, you must set the trust store with Java opts:
#   -Djavax.net.ssl.trustStore=<truststore> -Djavax.net.ssl.trustStorePassword=<password>
# or import the MySQL cert into the global Java cacerts.
# MODE must be one of DISABLED, PREFERRED, REQUIRED, VERIFY_CA, or VERIFY_IDENTITY
#
# turns on ssl for the maxwell-store connection, other connections inherit this setting unless specified
#ssl=DISABLED
# for binlog-connector
#replication_ssl=DISABLED
# for the schema-capture connection, if used
#schema_ssl=DISABLED

# maxwell can optionally replicate from a different server than where it stores
# schema and binlog position info.  Specify that different server here:

#replication_host=other
#replication_user=username
#replication_password=password
#replication_port=3306

# This may be useful when using MaxScale's binlog mirroring host.
# Specifies that Maxwell should capture schema from a different server than
# it replicates from:

#schema_host=other
#schema_user=username
#schema_password=password
#schema_port=3306


#       *** output format ***

# records include binlog position (default false)
#output_binlog_position=true

# records include a gtid string (default false)
#output_gtid_position=true

# records include fields with null values (default true).  If this is false,
# fields where the value is null will be omitted entirely from output.
#output_nulls=true

# records include server_id (default false)
#output_server_id=true

# records include thread_id (default false)
#output_thread_id=true

# records include schema_id (default false)
#output_schema_id=true

# records include row query, binlog option "binlog_rows_query_log_events" must be enabled" (default false)
#output_row_query=true

# DML records include list of values that make up a row's primary key (default false)
#output_primary_keys=true

# DML records include list of columns that make up a row's primary key (default false)
#output_primary_key_columns=true

# records include commit and xid (default true)
#output_commit_info=true

# This controls whether maxwell will output JSON information containing
# DDL (ALTER/CREATE TABLE/ETC) infromation. (default: false)
# See also: ddl_kafka_topic
#output_ddl=true

# turns underscore naming style of fields to camel case style in JSON output
# default is none, which means the field name in JSON is the exact name in MySQL table
#output_naming_strategy=underscore_to_camelcase

#       *** kafka ***

# list of kafka brokers
#kafka.bootstrap.servers=hosta:9092,hostb:9092

# kafka topic to write to
# this can be static, e.g. 'maxwell', or dynamic, e.g. namespace_%{database}_%{table}
# in the latter case 'database' and 'table' will be replaced with the values for the row being processed
#kafka_topic=maxwell

# alternative kafka topic to write DDL (alter/create/drop) to.  Defaults to kafka_topic
#ddl_kafka_topic=maxwell_ddl

# hash function to use.  "default" is just the JVM's 'hashCode' function.
#kafka_partition_hash=default # [default, murmur3]

# how maxwell writes its kafka key.
#
# 'hash' looks like:
# {"database":"test","table":"tickets","pk.id":10001}
#
# 'array' looks like:
# ["test","tickets",[{"id":10001}]]
#
# default: "hash"
#kafka_key_format=hash # [hash, array]

# extra kafka options.  Anything prefixed "kafka." will get
# passed directly into the kafka-producer's config.

# a few defaults.
# These are 0.11-specific. They may or may not work with other versions.
kafka.compression.type=snappy
kafka.retries=0
kafka.acks=1
#kafka.batch.size=16384


# kafka+SSL example
# kafka.security.protocol=SSL
# kafka.ssl.truststore.location=/var/private/ssl/kafka.client.truststore.jks
# kafka.ssl.truststore.password=test1234
# kafka.ssl.keystore.location=/var/private/ssl/kafka.client.keystore.jks
# kafka.ssl.keystore.password=test1234
# kafka.ssl.key.password=test1234#

# controls a heuristic check that maxwell may use to detect messages that
# we never heard back from.  The heuristic check looks for "stuck" messages, and
# will timeout maxwell after this many milliseconds.
#
# See https://github.com/zendesk/maxwell/blob/master/src/main/java/com/zendesk/maxwell/producer/InflightMessageList.java
# if you really want to get into it.
#producer_ack_timeout=120000 # default 0


#           *** partitioning ***

# What part of the data do we partition by?
#producer_partition_by=database # [database, table, primary_key, transaction_id, thread_id, column]

# specify what fields to partition by when using producer_partition_by=column
# column separated list.
#producer_partition_columns=id,foo,bar

# when using producer_partition_by=column, partition by this when
# the specified column(s) don't exist.
#producer_partition_by_fallback=database

#            *** kinesis ***

#kinesis_stream=maxwell

# AWS places a 256 unicode character limit on the max key length of a record
# http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html
#
# Setting this option to true enables hashing the key with the md5 algorithm
# before we send it to kinesis so all the keys work within the key size limit.
# Values: true, false
# Default: false
#kinesis_md5_keys=true

#            *** sqs ***

#sqs_queue_uri=aws_sqs_queue_uri

# The sqs producer will need aws credentials configured in the default
# root folder and file format. Please check below link on how to do it.
# http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html

#            *** pub/sub ***

#pubsub_project_id=maxwell
#pubsub_topic=maxwell
#ddl_pubsub_topic=maxwell_ddl

#            *** rabbit-mq ***

#rabbitmq_host=rabbitmq_hostname
#rabbitmq_port=5672
#rabbitmq_user=guest
#rabbitmq_pass=guest
#rabbitmq_virtual_host=/
#rabbitmq_exchange=maxwell
#rabbitmq_exchange_type=fanout
#rabbitmq_exchange_durable=false
#rabbitmq_exchange_autodelete=false
#rabbitmq_routing_key_template=%db%.%table%
#rabbitmq_message_persistent=false
#rabbitmq_declare_exchange=true

#           *** redis ***

#redis_host=redis_host
#redis_port=6379
#redis_auth=redis_auth
#redis_database=0

# name of pubsub/list/whatever key to publish to
#redis_key=maxwell

# this can be static, e.g. 'maxwell', or dynamic, e.g. namespace_%{database}_%{table}
#redis_pub_channel=maxwell
# this can be static, e.g. 'maxwell', or dynamic, e.g. namespace_%{database}_%{table}
#redis_list_key=maxwell
# this can be static, e.g. 'maxwell', or dynamic, e.g. namespace_%{database}_%{table}
# Valid values for redis_type = pubsub|lpush. Defaults to pubsub

#redis_type=pubsub

#           *** custom producer ***

# the fully qualified class name for custom ProducerFactory
# see the following link for more details.
# http://maxwells-daemon.io/producers/#custom-producer
#custom_producer.factory=

# custom producer properties can be configured using the custom_producer.* property namespace
#custom_producer.custom_prop=foo

#          *** filtering ***

# filter rows out of Maxwell's output.  Command separated list of filter-rules, evaluated in sequence.
# A filter rule is:
#  <type> ":" <db> "." <tbl> [ "." <col> "=" <col_val> ]
#  type    ::= [ "include" | "exclude" | "blacklist" ]
#  db      ::= [ "/regexp/" | "string" | "`string`" | "*" ]
#  tbl     ::= [ "/regexp/" | "string" | "`string`" | "*" ]
#  col_val ::= "column_name"
#  tbl     ::= [ "/regexp/" | "string" | "`string`" | "*" ]
#
# See http://maxwells-daemon.io/filtering for more details
#
#filter= exclude: *.*, include: foo.*, include: bar.baz, include: foo.bar.col_eg = "value_to_match"

# javascript filter
# maxwell can run a bit of javascript for each row if you need very custom filtering/data munging.
# See http://maxwells-daemon.io/filtering/#javascript_filters for more details
#
#javascript=/path/to/javascript_filter_file

#       *** encryption ***

# Encryption mode. Possible values are none, data, and all. (default none)
#encrypt=none

# Specify the secret key to be used
#secret_key=RandomInitVector

#       *** monitoring ***

# Maxwell collects metrics via dropwizard. These can be exposed through the
# base logging mechanism (slf4j), JMX, HTTP or pushed to Datadog.
# Options: [jmx, slf4j, http, datadog]
# Supplying multiple is allowed.
#metrics_type=jmx,slf4j

# The prefix maxwell will apply to all metrics
#metrics_prefix=MaxwellMetrics # default MaxwellMetrics

# Enable (dropwizard) JVM metrics, default false
#metrics_jvm=true

# When metrics_type includes slf4j this is the frequency metrics are emitted to the log, in seconds
#metrics_slf4j_interval=60

# When metrics_type includes http or diagnostic is enabled, this is the port the server will bind to.
#http_port=8080

# When metrics_type includes http or diagnostic is enabled, this is the http path prefix, default /.
#http_path_prefix=/some/path/

# ** The following are Datadog specific. **
# When metrics_type includes datadog this is the way metrics will be reported.
# Options: [udp, http]
# Supplying multiple is not allowed.
#metrics_datadog_type=udp

# datadog tags that should be supplied
#metrics_datadog_tags=tag1:value1,tag2:value2

# The frequency metrics are pushed to datadog, in seconds
#metrics_datadog_interval=60

# required if metrics_datadog_type = http
#metrics_datadog_apikey=API_KEY

# required if metrics_datadog_type = udp
#metrics_datadog_host=localhost # default localhost
#metrics_datadog_port=8125 # default 8125

# Maxwell exposes http diagnostic endpoint to check below in parallel:
# 1. binlog replication lag
# 2. producer (currently kafka) lag

# To enable Maxwell diagnostic
#http_diagnostic=true # default false

# Diagnostic check timeout in milliseconds, required if diagnostic = true
#http_diagnostic_timeout=10000 # default 10000

#    *** misc ***

# maxwell's bootstrapping functionality has a couple of modes.
#
# In "async" mode, maxwell will output the replication stream while it
# simultaneously outputs the database to the topic.  Note that it won't
# output replication data for any tables it is currently bootstrapping -- this
# data will be buffered and output after the bootstrap is complete.
#
# In "sync" mode, maxwell stops the replication stream while it
# outputs bootstrap data.
#
# async mode keeps ops live while bootstrapping, but carries the possibility of
# data loss (due to buffering transactions).  sync mode is safer but you
# have to stop replication.
#bootstrapper=async [sync, async, none]

# output filename when using the "file" producer
#output_file=/path/to/file

================================================
FILE: maxwell/conf/mysql/mysql.cnf
================================================
[mysqld]
user=mysql

server-id=1
log-bin=master
binlog_format=row

log-slave-updates=1
datadir=/var/lib/mysql/
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
skip-host-cache
skip-name-resolve

================================================
FILE: maxwell/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: maxwell/docker-compose.yml
================================================
version: '3'
services:
  maxwell:
    image: zendesk/maxwell
    container_name: maxwell
    command: bin/maxwell --config /etc/maxwell/config.properties
    volumes:
      - './conf/maxwell:/etc/maxwell/'
    links:
      - maxwell-mysql
      - maxwell-redis
    depends_on:
      - maxwell-mysql
      - maxwell-redis
  maxwell-mysql:
    image: 'mysql:5.7.23'
    container_name: maxwell-mysql
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
      MYSQL_DATABASE: '${MYSQL_DATABASE}'
      MYSQL_USER: '${MYSQL_USER}'
      MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
    ports:
      - '3306:3306'
    volumes:
      - './conf/mysql:/etc/mysql/conf.d/'
      - './data/mysql:/var/lib/mysql'
  maxwell-redis:
    container_name: maxwell-redis
    image: 'redis:4.0.10'
    ports:
      - '6379:6379'


================================================
FILE: maxwell/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: mongo/.gitignore
================================================
.env

================================================
FILE: mongo/README.md
================================================
# example

## Usage

1. 创建配置,启动容器
```bash
cp .env.example .env
docker-compose up -d mongodb
```

2. 进入容器测试
```bash
docker exec -it mongodb /bin/bash
```

3. 登录 mongo ,执行常用命令,一切 ok
```bash
root@346ac37d2e89:/# mongo admin -u root -p 123456

> show dbs;
admin   0.000GB
config  0.000GB
local   0.000GB
> show collections;
system.users
system.version
> db.version();
5.0.5
```



================================================
FILE: mongo/conf/.gitignore
================================================


================================================
FILE: mongo/conf/mongod.conf
================================================
storage:
  dbPath: /data/db
  journal:
    enabled: true
  directoryPerDB: true
  engine: wiredTiger
  wiredTiger:
    engineConfig:
      cacheSizeGB: 8
      directoryForIndexes: true

systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

net:
  port: 27017
  bindIp: 0.0.0.0

processManagement:
  timeZoneInfo: /usr/share/zoneinfo

replication:
   oplogSizeMB: 51200
   replSetName: rs0

================================================
FILE: mongo/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: mongo/docker-compose.yml
================================================
version: '3'
services:
  mongodb:
    image: 'mongo:latest'
    container_name: mongodb
    ports:
      - '${MONGO_PORT}:27017'
    volumes:
      - './data/mongodb:/data/db'
      - './log/mongodb:/var/log/mongodb'
      - './conf:/etc/mongo'
    environment:
      TZ: 'Asia/Shanghai'
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}


================================================
FILE: mongo/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: mongo-express/.gitignore
================================================
.env

================================================
FILE: mongo-express/README.md
================================================
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d mongo
docker-compose up -d mongo-express
```

访问: [http://127.0.0.1:8081](http://127.0.0.1:8081)

账号 dev,密码 dev,见 .env 中 ME_CONFIG_BASICAUTH_USERNAME 和 ME_CONFIG_BASICAUTH_PASSWORD 配置。

================================================
FILE: mongo-express/conf/.gitignore
================================================


================================================
FILE: mongo-express/conf/mongod.conf
================================================
storage:
  dbPath: /data/db
  journal:
    enabled: true
  directoryPerDB: true
  engine: wiredTiger
  wiredTiger:
    engineConfig:
      cacheSizeGB: 8
      directoryForIndexes: true

systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

net:
  port: 27017
  bindIp: 0.0.0.0

processManagement:
  timeZoneInfo: /usr/share/zoneinfo

replication:
   oplogSizeMB: 51200
   replSetName: rs0

================================================
FILE: mongo-express/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: mongo-express/docker-compose.yml
================================================
version: '3'
services:
  mongo:
    image: 'mongo:latest'
    container_name: mongo
    ports:
      - '${MONGO_PORT}:27017'
    volumes:
      - './data/mongodb:/data/db'
      - './log/mongodb:/var/log/mongodb'
      - './conf:/etc/mongo'
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
    networks:
      - mongo-net
  mongo-express:
    image: 'mongo-express:latest'
    container_name: mongo-express
    ports:
      - '${MONGO_EXPRESS_PORT}:8081'
    environment:
      ME_CONFIG_BASICAUTH_USERNAME: ${ME_CONFIG_BASICAUTH_USERNAME}
      ME_CONFIG_BASICAUTH_PASSWORD: ${ME_CONFIG_BASICAUTH_PASSWORD}
      ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_ROOT_USERNAME}
      ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_ROOT_PASSWORD}
      ME_CONFIG_MONGODB_SERVER: mongo
      ME_CONFIG_MONGODB_PORT: 27017
    depends_on:
      - mongo
    networks:
      - mongo-net
networks:
  mongo-net:
    driver: bridge
    name: mongo-net

================================================
FILE: mongo-express/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: phpmyadmin/.gitignore
================================================
.env

================================================
FILE: phpmyadmin/README.md
================================================
# example

## Usage

```bash
docker-compose up -d phpmyadmin
```

访问: [http://127.0.0.1:8080](http://127.0.0.1:8080)


================================================
FILE: phpmyadmin/conf/.gitignore
================================================


================================================
FILE: phpmyadmin/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: phpmyadmin/docker-compose.yml
================================================
version: '3'
services:
  phpmyadmin:
    image: phpmyadmin:latest
    container_name: phpmyadmin
#    restart: always
    ports:
      - '8080:80'
    environment:
      - TZ='Asia/Shanghai'
      - PMA_ARBITRARY=1
    volumes:
      - /sessions

================================================
FILE: phpmyadmin/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: prometheus/.gitignore
================================================
.env

================================================
FILE: prometheus/README.md
================================================
# example

## Usage

```bash
docker-compose up -d
```

访问: [http://127.0.0.1:9090](http://127.0.0.1:9090)


================================================
FILE: prometheus/conf/.gitignore
================================================


================================================
FILE: prometheus/conf/alertmanager/alertmanager.yml
================================================
global:
  resolve_timeout: 5m                               
  smtp_smarthost: 'email-smtp.ap-southeast-1.amazonaws.com:465'        
  smtp_from: '123@immaxfang.com'       
  smtp_auth_username: 'demo'  
  smtp_auth_password: '123456'
  smtp_require_tls: false

route:
  group_by: ['alertname']    
  group_wait: 10s
  group_interval: 10s
  repeat_interval: 10m
  receiver: 'demoalert'

receivers:
  - name: 'demoalert'
    email_configs:
      - to: '999@immaxfang.com'


================================================
FILE: prometheus/conf/prometheus/prometheus.yml
================================================
global:
  scrape_interval:     5s
  evaluation_interval: 5s

  external_labels:
      monitor: 'dashboard'

alerting:
 alertmanagers:
 - static_configs:
    - targets:
        - "192.168.0.100:9093"

rule_files:
  - /etc/prometheus/rules/*.rules

scrape_configs:  
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['prometheus:9090']

  - job_name: node
    static_configs:
      - targets: ['192.168.0.103:9100','pushgateway:9091']

  - job_name: 'mysql-131'
    static_configs:
     - targets: ['192.168.0.131:9104']
       labels:
          instance: mysql


================================================
FILE: prometheus/conf/prometheus/rules/demo.rules
================================================
groups:
- name: hostStatsAlert
  rules:
  - alert: HostOutOfMemory
    expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10
    for: 2m
    labels:
      severity: warning
    annotations:
      summary: Host out of memory (instance {{ $labels.instance }})
      description: "Node memory is filling up (< 10% left)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"


================================================
FILE: prometheus/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: prometheus/docker-compose.yml
================================================
version: "3"
services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    user: root
#    restart: always
    ports:
      - "9090:9090"
    volumes:
      - ./conf/prometheus:/etc/prometheus
      - ./data/prometheus/prometheus_db:/prometheus 
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    networks:
      - net-prometheus

  grafana:
    image: grafana/grafana
    container_name: grafana
    user: root
#    restart: always
    ports:
      - "3000:3000"
    volumes:
      #- ./conf/grafana:/etc/grafana
      - ./data/prometheus/grafana_data:/var/lib/grafana
    depends_on:  
      - prometheus
    networks:
      - net-prometheus

  pushgateway:
    image: prom/pushgateway
    container_name: pushgateway
    user: root
#    restart: always
    ports:
      - "9091:9091"
    volumes:
      - ./data/prometheus/pushgateway_data:/var/lib/pushgateway

  alertmanager:
    image: prom/alertmanager
    hostname: alertmanager
    container_name: alertmanager
    user: root
#    restart: always
    ports:
      - "9093:9093"
    volumes:
      - ./conf/alertmanager:/etc/alertmanager
      - ./data/prometheus/alertmanager_data:/var/lib/alertmanager

networks:
  net-prometheus:


================================================
FILE: prometheus/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: rabbitmq/.gitignore
================================================
.env

================================================
FILE: rabbitmq/README.md
================================================
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d
```

访问: [http://127.0.0.1:15672](http://127.0.0.1:15672)

默认账号密码:guest  guest

================================================
FILE: rabbitmq/conf/.gitignore
================================================


================================================
FILE: rabbitmq/conf/rabbitmq.config
================================================
default_user = guest
default_pass = guest

================================================
FILE: rabbitmq/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: rabbitmq/docker-compose.yml
================================================
version: '3'
services:
  rabbitmq:
    image: rabbitmq:3.10-management
    container_name: rabbitmq
    ports:
      - '5672:5672'
      - '15672:15672'
    environment:
      - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
      - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
    volumes:
      - './data/rabbitmq:/var/lib/rabbitmq/mnesia'
#      - './conf/rabbitmq.config:/etc/rabbitmq/rabbitmq.config'

================================================
FILE: rabbitmq/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: redis/.gitignore
================================================
.env

================================================
FILE: redis/README.md
================================================
# example

## Usage

```bash
docker-compose up -d redis
```

进入容器测试
```
root@ip-10-0-3-22:/redis# docker exec -it redis /bin/bash
root@8c3303de6c72:/data# redis-cli
127.0.0.1:6379> ping
PONG
```


================================================
FILE: redis/conf/.gitignore
================================================


================================================
FILE: redis/conf/redis.conf
================================================
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf

# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.

################################## INCLUDES ###################################

# Include one or more other config files here.  This is useful if you
# have a standard template that goes to all Redis servers but also need
# to customize a few per-server settings.  Include files can include
# other files, so use this wisely.
#
# Notice option "include" won't be rewritten by command "CONFIG REWRITE"
# from admin or Redis Sentinel. Since Redis always uses the last processed
# line as value of a configuration directive, you'd better put includes
# at the beginning of this file to avoid overwriting config change at runtime.
#
# If instead you are interested in using includes to override configuration
# options, it is better to use include as the last line.
#
# include /path/to/local.conf
# include /path/to/other.conf

################################## MODULES #####################################

# Load modules at startup. If the server is not able to load modules
# it will abort. It is possible to use multiple loadmodule directives.
#
# loadmodule /path/to/my_module.so
# loadmodule /path/to/other_module.so

################################## NETWORK #####################################

# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 loopback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 0.0.0.0

# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and if:
#
# 1) The server is not binding explicitly to a set of addresses using the
#    "bind" directive.
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode yes

# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379

# TCP listen() backlog.
#
# In high requests-per-second environments you need an high backlog in order
# to avoid slow clients connections issues. Note that the Linux kernel
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
# in order to get the desired effect.
tcp-backlog 511

# Unix socket.
#
# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket /tmp/redis.sock
# unixsocketperm 700

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0

# TCP keepalive.
#
# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
# of communication. This is useful for two reasons:
#
# 1) Detect dead peers.
# 2) Take the connection alive from the point of view of network
#    equipment in the middle.
#
# On Linux, the specified value (in seconds) is the period used to send ACKs.
# Note that to close the connection the double of the time is needed.
# On other kernels the period depends on the kernel configuration.
#
# A reasonable value for this option is 300 seconds, which is the new
# Redis default starting with Redis 3.2.1.
tcp-keepalive 300

################################# GENERAL #####################################

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize no

# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
#   supervised no      - no supervision interaction
#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#   supervised auto    - detect upstart or systemd method based on
#                        UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
#       They do not enable continuous liveness pings back to your supervisor.
supervised no

# If a pid file is specified, Redis writes it where specified at startup
# and removes it at exit.
#
# When the server runs non daemonized, no pid file is created if none is
# specified in the configuration. When the server is daemonized, the pid file
# is used even if not specified, defaulting to "/var/run/redis.pid".
#
# Creating a pid file is best effort: if Redis is not able to create it
# nothing bad happens, the server will start and run normally.
pidfile /var/run/redis_6379.pid

# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel notice

# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile ""

# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
# syslog-enabled no

# Specify the syslog identity.
# syslog-ident redis

# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
# syslog-facility local0

# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16

# By default Redis shows an ASCII art logo only when started to log to the
# standard output and if the standard output is a TTY. Basically this means
# that normally a logo is displayed only in interactive sessions.
#
# However it is possible to force the pre-4.0 behavior and always show a
# ASCII art logo in startup logs by setting the following option to yes.
always-show-logo yes

################################ SNAPSHOTTING  ################################
#
# Save the DB on disk:
#
#   save <seconds> <changes>
#
#   Will save the DB if both the given number of seconds and the given
#   number of write operations against the DB occurred.
#
#   In the example below the behaviour will be to save:
#   after 900 sec (15 min) if at least 1 key changed
#   after 300 sec (5 min) if at least 10 keys changed
#   after 60 sec if at least 10000 keys changed
#
#   Note: you can disable saving completely by commenting out all "save" lines.
#
#   It is also possible to remove all the previously configured save
#   points by adding a save directive with a single empty string argument
#   like in the following example:
#
#   save ""

save 900 1
save 300 10
save 60 10000

# By default Redis will stop accepting writes if RDB snapshots are enabled
# (at least one save point) and the latest background save failed.
# This will make the user aware (in a hard way) that data is not persisting
# on disk properly, otherwise chances are that no one will notice and some
# disaster will happen.
#
# If the background saving process will start working again Redis will
# automatically allow writes again.
#
# However if you have setup your proper monitoring of the Redis server
# and persistence, you may want to disable this feature so that Redis will
# continue to work as usual even if there are problems with disk,
# permissions, and so forth.
stop-writes-on-bgsave-error yes

# Compress string objects using LZF when dump .rdb databases?
# For default that's set to 'yes' as it's almost always a win.
# If you want to save some CPU in the saving child set it to 'no' but
# the dataset will likely be bigger if you have compressible values or keys.
rdbcompression yes

# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
# This makes the format more resistant to corruption but there is a performance
# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
# for maximum performances.
#
# RDB files created with checksum disabled have a checksum of zero that will
# tell the loading code to skip the check.
rdbchecksum yes

# The filename where to dump the DB
dbfilename dump.rdb

# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./

################################# REPLICATION #################################

# Master-Replica replication. Use replicaof to make a Redis instance a copy of
# another Redis server. A few things to understand ASAP about Redis replication.
#
#   +------------------+      +---------------+
#   |      Master      | ---> |    Replica    |
#   | (receive writes) |      |  (exact copy) |
#   +------------------+      +---------------+
#
# 1) Redis replication is asynchronous, but you can configure a master to
#    stop accepting writes if it appears to be not connected with at least
#    a given number of replicas.
# 2) Redis replicas are able to perform a partial resynchronization with the
#    master if the replication link is lost for a relatively small amount of
#    time. You may want to configure the replication backlog size (see the next
#    sections of this file) with a sensible value depending on your needs.
# 3) Replication is automatic and does not need user intervention. After a
#    network partition replicas automatically try to reconnect to masters
#    and resynchronize with them.
#
# replicaof <masterip> <masterport>

# If the master is password protected (using the "requirepass" configuration
# directive below) it is possible to tell the replica to authenticate before
# starting the replication synchronization process, otherwise the master will
# refuse the replica request.
#
# masterauth <master-password>

# When a replica loses its connection with the master, or when the replication
# is still in progress, the replica can act in two different ways:
#
# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will
#    still reply to client requests, possibly with out of date data, or the
#    data set may just be empty if this is the first synchronization.
#
# 2) if replica-serve-stale-data is set to 'no' the replica will reply with
#    an error "SYNC with master in progress" to all the kind of commands
#    but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG,
#    SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB,
#    COMMAND, POST, HOST: and LATENCY.
#
replica-serve-stale-data yes

# You can configure a replica instance to accept writes or not. Writing against
# a replica instance may be useful to store some ephemeral data (because data
# written on a replica will be easily deleted after resync with the master) but
# may also cause problems if clients are writing to it because of a
# misconfiguration.
#
# Since Redis 2.6 by default replicas are read-only.
#
# Note: read only replicas are not designed to be exposed to untrusted clients
# on the internet. It's just a protection layer against misuse of the instance.
# Still a read only replica exports by default all the administrative commands
# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
# security of read only replicas using 'rename-command' to shadow all the
# administrative / dangerous commands.
replica-read-only yes

# Replication SYNC strategy: disk or socket.
#
# -------------------------------------------------------
# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
# -------------------------------------------------------
#
# New replicas and reconnecting replicas that are not able to continue the replication
# process just receiving differences, need to do what is called a "full
# synchronization". An RDB file is transmitted from the master to the replicas.
# The transmission can happen in two different ways:
#
# 1) Disk-backed: The Redis master creates a new process that writes the RDB
#                 file on disk. Later the file is transferred by the parent
#                 process to the replicas incrementally.
# 2) Diskless: The Redis master creates a new process that directly writes the
#              RDB file to replica sockets, without touching the disk at all.
#
# With disk-backed replication, while the RDB file is generated, more replicas
# can be queued and served with the RDB file as soon as the current child producing
# the RDB file finishes its work. With diskless replication instead once
# the transfer starts, new replicas arriving will be queued and a new transfer
# will start when the current one terminates.
#
# When diskless replication is used, the master waits a configurable amount of
# time (in seconds) before starting the transfer in the hope that multiple replicas
# will arrive and the transfer can be parallelized.
#
# With slow disks and fast (large bandwidth) networks, diskless replication
# works better.
repl-diskless-sync no

# When diskless replication is enabled, it is possible to configure the delay
# the server waits in order to spawn the child that transfers the RDB via socket
# to the replicas.
#
# This is important since once the transfer starts, it is not possible to serve
# new replicas arriving, that will be queued for the next RDB transfer, so the server
# waits a delay in order to let more replicas arrive.
#
# The delay is specified in seconds, and by default is 5 seconds. To disable
# it entirely just set it to 0 seconds and the transfer will start ASAP.
repl-diskless-sync-delay 5

# Replicas send PINGs to server in a predefined interval. It's possible to change
# this interval with the repl_ping_replica_period option. The default value is 10
# seconds.
#
# repl-ping-replica-period 10

# The following option sets the replication timeout for:
#
# 1) Bulk transfer I/O during SYNC, from the point of view of replica.
# 2) Master timeout from the point of view of replicas (data, pings).
# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings).
#
# It is important to make sure that this value is greater than the value
# specified for repl-ping-replica-period otherwise a timeout will be detected
# every time there is low traffic between the master and the replica.
#
# repl-timeout 60

# Disable TCP_NODELAY on the replica socket after SYNC?
#
# If you select "yes" Redis will use a smaller number of TCP packets and
# less bandwidth to send data to replicas. But this can add a delay for
# the data to appear on the replica side, up to 40 milliseconds with
# Linux kernels using a default configuration.
#
# If you select "no" the delay for data to appear on the replica side will
# be reduced but more bandwidth will be used for replication.
#
# By default we optimize for low latency, but in very high traffic conditions
# or when the master and replicas are many hops away, turning this to "yes" may
# be a good idea.
repl-disable-tcp-nodelay no

# Set the replication backlog size. The backlog is a buffer that accumulates
# replica data when replicas are disconnected for some time, so that when a replica
# wants to reconnect again, often a full resync is not needed, but a partial
# resync is enough, just passing the portion of data the replica missed while
# disconnected.
#
# The bigger the replication backlog, the longer the time the replica can be
# disconnected and later be able to perform a partial resynchronization.
#
# The backlog is only allocated once there is at least a replica connected.
#
# repl-backlog-size 1mb

# After a master has no longer connected replicas for some time, the backlog
# will be freed. The following option configures the amount of seconds that
# need to elapse, starting from the time the last replica disconnected, for
# the backlog buffer to be freed.
#
# Note that replicas never free the backlog for timeout, since they may be
# promoted to masters later, and should be able to correctly "partially
# resynchronize" with the replicas: hence they should always accumulate backlog.
#
# A value of 0 means to never release the backlog.
#
# repl-backlog-ttl 3600

# The replica priority is an integer number published by Redis in the INFO output.
# It is used by Redis Sentinel in order to select a replica to promote into a
# master if the master is no longer working correctly.
#
# A replica with a low priority number is considered better for promotion, so
# for instance if there are three replicas with priority 10, 100, 25 Sentinel will
# pick the one with priority 10, that is the lowest.
#
# However a special priority of 0 marks the replica as not able to perform the
# role of master, so a replica with priority of 0 will never be selected by
# Redis Sentinel for promotion.
#
# By default the priority is 100.
replica-priority 100

# It is possible for a master to stop accepting writes if there are less than
# N replicas connected, having a lag less or equal than M seconds.
#
# The N replicas need to be in "online" state.
#
# The lag in seconds, that must be <= the specified value, is calculated from
# the last ping received from the replica, that is usually sent every second.
#
# This option does not GUARANTEE that N replicas will accept the write, but
# will limit the window of exposure for lost writes in case not enough replicas
# are available, to the specified number of seconds.
#
# For example to require at least 3 replicas with a lag <= 10 seconds use:
#
# min-replicas-to-write 3
# min-replicas-max-lag 10
#
# Setting one or the other to 0 disables the feature.
#
# By default min-replicas-to-write is set to 0 (feature disabled) and
# min-replicas-max-lag is set to 10.

# A Redis master is able to list the address and port of the attached
# replicas in different ways. For example the "INFO replication" section
# offers this information, which is used, among other tools, by
# Redis Sentinel in order to discover replica instances.
# Another place where this info is available is in the output of the
# "ROLE" command of a master.
#
# The listed IP and address normally reported by a replica is obtained
# in the following way:
#
#   IP: The address is auto detected by checking the peer address
#   of the socket used by the replica to connect with the master.
#
#   Port: The port is communicated by the replica during the replication
#   handshake, and is normally the port that the replica is using to
#   listen for connections.
#
# However when port forwarding or Network Address Translation (NAT) is
# used, the replica may be actually reachable via different IP and port
# pairs. The following two options can be used by a replica in order to
# report to its master a specific set of IP and port, so that both INFO
# and ROLE will report those values.
#
# There is no need to use both the options if you need to override just
# the port or the IP address.
#
# replica-announce-ip 5.5.5.5
# replica-announce-port 1234

################################## SECURITY ###################################

# Require clients to issue AUTH <PASSWORD> before processing any other
# commands.  This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
# requirepass foobared

# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
#
# It is also possible to completely kill a command by renaming it into
# an empty string:
#
# rename-command CONFIG ""
#
# Please note that changing the name of commands that are logged into the
# AOF file or transmitted to replicas may cause problems.

################################### CLIENTS ####################################

# Set the max number of connected clients at the same time. By default
# this limit is set to 10000 clients, however if the Redis server is not
# able to configure the process file limit to allow for the specified limit
# the max number of allowed clients is set to the current file limit
# minus 32 (as Redis reserves a few file descriptors for internal uses).
#
# Once the limit is reached Redis will close all the new connections sending
# an error 'max number of clients reached'.
#
# maxclients 10000

############################## MEMORY MANAGEMENT ################################

# Set a memory usage limit to the specified amount of bytes.
# When the memory limit is reached Redis will try to remove keys
# according to the eviction policy selected (see maxmemory-policy).
#
# If Redis can't remove keys according to the policy, or if the policy is
# set to 'noeviction', Redis will start to reply with errors to commands
# that would use more memory, like SET, LPUSH, and so on, and will continue
# to reply to read-only commands like GET.
#
# This option is usually useful when using Redis as an LRU or LFU cache, or to
# set a hard memory limit for an instance (using the 'noeviction' policy).
#
# WARNING: If you have replicas attached to an instance with maxmemory on,
# the size of the output buffers needed to feed the replicas are subtracted
# from the used memory count, so that network problems / resyncs will
# not trigger a loop where keys are evicted, and in turn the output
# buffer of replicas is full with DELs of keys evicted triggering the deletion
# of more keys, and so forth until the database is completely emptied.
#
# In short... if you have replicas attached it is suggested that you set a lower
# limit for maxmemory so that there is some free RAM on the system for replica
# output buffers (but this is not needed if the policy is 'noeviction').
#
# maxmemory <bytes>

# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select among five behaviors:
#
# volatile-lru -> Evict using approximated LRU among the keys with an expire set.
# allkeys-lru -> Evict any key using approximated LRU.
# volatile-lfu -> Evict using approximated LFU among the keys with an expire set.
# allkeys-lfu -> Evict any key using approximated LFU.
# volatile-random -> Remove a random key among the ones with an expire set.
# allkeys-random -> Remove a random key, any key.
# volatile-ttl -> Remove the key with the nearest expire time (minor TTL)
# noeviction -> Don't evict anything, just return an error on write operations.
#
# LRU means Least Recently Used
# LFU means Least Frequently Used
#
# Both LRU, LFU and volatile-ttl are implemented using approximated
# randomized algorithms.
#
# Note: with any of the above policies, Redis will return an error on write
#       operations, when there are no suitable keys for eviction.
#
#       At the date of writing these commands are: set setnx setex append
#       incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
#       sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
#       zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
#       getset mset msetnx exec sort
#
# The default is:
#
# maxmemory-policy noeviction

# LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can tune it for speed or
# accuracy. For default Redis will check five keys and pick the one that was
# used less recently, you can change the sample size using the following
# configuration directive.
#
# The default of 5 produces good enough results. 10 Approximates very closely
# true LRU but costs more CPU. 3 is faster but not very accurate.
#
# maxmemory-samples 5

# Starting from Redis 5, by default a replica will ignore its maxmemory setting
# (unless it is promoted to master after a failover or manually). It means
# that the eviction of keys will be just handled by the master, sending the
# DEL commands to the replica as keys evict in the master side.
#
# This behavior ensures that masters and replicas stay consistent, and is usually
# what you want, however if your replica is writable, or you want the replica to have
# a different memory setting, and you are sure all the writes performed to the
# replica are idempotent, then you may change this default (but be sure to understand
# what you are doing).
#
# Note that since the replica by default does not evict, it may end using more
# memory than the one set via maxmemory (there are certain buffers that may
# be larger on the replica, or data structures may sometimes take more memory and so
# forth). So make sure you monitor your replicas and make sure they have enough
# memory to never hit a real out-of-memory condition before the master hits
# the configured maxmemory setting.
#
# replica-ignore-maxmemory yes

############################# LAZY FREEING ####################################

# Redis has two primitives to delete keys. One is called DEL and is a blocking
# deletion of the object. It means that the server stops processing new commands
# in order to reclaim all the memory associated with an object in a synchronous
# way. If the key deleted is associated with a small object, the time needed
# in order to execute the DEL command is very small and comparable to most other
# O(1) or O(log_N) commands in Redis. However if the key is associated with an
# aggregated value containing millions of elements, the server can block for
# a long time (even seconds) in order to complete the operation.
#
# For the above reasons Redis also offers non blocking deletion primitives
# such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and
# FLUSHDB commands, in order to reclaim memory in background. Those commands
# are executed in constant time. Another thread will incrementally free the
# object in the background as fast as possible.
#
# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled.
# It's up to the design of the application to understand when it is a good
# idea to use one or the other. However the Redis server sometimes has to
# delete keys or flush the whole database as a side effect of other operations.
# Specifically Redis deletes objects independently of a user call in the
# following scenarios:
#
# 1) On eviction, because of the maxmemory and maxmemory policy configurations,
#    in order to make room for new data, without going over the specified
#    memory limit.
# 2) Because of expire: when a key with an associated time to live (see the
#    EXPIRE command) must be deleted from memory.
# 3) Because of a side effect of a command that stores data on a key that may
#    already exist. For example the RENAME command may delete the old key
#    content when it is replaced with another one. Similarly SUNIONSTORE
#    or SORT with STORE option may delete existing keys. The SET command
#    itself removes any old content of the specified key in order to replace
#    it with the specified string.
# 4) During replication, when a replica performs a full resynchronization with
#    its master, the content of the whole database is removed in order to
#    load the RDB file just transferred.
#
# In all the above cases the default is to delete objects in a blocking way,
# like if DEL was called. However you can configure each case specifically
# in order to instead release memory in a non-blocking way like if UNLINK
# was called, using the following configuration directives:

lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no

############################## APPEND ONLY MODE ###############################

# By default Redis asynchronously dumps the dataset on disk. This mode is
# good enough in many applications, but an issue with the Redis process or
# a power outage may result into a few minutes of writes lost (depending on
# the configured save points).
#
# The Append Only File is an alternative persistence mode that provides
# much better durability. For instance using the default data fsync policy
# (see later in the config file) Redis can lose just one second of writes in a
# dramatic event like a server power outage, or a single write if something
# wrong with the Redis process itself happens, but the operating system is
# still running correctly.
#
# AOF and RDB persistence can be enabled at the same time without problems.
# If the AOF is enabled on startup Redis will load the AOF, that is the file
# with the better durability guarantees.
#
# Please check http://redis.io/topics/persistence for more information.

appendonly no

# The name of the append only file (default: "appendonly.aof")

appendfilename "appendonly.aof"

# The fsync() call tells the Operating System to actually write data on disk
# instead of waiting for more data in the output buffer. Some OS will really flush
# data on disk, some other OS will just try to do it ASAP.
#
# Redis supports three different modes:
#
# no: don't fsync, just let the OS flush the data when it wants. Faster.
# always: fsync after every write to the append only log. Slow, Safest.
# everysec: fsync only one time every second. Compromise.
#
# The default is "everysec", as that's usually the right compromise between
# speed and data safety. It's up to you to understand if you can relax this to
# "no" that will let the operating system flush the output buffer when
# it wants, for better performances (but if you can live with the idea of
# some data loss consider the default persistence mode that's snapshotting),
# or on the contrary, use "always" that's very slow but a bit safer than
# everysec.
#
# More details please check the following article:
# http://antirez.com/post/redis-persistence-demystified.html
#
# If unsure, use "everysec".

# appendfsync always
appendfsync everysec
# appendfsync no

# When the AOF fsync policy is set to always or everysec, and a background
# saving process (a background save or AOF log background rewriting) is
# performing a lot of I/O against the disk, in some Linux configurations
# Redis may block too long on the fsync() call. Note that there is no fix for
# this currently, as even performing fsync in a different thread will block
# our synchronous write(2) call.
#
# In order to mitigate this problem it's possible to use the following option
# that will prevent fsync() from being called in the main process while a
# BGSAVE or BGREWRITEAOF is in progress.
#
# This means that while another child is saving, the durability of Redis is
# the same as "appendfsync none". In practical terms, this means that it is
# possible to lose up to 30 seconds of log in the worst scenario (with the
# default Linux settings).
#
# If you have latency problems turn this to "yes". Otherwise leave it as
# "no" that is the safest pick from the point of view of durability.

no-appendfsync-on-rewrite no

# Automatic rewrite of the append only file.
# Redis is able to automatically rewrite the log file implicitly calling
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
#
# This is how it works: Redis remembers the size of the AOF file after the
# latest rewrite (if no rewrite has happened since the restart, the size of
# the AOF at startup is used).
#
# This base size is compared to the current size. If the current size is
# bigger than the specified percentage, the rewrite is triggered. Also
# you need to specify a minimal size for the AOF file to be rewritten, this
# is useful to avoid rewriting the AOF file even if the percentage increase
# is reached but it is still pretty small.
#
# Specify a percentage of zero in order to disable the automatic AOF
# rewrite feature.

auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

# An AOF file may be found to be truncated at the end during the Redis
# startup process, when the AOF data gets loaded back into memory.
# This may happen when the system where Redis is running
# crashes, especially when an ext4 filesystem is mounted without the
# data=ordered option (however this can't happen when Redis itself
# crashes or aborts but the operating system still works correctly).
#
# Redis can either exit with an error when this happens, or load as much
# data as possible (the default now) and start if the AOF file is found
# to be truncated at the end. The following option controls this behavior.
#
# If aof-load-truncated is set to yes, a truncated AOF file is loaded and
# the Redis server starts emitting a log to inform the user of the event.
# Otherwise if the option is set to no, the server aborts with an error
# and refuses to start. When the option is set to no, the user requires
# to fix the AOF file using the "redis-check-aof" utility before to restart
# the server.
#
# Note that if the AOF file will be found to be corrupted in the middle
# the server will still exit with an error. This option only applies when
# Redis will try to read more data from the AOF file but not enough bytes
# will be found.
aof-load-truncated yes

# When rewriting the AOF file, Redis is able to use an RDB preamble in the
# AOF file for faster rewrites and recoveries. When this option is turned
# on the rewritten AOF file is composed of two different stanzas:
#
#   [RDB file][AOF tail]
#
# When loading Redis recognizes that the AOF file starts with the "REDIS"
# string and loads the prefixed RDB file, and continues loading the AOF
# tail.
aof-use-rdb-preamble yes

################################ LUA SCRIPTING  ###############################

# Max execution time of a Lua script in milliseconds.
#
# If the maximum execution time is reached Redis will log that a script is
# still in execution after the maximum allowed time and will start to
# reply to queries with an error.
#
# When a long running script exceeds the maximum execution time only the
# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
# used to stop a script that did not yet called write commands. The second
# is the only way to shut down the server in the case a write command was
# already issued by the script but the user doesn't want to wait for the natural
# termination of the script.
#
# Set it to 0 or a negative value for unlimited execution without warnings.
lua-time-limit 5000

################################ REDIS CLUSTER  ###############################

# Normal Redis instances can't be part of a Redis Cluster; only nodes that are
# started as cluster nodes can. In order to start a Redis instance as a
# cluster node enable the cluster support uncommenting the following:
#
# cluster-enabled yes

# Every cluster node has a cluster configuration file. This file is not
# intended to be edited by hand. It is created and updated by Redis nodes.
# Every Redis Cluster node requires a different cluster configuration file.
# Make sure that instances running in the same system do not have
# overlapping cluster configuration file names.
#
# cluster-config-file nodes-6379.conf

# Cluster node timeout is the amount of milliseconds a node must be unreachable
# for it to be considered in failure state.
# Most other internal time limits are multiple of the node timeout.
#
# cluster-node-timeout 15000

# A replica of a failing master will avoid to start a failover if its data
# looks too old.
#
# There is no simple way for a replica to actually have an exact measure of
# its "data age", so the following two checks are performed:
#
# 1) If there are multiple replicas able to failover, they exchange messages
#    in order to try to give an advantage to the replica with the best
#    replication offset (more data from the master processed).
#    Replicas will try to get their rank by offset, and apply to the start
#    of the failover a delay proportional to their rank.
#
# 2) Every single replica computes the time of the last interaction with
#    its master. This can be the last ping or command received (if the master
#    is still in the "connected" state), or the time that elapsed since the
#    disconnection with the master (if the replication link is currently down).
#    If the last interaction is too old, the replica will not try to failover
#    at all.
#
# The point "2" can be tuned by user. Specifically a replica will not perform
# the failover if, since the last interaction with the master, the time
# elapsed is greater than:
#
#   (node-timeout * replica-validity-factor) + repl-ping-replica-period
#
# So for example if node-timeout is 30 seconds, and the replica-validity-factor
# is 10, and assuming a default repl-ping-replica-period of 10 seconds, the
# replica will not try to failover if it was not able to talk with the master
# for longer than 310 seconds.
#
# A large replica-validity-factor may allow replicas with too old data to failover
# a master, while a too small value may prevent the cluster from being able to
# elect a replica at all.
#
# For maximum availability, it is possible to set the replica-validity-factor
# to a value of 0, which means, that replicas will always try to failover the
# master regardless of the last time they interacted with the master.
# (However they'll always try to apply a delay proportional to their
# offset rank).
#
# Zero is the only value able to guarantee that when all the partitions heal
# the cluster will always be able to continue.
#
# cluster-replica-validity-factor 10

# Cluster replicas are able to migrate to orphaned masters, that are masters
# that are left without working replicas. This improves the cluster ability
# to resist to failures as otherwise an orphaned master can't be failed over
# in case of failure if it has no working replicas.
#
# Replicas migrate to orphaned masters only if there are still at least a
# given number of other working replicas for their old master. This number
# is the "migration barrier". A migration barrier of 1 means that a replica
# will migrate only if there is at least 1 other working replica for its master
# and so forth. It usually reflects the number of replicas you want for every
# master in your cluster.
#
# Default is 1 (replicas migrate only if their masters remain with at least
# one replica). To disable migration just set it to a very large value.
# A value of 0 can be set but is useful only for debugging and dangerous
# in production.
#
# cluster-migration-barrier 1

# By default Redis Cluster nodes stop accepting queries if they detect there
# is at least an hash slot uncovered (no available node is serving it).
# This way if the cluster is partially down (for example a range of hash slots
# are no longer covered) all the cluster becomes, eventually, unavailable.
# It automatically returns available as soon as all the slots are covered again.
#
# However sometimes you want the subset of the cluster which is working,
# to continue to accept queries for the part of the key space that is still
# covered. In order to do so, just set the cluster-require-full-coverage
# option to no.
#
# cluster-require-full-coverage yes

# This option, when set to yes, prevents replicas from trying to failover its
# master during master failures. However the master can still perform a
# manual failover, if forced to do so.
#
# This is useful in different scenarios, especially in the case of multiple
# data center operations, where we want one side to never be promoted if not
# in the case of a total DC failure.
#
# cluster-replica-no-failover no

# In order to setup your cluster make sure to read the documentation
# available at http://redis.io web site.

########################## CLUSTER DOCKER/NAT support  ########################

# In certain deployments, Redis Cluster nodes address discovery fails, because
# addresses are NAT-ted or because ports are forwarded (the typical case is
# Docker and other containers).
#
# In order to make Redis Cluster working in such environments, a static
# configuration where each node knows its public address is needed. The
# following two options are used for this scope, and are:
#
# * cluster-announce-ip
# * cluster-announce-port
# * cluster-announce-bus-port
#
# Each instruct the node about its address, client port, and cluster message
# bus port. The information is then published in the header of the bus packets
# so that other nodes will be able to correctly map the address of the node
# publishing the information.
#
# If the above options are not used, the normal Redis Cluster auto-detection
# will be used instead.
#
# Note that when remapped, the bus port may not be at the fixed offset of
# clients port + 10000, so you can specify any port and bus-port depending
# on how they get remapped. If the bus-port is not set, a fixed offset of
# 10000 will be used as usually.
#
# Example:
#
# cluster-announce-ip 10.1.1.5
# cluster-announce-port 6379
# cluster-announce-bus-port 6380

################################## SLOW LOG ###################################

# The Redis Slow Log is a system to log queries that exceeded a specified
# execution time. The execution time does not include the I/O operations
# like talking with the client, sending the reply and so forth,
# but just the time needed to actually execute the command (this is the only
# stage of command execution where the thread is blocked and can not serve
# other requests in the meantime).
#
# You can configure the slow log with two parameters: one tells Redis
# what is the execution time, in microseconds, to exceed in order for the
# command to get logged, and the other parameter is the length of the
# slow log. When a new command is logged the oldest one is removed from the
# queue of logged commands.

# The following time is expressed in microseconds, so 1000000 is equivalent
# to one second. Note that a negative number disables the slow log, while
# a value of zero forces the logging of every command.
slowlog-log-slower-than 10000

# There is no limit to this length. Just be aware that it will consume memory.
# You can reclaim memory used by the slow log with SLOWLOG RESET.
slowlog-max-len 128

################################ LATENCY MONITOR ##############################

# The Redis latency monitoring subsystem samples different operations
# at runtime in order to collect data related to possible sources of
# latency of a Redis instance.
#
# Via the LATENCY command this information is available to the user that can
# print graphs and obtain reports.
#
# The system only logs operations that were performed in a time equal or
# greater than the amount of milliseconds specified via the
# latency-monitor-threshold configuration directive. When its value is set
# to zero, the latency monitor is turned off.
#
# By default latency monitoring is disabled since it is mostly not needed
# if you don't have latency issues, and collecting data has a performance
# impact, that while very small, can be measured under big load. Latency
# monitoring can easily be enabled at runtime using the command
# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
latency-monitor-threshold 0

############################# EVENT NOTIFICATION ##############################

# Redis can notify Pub/Sub clients about events happening in the key space.
# This feature is documented at http://redis.io/topics/notifications
#
# For instance if keyspace events notification is enabled, and a client
# performs a DEL operation on key "foo" stored in the Database 0, two
# messages will be published via Pub/Sub:
#
# PUBLISH __keyspace@0__:foo del
# PUBLISH __keyevent@0__:del foo
#
# It is possible to select the events that Redis will notify among a set
# of classes. Every class is identified by a single character:
#
#  K     Keyspace events, published with __keyspace@<db>__ prefix.
#  E     Keyevent events, published with __keyevent@<db>__ prefix.
#  g     Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
#  $     String commands
#  l     List commands
#  s     Set commands
#  h     Hash commands
#  z     Sorted set commands
#  x     Expired events (events generated every time a key expires)
#  e     Evicted events (events generated when a key is evicted for maxmemory)
#  A     Alias for g$lshzxe, so that the "AKE" string means all the events.
#
#  The "notify-keyspace-events" takes as argument a string that is composed
#  of zero or multiple characters. The empty string means that notifications
#  are disabled.
#
#  Example: to enable list and generic events, from the point of view of the
#           event name, use:
#
#  notify-keyspace-events Elg
#
#  Example 2: to get the stream of the expired keys subscribing to channel
#             name __keyevent@0__:expired use:
#
#  notify-keyspace-events Ex
#
#  By default all notifications are disabled because most users don't need
#  this feature and the feature has some overhead. Note that if you don't
#  specify at least one of K or E, no events will be delivered.
notify-keyspace-events ""

############################### ADVANCED CONFIG ###############################

# Hashes are encoded using a memory efficient data structure when they have a
# small number of entries, and the biggest entry does not exceed a given
# threshold. These thresholds can be configured using the following directives.
hash-max-ziplist-entries 512
hash-max-ziplist-value 64

# Lists are also encoded in a special way to save a lot of space.
# The number of entries allowed per internal list node can be specified
# as a fixed maximum size or a maximum number of elements.
# For a fixed maximum size, use -5 through -1, meaning:
# -5: max size: 64 Kb  <-- not recommended for normal workloads
# -4: max size: 32 Kb  <-- not recommended
# -3: max size: 16 Kb  <-- probably not recommended
# -2: max size: 8 Kb   <-- good
# -1: max size: 4 Kb   <-- good
# Positive numbers mean store up to _exactly_ that number of elements
# per list node.
# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
# but if your use case is unique, adjust the settings as necessary.
list-max-ziplist-size -2

# Lists may also be compressed.
# Compress depth is the number of quicklist ziplist nodes from *each* side of
# the list to *exclude* from compression.  The head and tail of the list
# are always uncompressed for fast push/pop operations.  Settings are:
# 0: disable all list compression
# 1: depth 1 means "don't start compressing until after 1 node into the list,
#    going from either the head or tail"
#    So: [head]->node->node->...->node->[tail]
#    [head], [tail] will always be uncompressed; inner nodes will compress.
# 2: [head]->[next]->node->node->...->node->[prev]->[tail]
#    2 here means: don't compress head or head->next or tail->prev or tail,
#    but compress all nodes between them.
# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
# etc.
list-compress-depth 0

# Sets have a special encoding in just one case: when a set is composed
# of just strings that happen to be integers in radix 10 in the range
# of 64 bit signed integers.
# The following configuration setting sets the limit in the size of the
# set in order to use this special memory saving encoding.
set-max-intset-entries 512

# Similarly to hashes and lists, sorted sets are also specially encoded in
# order to save a lot of space. This encoding is only used when the length and
# elements of a sorted set are below the following limits:
zset-max-ziplist-entries 128
zset-max-ziplist-value 64

# HyperLogLog sparse representation bytes limit. The limit includes the
# 16 bytes header. When an HyperLogLog using the sparse representation crosses
# this limit, it is converted into the dense representation.
#
# A value greater than 16000 is totally useless, since at that point the
# dense representation is more memory efficient.
#
# The suggested value is ~ 3000 in order to have the benefits of
# the space efficient encoding without slowing down too much PFADD,
# which is O(N) with the sparse encoding. The value can be raised to
# ~ 10000 when CPU is not a concern, but space is, and the data set is
# composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
hll-sparse-max-bytes 3000

# Streams macro node max size / items. The stream data structure is a radix
# tree of big nodes that encode multiple items inside. Using this configuration
# it is possible to configure how big a single node can be in bytes, and the
# maximum number of items it may contain before switching to a new node when
# appending new stream entries. If any of the following settings are set to
# zero, the limit is ignored, so for instance it is possible to set just a
# max entires limit by setting max-bytes to 0 and max-entries to the desired
# value.
stream-node-max-bytes 4096
stream-node-max-entries 100

# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
# order to help rehashing the main Redis hash table (the one mapping top-level
# keys to values). The hash table implementation Redis uses (see dict.c)
# performs a lazy rehashing: the more operation you run into a hash table
# that is rehashing, the more rehashing "steps" are performed, so if the
# server is idle the rehashing is never complete and some more memory is used
# by the hash table.
#
# The default is to use this millisecond 10 times every second in order to
# actively rehash the main dictionaries, freeing memory when possible.
#
# If unsure:
# use "activerehashing no" if you have hard latency requirements and it is
# not a good thing in your environment that Redis can reply from time to time
# to queries with 2 milliseconds delay.
#
# use "activerehashing yes" if you don't have such hard requirements but
# want to free memory asap when possible.
activerehashing yes

# The client output buffer limits can be used to force disconnection of clients
# that are not reading data from the server fast enough for some reason (a
# common reason is that a Pub/Sub client can't consume messages as fast as the
# publisher can produce them).
#
# The limit can be set differently for the three different classes of clients:
#
# normal -> normal clients including MONITOR clients
# replica  -> replica clients
# pubsub -> clients subscribed to at least one pubsub channel or pattern
#
# The syntax of every client-output-buffer-limit directive is the following:
#
# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
#
# A client is immediately disconnected once the hard limit is reached, or if
# the soft limit is reached and remains reached for the specified number of
# seconds (continuously).
# So for instance if the hard limit is 32 megabytes and the soft limit is
# 16 megabytes / 10 seconds, the client will get disconnected immediately
# if the size of the output buffers reach 32 megabytes, but will also get
# disconnected if the client reaches 16 megabytes and continuously overcomes
# the limit for 10 seconds.
#
# By default normal clients are not limited because they don't receive data
# without asking (in a push way), but just after a request, so only
# asynchronous clients may create a scenario where data is requested faster
# than it can read.
#
# Instead there is a default limit for pubsub and replica clients, since
# subscribers and replicas receive data in a push fashion.
#
# Both the hard or the soft limit can be disabled by setting them to zero.
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60

# Client query buffers accumulate new commands. They are limited to a fixed
# amount by default in order to avoid that a protocol desynchronization (for
# instance due to a bug in the client) will lead to unbound memory usage in
# the query buffer. However you can configure it here if you have very special
# needs, such us huge multi/exec requests or alike.
#
# client-query-buffer-limit 1gb

# In the Redis protocol, bulk requests, that are, elements representing single
# strings, are normally limited ot 512 mb. However you can change this limit
# here.
#
# proto-max-bulk-len 512mb

# Redis calls an internal function to perform many background tasks, like
# closing connections of clients in timeout, purging expired keys that are
# never requested, and so forth.
#
# Not all tasks are performed with the same frequency, but Redis checks for
# tasks to perform according to the specified "hz" value.
#
# By default "hz" is set to 10. Raising the value will use more CPU when
# Redis is idle, but at the same time will make Redis more responsive when
# there are many keys expiring at the same time, and timeouts may be
# handled with more precision.
#
# The range is between 1 and 500, however a value over 100 is usually not
# a good idea. Most users should use the default of 10 and raise this up to
# 100 only in environments where very low latency is required.
hz 10

# Normally it is useful to have an HZ value which is proportional to the
# number of clients connected. This is useful in order, for instance, to
# avoid too many clients are processed for each background task invocation
# in order to avoid latency spikes.
#
# Since the default HZ value by default is conservatively set to 10, Redis
# offers, and enables by default, the ability to use an adaptive HZ value
# which will temporary raise when there are many connected clients.
#
# When dynamic HZ is enabled, the actual configured HZ will be used as
# as a baseline, but multiples of the configured HZ value will be actually
# used as needed once more clients are connected. In this way an idle
# instance will use very little CPU time while a busy instance will be
# more responsive.
dynamic-hz yes

# When a child rewrites the AOF file, if the following option is enabled
# the file will be fsync-ed every 32 MB of data generated. This is useful
# in order to commit the file to the disk more incrementally and avoid
# big latency spikes.
aof-rewrite-incremental-fsync yes

# When redis saves RDB file, if the following option is enabled
# the file will be fsync-ed every 32 MB of data generated. This is useful
# in order to commit the file to the disk more incrementally and avoid
# big latency spikes.
rdb-save-incremental-fsync yes

# Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good
# idea to start with the default settings and only change them after investigating
# how to improve the performances and how the keys LFU change over time, which
# is possible to inspect via the OBJECT FREQ command.
#
# There are two tunable parameters in the Redis LFU implementation: the
# counter logarithm factor and the counter decay time. It is important to
# understand what the two parameters mean before changing them.
#
# The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis
# uses a probabilistic increment with logarithmic behavior. Given the value
# of the old counter, when a key is accessed, the counter is incremented in
# this way:
#
# 1. A random number R between 0 and 1 is extracted.
# 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1).
# 3. The counter is incremented only if R < P.
#
# The default lfu-log-factor is 10. This is a table of how the frequency
# counter changes with a different number of accesses with different
# logarithmic factors:
#
# +--------+------------+------------+------------+------------+------------+
# | factor | 100 hits   | 1000 hits  | 100K hits  | 1M hits    | 10M hits   |
# +--------+------------+------------+------------+------------+------------+
# | 0      | 104        | 255        | 255        | 255        | 255        |
# +--------+------------+------------+------------+------------+------------+
# | 1      | 18         | 49         | 255        | 255        | 255        |
# +--------+------------+------------+------------+------------+------------+
# | 10     | 10         | 18         | 142        | 255        | 255        |
# +--------+------------+------------+------------+------------+------------+
# | 100    | 8          | 11         | 49         | 143        | 255        |
# +--------+------------+------------+------------+------------+------------+
#
# NOTE: The above table was obtained by running the following commands:
#
#   redis-benchmark -n 1000000 incr foo
#   redis-cli object freq foo
#
# NOTE 2: The counter initial value is 5 in order to give new objects a chance
# to accumulate hits.
#
# The counter decay time is the time, in minutes, that must elapse in order
# for the key counter to be divided by two (or decremented if it has a value
# less <= 10).
#
# The default value for the lfu-decay-time is 1. A Special value of 0 means to
# decay the counter every time it happens to be scanned.
#
# lfu-log-factor 10
# lfu-decay-time 1

########################### ACTIVE DEFRAGMENTATION #######################
#
# WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested
# even in production and manually tested by multiple engineers for some
# time.
#
# What is active defragmentation?
# -------------------------------
#
# Active (online) defragmentation allows a Redis server to compact the
# spaces left between small allocations and deallocations of data in memory,
# thus allowing to reclaim back memory.
#
# Fragmentation is a natural process that happens with every allocator (but
# less so with Jemalloc, fortunately) and certain workloads. Normally a server
# restart is needed in order to lower the fragmentation, or at least to flush
# away all the data and create it again. However thanks to this feature
# implemented by Oran Agra for Redis 4.0 this process can happen at runtime
# in an "hot" way, while the server is running.
#
# Basically when the fragmentation is over a certain level (see the
# configuration options below) Redis will start to create new copies of the
# values in contiguous memory regions by exploiting certain specific Jemalloc
# features (in order to understand if an allocation is causing fragmentation
# and to allocate it in a better place), and at the same time, will release the
# old copies of the data. This process, repeated incrementally for all the keys
# will cause the fragmentation to drop back to normal values.
#
# Important things to understand:
#
# 1. This feature is disabled by default, and only works if you compiled Redis
#    to use the copy of Jemalloc we ship with the source code of Redis.
#    This is the default with Linux builds.
#
# 2. You never need to enable this feature if you don't have fragmentation
#    issues.
#
# 3. Once you experience fragmentation, you can enable this feature when
#    needed with the command "CONFIG SET activedefrag yes".
#
# The configuration parameters are able to fine tune the behavior of the
# defragmentation process. If you are not sure about what they mean it is
# a good idea to leave the defaults untouched.

# Enabled active defragmentation
# activedefrag yes

# Minimum amount of fragmentation waste to start active defrag
# active-defrag-ignore-bytes 100mb

# Minimum percentage of fragmentation to start active defrag
# active-defrag-threshold-lower 10

# Maximum percentage of fragmentation at which we use maximum effort
# active-defrag-threshold-upper 100

# Minimal effort for defrag in CPU percentage
# active-defrag-cycle-min 5

# Maximal effort for defrag in CPU percentage
# active-defrag-cycle-max 75

# Maximum number of set/hash/zset/list fields that will be processed from
# the main dictionary scan
# active-defrag-max-scan-fields 1000



================================================
FILE: redis/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: redis/docker-compose.yml
================================================
version: '3'
services:

  redis:
    image: redis
    container_name: redis
    command: redis-server /etc/redis/redis.conf
    ports:
      - "6379:6379"
    volumes:
      - ./data:/data
      - ./conf/redis.conf:/etc/redis/redis.conf


================================================
FILE: redis/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: redis-cluster/.gitignore
================================================
.env

================================================
FILE: redis-cluster/README.md
================================================
# example

搭建1主3从3哨兵的 redis 集群

## Usage

```bash
cp .env.example .env 
docker-compose up -d
```

- test master

```
docker exec -it redis-server-master redis-cli

127.0.0.1:6379> auth redis
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> info replication
# Replication
role:master
connected_slaves:3
slave0:ip=10.10.10.3,port=6379,state=online,offset=52707,lag=1
slave1:ip=10.10.10.4,port=6379,state=online,offset=52842,lag=1
slave2:ip=10.10.10.2,port=6379,state=online,offset=52842,lag=1
master_failover_state:no-failover
master_replid:11bd4119e3906e4f7c7e1637d100a21bf4c3593c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:52842
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:52842
```

- test slave

```
docker exec -it redis-server-slave-1 redis-cli

127.0.0.1:6379> auth redis
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> info replication
# Replication
role:slave
master_host:10.10.10.1
master_port:6379
master_link_status:up
master_last_io_seconds_ago:1
master_sync_in_progress:0
slave_read_repl_offset:145691
slave_repl_offset:145691
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:11bd4119e3906e4f7c7e1637d100a21bf4c3593c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:145691
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:145691
```

- test sentinel

```
docker exec -it redis-server-sentinel-1 /bin/sh
/data # redis-cli -p 26379 -h 10.10.10.5
10.10.10.5:26379> sentinel master mymaster
 1) "name"
 2) "mymaster"
 3) "ip"
 4) "10.10.10.1"
 5) "port"
 6) "6379"
 7) "runid"
```


================================================
FILE: redis-cluster/conf/.gitignore
================================================


================================================
FILE: redis-cluster/conf/redis-master.conf
================================================
bind 0.0.0.0

protected-mode yes

port 6379

always-show-logo no

requirepass "redis"

rename-command KEYS ""

dir "/data"

masterauth "redis"

================================================
FILE: redis-cluster/conf/redis-sentinel1.conf
================================================
bind 0.0.0.0
protected-mode yes
port 26379
sentinel myid 0a353690ac056095f3d33671d3f3b6fd316ec9be
sentinel deny-scripts-reconfig yes
sentinel monitor mymaster 10.10.10.1 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel auth-pass mymaster redis
dir "/data"


================================================
FILE: redis-cluster/conf/redis-sentinel2.conf
================================================
bind 0.0.0.0
protected-mode yes
port 26379
sentinel myid be47a103d66f41f79c07503db4243f7cf4e2217e
sentinel deny-scripts-reconfig yes
sentinel monitor mymaster 10.10.10.1 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel auth-pass mymaster redis
dir "/data"

================================================
FILE: redis-cluster/conf/redis-sentinel3.conf
================================================
bind 0.0.0.0
protected-mode yes
port 26379
sentinel myid 6556d69081a155942a3505aaa37f5085acf88fc4
sentinel deny-scripts-reconfig yes
sentinel monitor mymaster 10.10.10.1 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel auth-pass mymaster redis
dir "/data"

================================================
FILE: redis-cluster/conf/redis-slave1.conf
================================================
bind 0.0.0.0

protected-mode yes

port 6379

always-show-logo no

requirepass "redis"

rename-command KEYS ""

replicaof redis-server-master 6379

masterauth "redis"
dir "/data"

================================================
FILE: redis-cluster/conf/redis-slave2.conf
================================================
bind 0.0.0.0

protected-mode yes

port 6379

always-show-logo no

requirepass "redis"

rename-command KEYS ""

replicaof redis-server-master 6379

masterauth "redis"
dir "/data"

================================================
FILE: redis-cluster/conf/redis-slave3.conf
================================================
bind 0.0.0.0

protected-mode yes

port 6379

always-show-logo no

requirepass "redis"

rename-command KEYS ""

replicaof redis-server-master 6379

masterauth "redis"
dir "/data"

================================================
FILE: redis-cluster/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: redis-cluster/docker-compose.yml
================================================
version: '3'
services:

  redis-server-master:
    image: redis:6.2-alpine
    container_name: redis-server-master
    ports:
      - ${PORT_SERVER_MASTER}:6379
    restart: always
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-master.conf:/usr/local/etc/redis/redis.conf
      - ./data/redis-master:/data
    sysctls:
      net.core.somaxconn: '511'
    command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_MASTER}

  redis-server-slave-1:
    image: redis:6.2-alpine
    container_name: redis-server-slave-1
    ports:
      - ${PORT_SERVER_SLAVE_1}:6379
    restart: always
    depends_on:
      - redis-server-master
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-slave1.conf:/usr/local/etc/redis/redis.conf
      - ./data/redis-slave-1:/data
    sysctls:
      net.core.somaxconn: '511'
    command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_SLAVE_1}

  redis-server-slave-2:
    image: redis:6.2-alpine
    container_name: redis-server-slave-2
    ports:
      - ${PORT_SERVER_SLAVE_2}:6379
    restart: always
    depends_on:
      - redis-server-master
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-slave2.conf:/usr/local/etc/redis/redis.conf
      - ./data/redis-slave-2:/data
    sysctls:
      net.core.somaxconn: '511'
    command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_SLAVE_2}

  redis-server-slave-3:
    image: redis:6.2-alpine
    container_name: redis-server-slave-3
    ports:
      - ${PORT_SERVER_SLAVE_3}:6379
    restart: always
    depends_on:
      - redis-server-master
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-slave3.conf:/usr/local/etc/redis/redis.conf
      - ./data/redis-slave-3:/data
    sysctls:
      net.core.somaxconn: '511'
    command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_SLAVE_3}

  redis-server-sentinel-1:
    image: redis:6.2-alpine
    container_name: redis-server-sentinel-1
    ports:
      - ${PORT_SERVER_SENTINEL_1}:26379
    restart: always
    depends_on:
      - redis-server-master
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-sentinel1.conf:/usr/local/etc/redis/sentinel.conf
    sysctls:
      net.core.somaxconn: '511'
    command: ["redis-sentinel","/usr/local/etc/redis/sentinel.conf"]
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_SENTINEL_1}

  redis-server-sentinel-2:
    image: redis:6.2-alpine
    container_name: redis-server-sentinel-2
    ports:
      - ${PORT_SERVER_SENTINEL_2}:26379
    restart: always
    depends_on:
      - redis-server-master
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-sentinel2.conf:/usr/local/etc/redis/sentinel.conf
    command: ["redis-sentinel","/usr/local/etc/redis/sentinel.conf"]
    sysctls:
      net.core.somaxconn: '511' 
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_SENTINEL_2}

  redis-server-sentinel-3:
    image: redis:6.2-alpine
    container_name: redis-server-sentinel-3
    ports:
      - ${PORT_SERVER_SENTINEL_3}:26379
    restart: always
    depends_on:
      - redis-server-master
    environment:
      TZ: ${TIMEZONE}
    volumes:
      - ./conf/redis-sentinel3.conf:/usr/local/etc/redis/sentinel.conf
    sysctls: 
      net.core.somaxconn: '511'
    command: ["redis-sentinel","/usr/local/etc/redis/sentinel.conf"]
    networks:
      net-redis-server:
        ipv4_address: ${IP_SERVER_SENTINEL_3}

networks:
    net-redis-server:
      driver: bridge
      ipam:
        config:
          - subnet: ${SUBNET}

================================================
FILE: redis-cluster/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: wikijs/.gitignore
================================================
.env

================================================
FILE: wikijs/README.md
================================================
# wikijs

## Usage

```bash
docker-compose up -d db wiki
```

访问: [http://127.0.0.1:3000](http://127.0.0.1:3000)

================================================
FILE: wikijs/conf/.gitignore
================================================


================================================
FILE: wikijs/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: wikijs/docker-compose.yml
================================================
version: "3"
services:

  db:
    image: postgres:11-alpine
    container_name: wikijs_db
    environment:
      POSTGRES_DB: wiki
      POSTGRES_PASSWORD: wikijsrocks
      POSTGRES_USER: wikijs
    logging:
      driver: "none"
    restart: unless-stopped
    volumes:
      - ./data/postgres:/var/lib/postgresql/data

  wiki:
    image: ghcr.io/requarks/wiki:2
    container_name: wikijs_wiki
    depends_on:
      - db
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: wikijs
      DB_PASS: wikijsrocks
      DB_NAME: wiki
    restart: unless-stopped
    ports:
      - "3000:3000"

================================================
FILE: wikijs/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: wordpress/.gitignore
================================================
.env

================================================
FILE: wordpress/README.md
================================================
# wordpress

## Usage

```bash
cp .env.example .env
docker-compose up -d mysql wordpress
```

访问: [http://127.0.0.1:80](http://127.0.0.1:80)


================================================
FILE: wordpress/conf/.gitignore
================================================


================================================
FILE: wordpress/conf/my.cnf
================================================
[mysqld]
user=mysql
default-storage-engine=INNODB
character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8

================================================
FILE: wordpress/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: wordpress/docker-compose.yml
================================================
version: '3'
services:
  wordpress:
    image: wordpress
    container_name: wordpress
    ports:
      - "80:80"
    environment:
      DB_HOST: ${HOST_MYSQL}
      DB_NAME: ${DB_NAME}
      DB_USER: ${DB_USER}
      DB_PASSWORD: ${DB_PASSWORD}
    volumes:
      - ./data/wordpress:/var/www/html
      - ./log/php/:/var/log/php/:rw
    depends_on:
      - mysql
  mysql:
    image: mysql:5.7
    container_name: ${HOST_MYSQL}
    volumes:
      - ./data/mysql:/var/lib/mysql
      - ./conf/my.cnf:/etc/my.cnf
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MYSQL_DATABASE: ${DB_NAME}
      MYSQL_USER: ${DB_USER}
      MYSQL_PASSWORD: ${DB_PASSWORD}

================================================
FILE: wordpress/log/.gitignore
================================================
*
!.gitignore

================================================
FILE: yapi/.gitignore
================================================
.env

================================================
FILE: yapi/README.md
================================================
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d
```

访问: [http://127.0.0.1:40001](http://127.0.0.1:40001)
默认的登录账号为 admin@yapi.com,密码为 admin,可在 .env 文件中调整。



================================================
FILE: yapi/conf/.gitignore
================================================


================================================
FILE: yapi/data/.gitignore
================================================
*
!.gitignore

================================================
FILE: yapi/docker-compose.yml
================================================
version: '3'

services:
  yapi-web:
    image: jayfong/yapi:latest
    container_name: yapi-web
    ports:
      - ${YAPI_PORT}:3000
    environment:
      - YAPI_ADMIN_ACCOUNT=${YAPI_ADMIN_ACCOUNT}
      - YAPI_ADMIN_PASSWORD=${YAPI_ADMIN_PASSWORD}
      - YAPI_CLOSE_REGISTER=true
      - YAPI_DB_SERVERNAME=yapi-mongo
      - YAPI_DB_PORT=${MONGO_PORT}
      - YAPI_DB_DATABASE=${DB_DATABASE}
      - YAPI_MAIL_ENABLE=false
      - YAPI_LDAP_LOGIN_ENABLE=false
      - YAPI_PLUGINS=[]
    depends_on:
      - yapi-mongo
    links:
      - yapi-mongo
    restart: unless-stopped

  yapi-mongo:
    image: mongo:latest
    container_name: yapi-mongo
    volumes:
      - ./data/db:/data/db
    expose:
      - ${MONGO_PORT}
    restart: unless-stopped

================================================
FILE: yapi/log/.gitignore
================================================
*
!.gitignore
Download .txt
gitextract_wnm2lqsh/

├── LICENSE
├── MinIO/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── MinIO-cluster/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── README.md
├── Yearning/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── apollo/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   ├── log/
│   │   └── .gitignore
│   └── sql/
│       ├── apolloconfigdb.sql
│       └── apolloportaldb.sql
├── beanstalkd/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── confluence/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── drawio/
│   ├── .gitignore
│   ├── Dockerfile
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── elk/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   ├── filebeat/
│   │   ├── Dockerfile
│   │   └── filebeat.yml
│   ├── log/
│   │   └── .gitignore
│   └── logstash/
│       ├── Dockerfile
│       └── logstash.conf
├── example/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── excalidraw/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── gitlab/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jenkins/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jira/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── mysql/
│   │   │   └── my.cnf
│   │   └── mysql-connector-java-5.1.48.jar
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jumpserver/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── jumpserver-all-in-one/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── maxwell/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── maxwell/
│   │   │   └── config.properties
│   │   └── mysql/
│   │       └── mysql.cnf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── mongo/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── mongod.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── mongo-express/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── mongod.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── phpmyadmin/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── prometheus/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── alertmanager/
│   │   │   └── alertmanager.yml
│   │   └── prometheus/
│   │       ├── prometheus.yml
│   │       └── rules/
│   │           └── demo.rules
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── rabbitmq/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── rabbitmq.config
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── redis/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── redis.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── redis-cluster/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   ├── redis-master.conf
│   │   ├── redis-sentinel1.conf
│   │   ├── redis-sentinel2.conf
│   │   ├── redis-sentinel3.conf
│   │   ├── redis-slave1.conf
│   │   ├── redis-slave2.conf
│   │   └── redis-slave3.conf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── wikijs/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   └── .gitignore
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
├── wordpress/
│   ├── .gitignore
│   ├── README.md
│   ├── conf/
│   │   ├── .gitignore
│   │   └── my.cnf
│   ├── data/
│   │   └── .gitignore
│   ├── docker-compose.yml
│   └── log/
│       └── .gitignore
└── yapi/
    ├── .gitignore
    ├── README.md
    ├── conf/
    │   └── .gitignore
    ├── data/
    │   └── .gitignore
    ├── docker-compose.yml
    └── log/
        └── .gitignore
Download .txt
SYMBOL INDEX (35 symbols across 2 files)

FILE: apollo/sql/apolloconfigdb.sql
  type `App` (line 35) | CREATE TABLE `App` (
  type `AppNamespace` (line 62) | CREATE TABLE `AppNamespace` (
  type `Audit` (line 88) | CREATE TABLE `Audit` (
  type `Cluster` (line 111) | CREATE TABLE `Cluster` (
  type `Commit` (line 135) | CREATE TABLE `Commit` (
  type `GrayReleaseRule` (line 160) | CREATE TABLE `GrayReleaseRule` (
  type `Instance` (line 186) | CREATE TABLE `Instance` (
  type `InstanceConfig` (line 207) | CREATE TABLE `InstanceConfig` (
  type `Item` (line 231) | CREATE TABLE `Item` (
  type `Namespace` (line 256) | CREATE TABLE `Namespace` (
  type `NamespaceLock` (line 280) | CREATE TABLE `NamespaceLock` (
  type `Release` (line 301) | CREATE TABLE `Release` (
  type `ReleaseHistory` (line 329) | CREATE TABLE `ReleaseHistory` (
  type `ReleaseMessage` (line 357) | CREATE TABLE `ReleaseMessage` (
  type `ServerConfig` (line 373) | CREATE TABLE `ServerConfig` (
  type `AccessKey` (line 395) | CREATE TABLE `AccessKey` (

FILE: apollo/sql/apolloportaldb.sql
  type `App` (line 35) | CREATE TABLE `App` (
  type `AppNamespace` (line 62) | CREATE TABLE `AppNamespace` (
  type `Consumer` (line 88) | CREATE TABLE `Consumer` (
  type `ConsumerAudit` (line 114) | CREATE TABLE `ConsumerAudit` (
  type `ConsumerRole` (line 133) | CREATE TABLE `ConsumerRole` (
  type `ConsumerToken` (line 156) | CREATE TABLE `ConsumerToken` (
  type `Favorite` (line 177) | CREATE TABLE `Favorite` (
  type `Permission` (line 199) | CREATE TABLE `Permission` (
  type `Role` (line 221) | CREATE TABLE `Role` (
  type `RolePermission` (line 242) | CREATE TABLE `RolePermission` (
  type `ServerConfig` (line 265) | CREATE TABLE `ServerConfig` (
  type `UserRole` (line 288) | CREATE TABLE `UserRole` (
  type `Users` (line 309) | CREATE TABLE `Users` (
  type `Authorities` (line 326) | CREATE TABLE `Authorities` (
  type SPRING_SESSION (line 392) | CREATE TABLE SPRING_SESSION (
  type SPRING_SESSION_IX1 (line 403) | CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID)
  type SPRING_SESSION_IX2 (line 404) | CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME)
  type SPRING_SESSION_IX3 (line 405) | CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME)
  type SPRING_SESSION_ATTRIBUTES (line 407) | CREATE TABLE SPRING_SESSION_ATTRIBUTES (
Condensed preview — 184 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (196K chars).
[
  {
    "path": "LICENSE",
    "chars": 1064,
    "preview": "MIT License\n\nCopyright (c) 2022 MaxFang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof"
  },
  {
    "path": "MinIO/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "MinIO/README.md",
    "chars": 887,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d minio\n```\n\n访问: [http://127.0.0.1:9000](http://127"
  },
  {
    "path": "MinIO/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "MinIO/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "MinIO/docker-compose.yml",
    "chars": 371,
    "preview": "version: '3'\nservices:\n  minio:\n    image: minio/minio:${VERSION}\n    container_name: minio\n    ports:\n      - ${PORT}:9"
  },
  {
    "path": "MinIO/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "MinIO-cluster/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "MinIO-cluster/README.md",
    "chars": 1025,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d minio1 minio2 minio3 minio4\n```\n\n一般会使用nginx代理访问该服"
  },
  {
    "path": "MinIO-cluster/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "MinIO-cluster/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "MinIO-cluster/docker-compose.yml",
    "chars": 1707,
    "preview": "version: '3'\nservices:\n  minio1:\n    image: minio/minio:${VERSION}\n    container_name: minio1\n    ports:\n      - ${PORT_"
  },
  {
    "path": "MinIO-cluster/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "README.md",
    "chars": 2837,
    "preview": "# docker-install-everything\n\n> install all environments using docker-compose.\n> 使用 docker-compose 安装各种服务。\n\n## 项目特色\n\n- 仅依"
  },
  {
    "path": "Yearning/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "Yearning/README.md",
    "chars": 249,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d\n```\n\n> 若发现 mysql 起来了,Yearning 服务未起来。\n> docker log"
  },
  {
    "path": "Yearning/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "Yearning/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "Yearning/docker-compose.yml",
    "chars": 969,
    "preview": "version: '3'\n\nservices:\n    yearning:\n        image: chaiyd/yearning:latest\n        container_name: yearning\n        env"
  },
  {
    "path": "Yearning/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "apollo/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "apollo/README.md",
    "chars": 638,
    "preview": "# example\n\n## Usage\n\n1. 添加配置,创建网络\n```bash\ncp .env.example .env\n\ndocker network create apollo\n```\n\n2. 启动数据库服务,账号授权\n```bas"
  },
  {
    "path": "apollo/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "apollo/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "apollo/docker-compose.yml",
    "chars": 2037,
    "preview": "version: '3'\nservices:\n  apollo-configservice:\n    image: apolloconfig/apollo-configservice\n    container_name: apollo-c"
  },
  {
    "path": "apollo/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "apollo/sql/apolloconfigdb.sql",
    "chars": 23201,
    "preview": "--\n-- Copyright 2022 Apollo Authors\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not"
  },
  {
    "path": "apollo/sql/apolloportaldb.sql",
    "chars": 19644,
    "preview": "--\n-- Copyright 2022 Apollo Authors\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not"
  },
  {
    "path": "beanstalkd/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "beanstalkd/README.md",
    "chars": 172,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d beanstalkd\ndocker-compose up -d beanstalkd-console\n```\n\nbeanstalkd 管理界"
  },
  {
    "path": "beanstalkd/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "beanstalkd/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "beanstalkd/docker-compose.yml",
    "chars": 449,
    "preview": "version: \"3\"\nservices:\n  beanstalkd:\n    image: schickling/beanstalkd\n    container_name: beanstalkd\n    ports:\n      - "
  },
  {
    "path": "beanstalkd/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "confluence/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "confluence/README.md",
    "chars": 132,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env # 如有\ndocker-compose up -d xxx\n```\n\n访问: [http://127.0.0.1:80](http://12"
  },
  {
    "path": "confluence/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "confluence/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "confluence/docker-compose.yml",
    "chars": 574,
    "preview": "version: '3'\nservices:\n  confluence:\n    image: cptactionhank/atlassian-confluence:latest\n    container_name: confluence"
  },
  {
    "path": "confluence/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "drawio/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "drawio/Dockerfile",
    "chars": 391,
    "preview": "FROM frekele/ant:1.10.3-jdk8 as BUILD\nRUN apt-get update && \\\n    apt-get install git -y && \\\n    mkdir /usr/build && \\\n"
  },
  {
    "path": "drawio/README.md",
    "chars": 143,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d drawio\n```\n\n构建过程可能比较长,请耐心等待。\n\n访问: [http://127.0.0.1:8080/draw/](http:/"
  },
  {
    "path": "drawio/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "drawio/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "drawio/docker-compose.yml",
    "chars": 132,
    "preview": "version: \"3\"\nservices: \n  drawio:\n    build: \".\"\n    container_name: \"drawio\"\n#    restart: \"always\"\n    ports: \n      -"
  },
  {
    "path": "drawio/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "elk/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "elk/README.md",
    "chars": 313,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\n\n# 修改 docker-compose.yml 文件中的内容,改成你宿主机 IP\nKAFKA_ADVERTISED_LISTENERS: "
  },
  {
    "path": "elk/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "elk/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "elk/docker-compose.yml",
    "chars": 2402,
    "preview": "version: \"3\"\nservices:\n\n  zookeeper:\n    image: wurstmeister/zookeeper\n    container_name: zookeeper\n    ports:\n      - "
  },
  {
    "path": "elk/filebeat/Dockerfile",
    "chars": 179,
    "preview": "FROM docker.elastic.co/beats/filebeat:7.9.2\n\nCOPY filebeat.yml /usr/share/filebeat/filebeat.yml\n\nUSER root\nRUN chown roo"
  },
  {
    "path": "elk/filebeat/filebeat.yml",
    "chars": 9233,
    "preview": "###################### Filebeat Configuration Example #########################\n\n# This file is an example configuration"
  },
  {
    "path": "elk/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "elk/logstash/Dockerfile",
    "chars": 163,
    "preview": "FROM docker.elastic.co/logstash/logstash:7.9.2\n\nRUN rm -f /usr/share/logstash/pipeline/logstash.conf\n\nADD logstash.conf "
  },
  {
    "path": "elk/logstash/logstash.conf",
    "chars": 1807,
    "preview": "input {\n\n  kafka {\n    type => \"nginx-access-log\"\n    bootstrap_servers => \"kafka:9092\"\n    client_id => \"nginx-access-l"
  },
  {
    "path": "example/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "example/README.md",
    "chars": 132,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env # 如有\ndocker-compose up -d xxx\n```\n\n访问: [http://127.0.0.1:80](http://12"
  },
  {
    "path": "example/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "example/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "example/docker-compose.yml",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "example/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "excalidraw/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "excalidraw/README.md",
    "chars": 117,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d excalidraw\n```\n\n访问: [http://127.0.0.1:5000](http://127.0.0.1:5000)\n"
  },
  {
    "path": "excalidraw/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "excalidraw/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "excalidraw/docker-compose.yml",
    "chars": 245,
    "preview": "version: '3'\nservices:\n  excalidraw:\n    image: 'excalidraw/excalidraw:latest'\n    container_name: excalidraw\n#    resta"
  },
  {
    "path": "excalidraw/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "gitlab/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "gitlab/README.md",
    "chars": 244,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d gitlab\n```\n\n访问: [http://127.0.0.1:80](http://127.0.0.1:80) \n\n首次登录使用默认的"
  },
  {
    "path": "gitlab/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "gitlab/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "gitlab/docker-compose.yml",
    "chars": 331,
    "preview": "version: '3'\nservices:\n  gitlab:\n    image: 'gitlab/gitlab-ce:latest'\n    container_name: gitlab\n#    restart: always\n  "
  },
  {
    "path": "gitlab/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jenkins/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "jenkins/README.md",
    "chars": 343,
    "preview": "# example\n\n## Usage\n\n启动容器\n```bash\ndocker-compose up -d jenkins\n```\n\n查看容器日志\n```bash\ndocker logs -f jenkins\n```\n\n访问: [http"
  },
  {
    "path": "jenkins/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "jenkins/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jenkins/docker-compose.yml",
    "chars": 353,
    "preview": "version: '3'\nservices:\n  jenkins:\n    image: 'jenkins/jenkins:lts'\n    container_name: jenkins\n#    restart: always\n    "
  },
  {
    "path": "jenkins/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jira/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "jira/README.md",
    "chars": 144,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env \ndocker-compose up -d jira-mysql jira\n```\n\n访问: [http://127.0.0.1:8081]"
  },
  {
    "path": "jira/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "jira/conf/mysql/my.cnf",
    "chars": 192,
    "preview": "[client]\ndefault-character-set = utf8mb4\n\n[mysql]\ndefault-character-set = utf8mb4\n\n[mysqld]\ncharacter-set-client-handsha"
  },
  {
    "path": "jira/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jira/docker-compose.yml",
    "chars": 1111,
    "preview": "version: '3'\nservices:\n  jira-mysql:\n    image: mysql:5.7\n    container_name: jira-mysql\n    environment:\n      - MYSQL_"
  },
  {
    "path": "jira/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jumpserver/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "jumpserver/README.md",
    "chars": 655,
    "preview": "# example\n\n## Usage\n\n1. 添加配置。\n```bash\ncp .env.example .env\n```\n\n2. 根据实际情况修改 .env 中的配置,主要是 DB_HOST 和 REDIS_HOST 改成自己的 MyS"
  },
  {
    "path": "jumpserver/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "jumpserver/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jumpserver/docker-compose.yml",
    "chars": 4045,
    "preview": "version: '3'\nservices:\n  core:\n    image: jumpserver/core:${Version}\n    container_name: jms-core\n#    restart: always\n "
  },
  {
    "path": "jumpserver/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jumpserver-all-in-one/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "jumpserver-all-in-one/README.md",
    "chars": 132,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env # 如有\ndocker-compose up -d xxx\n```\n\n访问: [http://127.0.0.1:80](http://12"
  },
  {
    "path": "jumpserver-all-in-one/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "jumpserver-all-in-one/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "jumpserver-all-in-one/docker-compose.yml",
    "chars": 2093,
    "preview": "version: '3'\nservices:\n  jumpserver:\n    image: jumpserver/jms_all:latest\n    container_name: jms-all\n#    restart: alwa"
  },
  {
    "path": "jumpserver-all-in-one/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "maxwell/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "maxwell/README.md",
    "chars": 1215,
    "preview": "# example\n\n## Usage\n\n1. 添加配置,启动 mysql 和 redis\n```bash\ncp .env.example .env\ndocker-compose up -d maxwell-mysql maxwell-re"
  },
  {
    "path": "maxwell/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "maxwell/conf/maxwell/config.properties",
    "chars": 12000,
    "preview": "# tl;dr config\nlog_level=info\n\n# mysql login info\nhost=maxwell-mysql\nport=3306\nuser=maxwell\npassword=123456\n\nproducer=re"
  },
  {
    "path": "maxwell/conf/mysql/mysql.cnf",
    "chars": 210,
    "preview": "[mysqld]\nuser=mysql\n\nserver-id=1\nlog-bin=master\nbinlog_format=row\n\nlog-slave-updates=1\ndatadir=/var/lib/mysql/\ninnodb_fl"
  },
  {
    "path": "maxwell/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "maxwell/docker-compose.yml",
    "chars": 841,
    "preview": "version: '3'\nservices:\n  maxwell:\n    image: zendesk/maxwell\n    container_name: maxwell\n    command: bin/maxwell --conf"
  },
  {
    "path": "maxwell/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "mongo/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "mongo/README.md",
    "chars": 375,
    "preview": "# example\n\n## Usage\n\n1. 创建配置,启动容器\n```bash\ncp .env.example .env\ndocker-compose up -d mongodb\n```\n\n2. 进入容器测试\n```bash\ndocke"
  },
  {
    "path": "mongo/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "mongo/conf/mongod.conf",
    "chars": 421,
    "preview": "storage:\n  dbPath: /data/db\n  journal:\n    enabled: true\n  directoryPerDB: true\n  engine: wiredTiger\n  wiredTiger:\n    e"
  },
  {
    "path": "mongo/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "mongo/docker-compose.yml",
    "chars": 402,
    "preview": "version: '3'\nservices:\n  mongodb:\n    image: 'mongo:latest'\n    container_name: mongodb\n    ports:\n      - '${MONGO_PORT"
  },
  {
    "path": "mongo/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "mongo-express/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "mongo-express/README.md",
    "chars": 255,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d mongo\ndocker-compose up -d mongo-express\n```\n\n访问:"
  },
  {
    "path": "mongo-express/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "mongo-express/conf/mongod.conf",
    "chars": 421,
    "preview": "storage:\n  dbPath: /data/db\n  journal:\n    enabled: true\n  directoryPerDB: true\n  engine: wiredTiger\n  wiredTiger:\n    e"
  },
  {
    "path": "mongo-express/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "mongo-express/docker-compose.yml",
    "chars": 1011,
    "preview": "version: '3'\nservices:\n  mongo:\n    image: 'mongo:latest'\n    container_name: mongo\n    ports:\n      - '${MONGO_PORT}:27"
  },
  {
    "path": "mongo-express/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "phpmyadmin/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "phpmyadmin/README.md",
    "chars": 117,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d phpmyadmin\n```\n\n访问: [http://127.0.0.1:8080](http://127.0.0.1:8080)\n"
  },
  {
    "path": "phpmyadmin/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "phpmyadmin/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "phpmyadmin/docker-compose.yml",
    "chars": 245,
    "preview": "version: '3'\nservices:\n  phpmyadmin:\n    image: phpmyadmin:latest\n    container_name: phpmyadmin\n#    restart: always\n  "
  },
  {
    "path": "phpmyadmin/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "prometheus/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "prometheus/README.md",
    "chars": 106,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d\n```\n\n访问: [http://127.0.0.1:9090](http://127.0.0.1:9090)\n"
  },
  {
    "path": "prometheus/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "prometheus/conf/alertmanager/alertmanager.yml",
    "chars": 490,
    "preview": "global:\r\n  resolve_timeout: 5m                               \r\n  smtp_smarthost: 'email-smtp.ap-southeast-1.amazonaws.co"
  },
  {
    "path": "prometheus/conf/prometheus/prometheus.yml",
    "chars": 630,
    "preview": "global:\r\n  scrape_interval:     5s\r\n  evaluation_interval: 5s\r\n\r\n  external_labels:\r\n      monitor: 'dashboard'\r\n\r\nalert"
  },
  {
    "path": "prometheus/conf/prometheus/rules/demo.rules",
    "chars": 402,
    "preview": "groups:\r\n- name: hostStatsAlert\r\n  rules:\r\n  - alert: HostOutOfMemory\r\n    expr: node_memory_MemAvailable_bytes / node_m"
  },
  {
    "path": "prometheus/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "prometheus/docker-compose.yml",
    "chars": 1417,
    "preview": "version: \"3\"\nservices:\n  prometheus:\n    image: prom/prometheus\n    container_name: prometheus\n    user: root\n#    resta"
  },
  {
    "path": "prometheus/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "rabbitmq/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "rabbitmq/README.md",
    "chars": 149,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d\n```\n\n访问: [http://127.0.0.1:15672](http://127.0.0."
  },
  {
    "path": "rabbitmq/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "rabbitmq/conf/rabbitmq.config",
    "chars": 41,
    "preview": "default_user = guest\ndefault_pass = guest"
  },
  {
    "path": "rabbitmq/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "rabbitmq/docker-compose.yml",
    "chars": 407,
    "preview": "version: '3'\nservices:\n  rabbitmq:\n    image: rabbitmq:3.10-management\n    container_name: rabbitmq\n    ports:\n      - '"
  },
  {
    "path": "rabbitmq/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "redis/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "redis/README.md",
    "chars": 195,
    "preview": "# example\n\n## Usage\n\n```bash\ndocker-compose up -d redis\n```\n\n进入容器测试\n```\nroot@ip-10-0-3-22:/redis# docker exec -it redis "
  },
  {
    "path": "redis/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "redis/conf/redis.conf",
    "chars": 61795,
    "preview": "# Redis configuration file example.\n#\n# Note that in order to read the configuration file, Redis must be\n# started with "
  },
  {
    "path": "redis/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "redis/docker-compose.yml",
    "chars": 237,
    "preview": "version: '3'\nservices:\n\n  redis:\n    image: redis\n    container_name: redis\n    command: redis-server /etc/redis/redis.c"
  },
  {
    "path": "redis/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "redis-cluster/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "redis-cluster/README.md",
    "chars": 1770,
    "preview": "# example\n\n搭建1主3从3哨兵的 redis 集群\n\n## Usage\n\n```bash\ncp .env.example .env \ndocker-compose up -d\n```\n\n- test master\n\n```\ndoc"
  },
  {
    "path": "redis-cluster/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "redis-cluster/conf/redis-master.conf",
    "chars": 142,
    "preview": "bind 0.0.0.0\n\nprotected-mode yes\n\nport 6379\n\nalways-show-logo no\n\nrequirepass \"redis\"\n\nrename-command KEYS \"\"\n\ndir \"/dat"
  },
  {
    "path": "redis-cluster/conf/redis-sentinel1.conf",
    "chars": 270,
    "preview": "bind 0.0.0.0\nprotected-mode yes\nport 26379\nsentinel myid 0a353690ac056095f3d33671d3f3b6fd316ec9be\nsentinel deny-scripts-"
  },
  {
    "path": "redis-cluster/conf/redis-sentinel2.conf",
    "chars": 269,
    "preview": "bind 0.0.0.0\nprotected-mode yes\nport 26379\nsentinel myid be47a103d66f41f79c07503db4243f7cf4e2217e\nsentinel deny-scripts-"
  },
  {
    "path": "redis-cluster/conf/redis-sentinel3.conf",
    "chars": 269,
    "preview": "bind 0.0.0.0\nprotected-mode yes\nport 26379\nsentinel myid 6556d69081a155942a3505aaa37f5085acf88fc4\nsentinel deny-scripts-"
  },
  {
    "path": "redis-cluster/conf/redis-slave1.conf",
    "chars": 177,
    "preview": "bind 0.0.0.0\n\nprotected-mode yes\n\nport 6379\n\nalways-show-logo no\n\nrequirepass \"redis\"\n\nrename-command KEYS \"\"\n\nreplicaof"
  },
  {
    "path": "redis-cluster/conf/redis-slave2.conf",
    "chars": 177,
    "preview": "bind 0.0.0.0\n\nprotected-mode yes\n\nport 6379\n\nalways-show-logo no\n\nrequirepass \"redis\"\n\nrename-command KEYS \"\"\n\nreplicaof"
  },
  {
    "path": "redis-cluster/conf/redis-slave3.conf",
    "chars": 177,
    "preview": "bind 0.0.0.0\n\nprotected-mode yes\n\nport 6379\n\nalways-show-logo no\n\nrequirepass \"redis\"\n\nrename-command KEYS \"\"\n\nreplicaof"
  },
  {
    "path": "redis-cluster/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "redis-cluster/docker-compose.yml",
    "chars": 3887,
    "preview": "version: '3'\nservices:\n\n  redis-server-master:\n    image: redis:6.2-alpine\n    container_name: redis-server-master\n    p"
  },
  {
    "path": "redis-cluster/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "wikijs/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "wikijs/README.md",
    "chars": 112,
    "preview": "# wikijs\n\n## Usage\n\n```bash\ndocker-compose up -d db wiki\n```\n\n访问: [http://127.0.0.1:3000](http://127.0.0.1:3000)"
  },
  {
    "path": "wikijs/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "wikijs/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "wikijs/docker-compose.yml",
    "chars": 629,
    "preview": "version: \"3\"\nservices:\n\n  db:\n    image: postgres:11-alpine\n    container_name: wikijs_db\n    environment:\n      POSTGRE"
  },
  {
    "path": "wikijs/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "wordpress/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "wordpress/README.md",
    "chars": 141,
    "preview": "# wordpress\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d mysql wordpress\n```\n\n访问: [http://127.0.0.1:80]("
  },
  {
    "path": "wordpress/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "wordpress/conf/my.cnf",
    "chars": 146,
    "preview": "[mysqld]\nuser=mysql\ndefault-storage-engine=INNODB\ncharacter-set-server=utf8\n[client]\ndefault-character-set=utf8\n[mysql]\n"
  },
  {
    "path": "wordpress/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "wordpress/docker-compose.yml",
    "chars": 693,
    "preview": "version: '3'\nservices:\n  wordpress:\n    image: wordpress\n    container_name: wordpress\n    ports:\n      - \"80:80\"\n    en"
  },
  {
    "path": "wordpress/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "yapi/.gitignore",
    "chars": 4,
    "preview": ".env"
  },
  {
    "path": "yapi/README.md",
    "chars": 179,
    "preview": "# example\n\n## Usage\n\n```bash\ncp .env.example .env\ndocker-compose up -d\n```\n\n访问: [http://127.0.0.1:40001](http://127.0.0."
  },
  {
    "path": "yapi/conf/.gitignore",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "yapi/data/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "yapi/docker-compose.yml",
    "chars": 752,
    "preview": "version: '3'\n\nservices:\n  yapi-web:\n    image: jayfong/yapi:latest\n    container_name: yapi-web\n    ports:\n      - ${YAP"
  },
  {
    "path": "yapi/log/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the FX-Max/docker-install-everything GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 184 files (170.7 KB), approximately 51.7k tokens, and a symbol index with 35 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!