init
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
version: "3"
|
||||
services:
|
||||
nacos1:
|
||||
hostname: nacos1
|
||||
container_name: nacos1
|
||||
image: nacos/nacos-server:latest
|
||||
volumes:
|
||||
- ./cluster-logs/nacos1:/home/nacos/logs
|
||||
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
|
||||
ports:
|
||||
- "8848:8848"
|
||||
- "9555:9555"
|
||||
env_file:
|
||||
- ../env/nacos-hostname.env
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- mysql-master
|
||||
- mysql-slave
|
||||
|
||||
nacos2:
|
||||
hostname: nacos2
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos2
|
||||
volumes:
|
||||
- ./cluster-logs/nacos2:/home/nacos/logs
|
||||
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
|
||||
ports:
|
||||
- "8849:8848"
|
||||
env_file:
|
||||
- ../env/nacos-hostname.env
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- mysql-master
|
||||
- mysql-slave
|
||||
nacos3:
|
||||
hostname: nacos3
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos3
|
||||
volumes:
|
||||
- ./cluster-logs/nacos3:/home/nacos/logs
|
||||
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
|
||||
ports:
|
||||
- "8850:8848"
|
||||
env_file:
|
||||
- ../env/nacos-hostname.env
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- mysql-master
|
||||
- mysql-slave
|
||||
mysql-master:
|
||||
container_name: mysql-master
|
||||
image: nacos/nacos-mysql-master:latest
|
||||
env_file:
|
||||
- ../env/mysql-common.env
|
||||
- ../env/mysql-master.env
|
||||
volumes:
|
||||
- ./mysql-master:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
mysql-slave:
|
||||
container_name: mysql-slave
|
||||
image: nacos/nacos-mysql-slave:latest
|
||||
env_file:
|
||||
- ../env/mysql-common.env
|
||||
- ../env/mysql-slave.env
|
||||
volumes:
|
||||
- ./mysql-slave:/var/lib/mysql
|
||||
ports:
|
||||
- "3305:3306"
|
||||
depends_on:
|
||||
- mysql-master
|
||||
prometheus:
|
||||
container_name: prometheus
|
||||
image: prom/prometheus:latest
|
||||
volumes:
|
||||
- ./prometheus/prometheus-cluster.yaml:/etc/prometheus/prometheus.yml
|
||||
ports:
|
||||
- "9090:9090"
|
||||
depends_on:
|
||||
- nacos1
|
||||
- nacos2
|
||||
- nacos3
|
||||
restart: on-failure
|
||||
grafana:
|
||||
container_name: grafana
|
||||
image: grafana/grafana:latest
|
||||
ports:
|
||||
- 3000:3000
|
||||
restart: on-failure
|
||||
@@ -0,0 +1,87 @@
|
||||
version: "2"
|
||||
services:
|
||||
nacos1:
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos1
|
||||
networks:
|
||||
nacos_net:
|
||||
ipv4_address: 172.16.238.10
|
||||
volumes:
|
||||
- ./cluster-logs/nacos1:/home/nacos/logs
|
||||
ports:
|
||||
- "8848:8848"
|
||||
- "9555:9555"
|
||||
env_file:
|
||||
- ../env/nacos-ip.env
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- mysql-master
|
||||
- mysql-slave
|
||||
|
||||
nacos2:
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos2
|
||||
networks:
|
||||
nacos_net:
|
||||
ipv4_address: 172.16.238.11
|
||||
volumes:
|
||||
- ./cluster-logs/nacos2:/home/nacos/logs
|
||||
ports:
|
||||
- "8849:8848"
|
||||
env_file:
|
||||
- ../env/nacos-ip.env
|
||||
restart: always
|
||||
depends_on:
|
||||
- mysql-master
|
||||
- mysql-slave
|
||||
nacos3:
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos3
|
||||
networks:
|
||||
nacos_net:
|
||||
ipv4_address: 172.16.238.12
|
||||
volumes:
|
||||
- ./cluster-logs/nacos2:/home/nacos/logs
|
||||
ports:
|
||||
- "8850:8848"
|
||||
env_file:
|
||||
- ../env/nacos-ip.env
|
||||
restart: always
|
||||
depends_on:
|
||||
- mysql-master
|
||||
- mysql-slave
|
||||
mysql-master:
|
||||
container_name: mysql-master
|
||||
image: nacos/nacos-mysql-master:latest
|
||||
networks:
|
||||
nacos_net:
|
||||
ipv4_address: 172.16.238.13
|
||||
env_file:
|
||||
- ../env/mysql-common.env
|
||||
- ../env/mysql-master.env
|
||||
volumes:
|
||||
- ./mysql-master:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
mysql-slave:
|
||||
container_name: mysql-slave
|
||||
image: nacos/nacos-mysql-slave:latest
|
||||
networks:
|
||||
nacos_net:
|
||||
ipv4_address: 172.16.238.14
|
||||
env_file:
|
||||
- ../env/mysql-common.env
|
||||
- ../env/mysql-slave.env
|
||||
volumes:
|
||||
- ./mysql-slave:/var/lib/mysql
|
||||
ports:
|
||||
- "3305:3306"
|
||||
depends_on:
|
||||
- mysql-master
|
||||
networks:
|
||||
nacos_net:
|
||||
driver: bridge
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: 172.16.238.0/24
|
||||
@@ -0,0 +1,19 @@
|
||||
#spring.security.enabled=false
|
||||
#management.security=false
|
||||
#security.basic.enabled=false
|
||||
#nacos.security.ignore.urls=/**
|
||||
#management.metrics.export.elastic.host=http://localhost:9200
|
||||
# metrics for prometheus
|
||||
management.endpoints.web.exposure.include=*
|
||||
|
||||
# metrics for elastic search
|
||||
#management.metrics.export.elastic.enabled=false
|
||||
#management.metrics.export.elastic.host=http://localhost:9200
|
||||
|
||||
# metrics for influx
|
||||
#management.metrics.export.influx.enabled=false
|
||||
#management.metrics.export.influx.db=springboot
|
||||
#management.metrics.export.influx.uri=http://localhost:8086
|
||||
#management.metrics.export.influx.auto-create-db=true
|
||||
#management.metrics.export.influx.consistency=one
|
||||
#management.metrics.export.influx.compressed=true
|
||||
@@ -0,0 +1,34 @@
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# Alertmanager configuration
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets:
|
||||
# - alertmanager:9093
|
||||
|
||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||
rule_files:
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'prometheus'
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'nacos'
|
||||
metrics_path: '/nacos/actuator/prometheus'
|
||||
static_configs:
|
||||
- targets: ["nacos1:8848","nacos2:8848","nacos3:8848"]
|
||||
@@ -0,0 +1,34 @@
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# Alertmanager configuration
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets:
|
||||
# - alertmanager:9093
|
||||
|
||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||
rule_files:
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'prometheus'
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'nacos'
|
||||
metrics_path: '/nacos/actuator/prometheus'
|
||||
static_configs:
|
||||
- targets: ['nacos:8848']
|
||||
@@ -0,0 +1,29 @@
|
||||
version: "2"
|
||||
services:
|
||||
nacos:
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos-standalone
|
||||
environment:
|
||||
- PREFER_HOST_MODE=hostname
|
||||
- MODE=standalone
|
||||
volumes:
|
||||
- ./standalone-logs/:/home/nacos/logs
|
||||
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
|
||||
ports:
|
||||
- "8848:8848"
|
||||
prometheus:
|
||||
container_name: prometheus
|
||||
image: prom/prometheus:latest
|
||||
volumes:
|
||||
- ./prometheus/prometheus-standalone.yaml:/etc/prometheus/prometheus.yml
|
||||
ports:
|
||||
- "9090:9090"
|
||||
depends_on:
|
||||
- nacos
|
||||
restart: on-failure
|
||||
grafana:
|
||||
container_name: grafana
|
||||
image: grafana/grafana:latest
|
||||
ports:
|
||||
- 3000:3000
|
||||
restart: on-failure
|
||||
@@ -0,0 +1,64 @@
|
||||
version: "2"
|
||||
services:
|
||||
nacos:
|
||||
image: nacos/nacos-server:latest
|
||||
container_name: nacos-standalone-mysql
|
||||
environment:
|
||||
- PREFER_HOST_MODE=hostname
|
||||
- MODE=standalone
|
||||
- SPRING_DATASOURCE_PLATFORM=mysql
|
||||
- MYSQL_MASTER_SERVICE_HOST=mysql-master
|
||||
- MYSQL_MASTER_SERVICE_DB_NAME=nacos_devtest
|
||||
- MYSQL_MASTER_SERVICE_PORT=3306
|
||||
- MYSQL_SLAVE_SERVICE_HOST=mysql-slave
|
||||
- MYSQL_SLAVE_SERVICE_PORT=3306
|
||||
- MYSQL_MASTER_SERVICE_USER=nacos
|
||||
- MYSQL_MASTER_SERVICE_PASSWORD=nacos
|
||||
volumes:
|
||||
- ./standalone-logs/:/home/nacos/logs
|
||||
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
|
||||
ports:
|
||||
- "8848:8848"
|
||||
- "9555:9555"
|
||||
depends_on:
|
||||
- mysql-slave
|
||||
restart: on-failure
|
||||
mysql-master:
|
||||
container_name: mysql-master
|
||||
image: nacos/nacos-mysql-master:latest
|
||||
env_file:
|
||||
- ../env/mysql-common.env
|
||||
- ../env/mysql-master.env
|
||||
volumes:
|
||||
- ./mysql-master:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
mysql-slave:
|
||||
container_name: mysql-slave
|
||||
image: nacos/nacos-mysql-slave:latest
|
||||
env_file:
|
||||
- ../env/mysql-common.env
|
||||
- ../env/mysql-slave.env
|
||||
volumes:
|
||||
- ./mysql-slave:/var/lib/mysql
|
||||
ports:
|
||||
- "3305:3306"
|
||||
depends_on:
|
||||
- mysql-master
|
||||
prometheus:
|
||||
container_name: prometheus
|
||||
image: prom/prometheus:latest
|
||||
volumes:
|
||||
- ./prometheus/prometheus-standalone.yaml:/etc/prometheus/prometheus.yml
|
||||
ports:
|
||||
- "9090:9090"
|
||||
depends_on:
|
||||
- nacos
|
||||
restart: on-failure
|
||||
grafana:
|
||||
container_name: grafana
|
||||
image: grafana/grafana:latest
|
||||
ports:
|
||||
- 3000:3000
|
||||
restart: on-failure
|
||||
|
||||
Reference in New Issue
Block a user