Initial project source

这个提交包含在:
apple
2026-11-20 15:32:57 +08:00
当前提交 fb47c07f7c
共修改 8405 个文件,包含 806907 行新增和 0 行删除
+94
查看文件
@@ -0,0 +1,94 @@
#!/usr/bin/env bash
set -euo pipefail
MYSQL_CONTAINER="${AIXUN_MYSQL_CONTAINER:-aixun-admin-mysql}"
REDIS_CONTAINER="${AIXUN_REDIS_CONTAINER:-aixun-admin-redis}"
MYSQL_PASSWORD="${AIXUN_MYSQL_PASSWORD:-aixun123}"
REDIS_PASSWORD="${AIXUN_REDIS_PASSWORD:-aixun123}"
require_command() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "缺少必需命令:$1" >&2
exit 1
fi
}
require_command docker
require_command grep
require_command od
require_command tr
mysql_scan_result="$(
docker exec -i -e MYSQL_PWD="${MYSQL_PASSWORD}" "${MYSQL_CONTAINER}" \
mysql --default-character-set=utf8mb4 -uroot -N -B <<'SQL'
SET SESSION group_concat_max_len = 16777216;
SELECT GROUP_CONCAT(
CONCAT(
'SELECT ', QUOTE(TABLE_SCHEMA), ' AS db_name, ',
QUOTE(TABLE_NAME), ' AS table_name, ',
QUOTE(COLUMN_NAME), ' AS column_name, COUNT(*) AS bad_rows FROM `',
REPLACE(TABLE_SCHEMA, '`', '``'), '`.`',
REPLACE(TABLE_NAME, '`', '``'), '` WHERE LOCATE(',
'CONVERT(0xEFBFBD USING utf8mb4), `',
REPLACE(COLUMN_NAME, '`', '``'), '`) > 0 OR ',
'CONVERT(CAST(CONVERT(`', REPLACE(COLUMN_NAME, '`', '``'),
'` USING latin1) AS BINARY) USING utf8mb4) REGEXP ''[一-龥]'' ',
'HAVING bad_rows > 0'
)
SEPARATOR ' UNION ALL '
) INTO @scan_sql
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA IN ('aixun_admin', 'aixun_workflow')
AND DATA_TYPE IN (
'char', 'varchar', 'tinytext', 'text', 'mediumtext', 'longtext',
'enum', 'set', 'json'
);
SET @scan_sql = COALESCE(
@scan_sql,
'SELECT NULL AS db_name, NULL AS table_name, NULL AS column_name, 0 AS bad_rows WHERE 1=0'
);
PREPARE scan_stmt FROM @scan_sql;
EXECUTE scan_stmt;
DEALLOCATE PREPARE scan_stmt;
SQL
)"
if [ -n "${mysql_scan_result}" ]; then
echo "MySQL 全库 UTF-8 验收失败,以下文本字段含替换字符或可还原为中文的 Latin-1/UTF-8 乱码:" >&2
printf '%s\n' "${mysql_scan_result}" >&2
exit 1
fi
redis_bad_count=0
while IFS= read -r cache_key; do
if [ -z "${cache_key}" ]; then
continue
fi
if docker exec "${REDIS_CONTAINER}" redis-cli \
-a "${REDIS_PASSWORD}" --no-auth-warning --raw DUMP "${cache_key}" 2>/dev/null |
od -An -v -tx1 |
tr -d ' \n' |
grep -Eq 'efbfbd|c3(82|83)(c2|c3)|c3(a2|a4|a5|a6|a7|a8|a9|af)(c2|c3|e2|ef)|c3b0c5b8'; then
redis_bad_count=$((redis_bad_count + 1))
case "${cache_key}" in
Authorization:*|online_tokens:*)
echo "Redis UTF-8 验收失败:发现含乱码的登录态缓存(键名已隐藏)。" >&2
;;
*)
echo "Redis UTF-8 验收失败:${cache_key}" >&2
;;
esac
fi
done < <(
docker exec "${REDIS_CONTAINER}" redis-cli \
-a "${REDIS_PASSWORD}" --no-auth-warning --raw --scan
)
if [ "${redis_bad_count}" -ne 0 ]; then
echo "Redis 中共有 ${redis_bad_count} 个键未通过 UTF-8 验收。" >&2
exit 1
fi
echo "UTF-8 全量验收通过:MySQL 两个数据库的全部文本字段与 Redis 全部当前键均未发现乱码。"
+43
查看文件
@@ -0,0 +1,43 @@
services:
# 此镜像仅用于测试 正式环境需自行安装数据库
# SID: XE user: system password: oracle
oracle:
image: tekintian/oracle12c:latest
container_name: oracle
environment:
# 时区上海
TZ: Asia/Shanghai
DBCA_TOTAL_MEMORY: 16192
ports:
- "18080:8080"
- "1521:1521"
volumes:
# 数据挂载
- "/docker/oracle/data:/u01/app/oracle"
network_mode: "host"
postgres:
image: postgres:14.2
container_name: postgres
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- /docker/postgres/data:/var/lib/postgresql/data
network_mode: "host"
postgres13:
image: postgres:13.6
container_name: postgres13
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: postgres
ports:
- "5433:5432"
volumes:
- /docker/postgres13/data:/var/lib/postgresql/data
network_mode: "host"
+227
查看文件
@@ -0,0 +1,227 @@
name: aixun-admin-local
services:
frontend:
build:
context: ../../aixun-ui
image: aixun-admin/aixun-admin-ui:1.0.0
container_name: aixun-admin-ui
mem_limit: 128m
ports:
- "80:80"
depends_on:
gateway:
condition: service_started
mysql:
image: mysql:8.4.9
container_name: aixun-admin-mysql
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: aixun123
MYSQL_DATABASE: aixun_admin
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --lower-case-table-names=1
ports:
- "13306:3306"
volumes:
- aixun-admin-mysql-data:/var/lib/mysql
- ./mysql/conf.d/aixun.cnf:/etc/mysql/conf.d/aixun.cnf:ro
- ../sql/aixun_cloud.sql:/docker-entrypoint-initdb.d/01-aixun-cloud.sql:ro
- ../sql/aixun_workflow.sql:/docker-entrypoint-initdb.d/02-aixun-workflow.sql:ro
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-paixun123"]
interval: 5s
timeout: 5s
retries: 30
redis:
image: redis:8.6.3
container_name: aixun-admin-redis
command: ["redis-server", "--appendonly", "yes", "--requirepass", "aixun123"]
ports:
- "6379:6379"
volumes:
- aixun-admin-redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "aixun123", "ping"]
interval: 5s
timeout: 5s
retries: 30
nacos:
image: nacos/nacos-server:v3.2.3
container_name: aixun-admin-nacos
environment:
TZ: Asia/Shanghai
MODE: standalone
PREFER_HOST_MODE: hostname
JVM_XMS: 256m
JVM_XMX: 512m
NACOS_AUTH_ENABLE: "true"
NACOS_AUTH_ADMIN_ENABLE: "true"
NACOS_AUTH_CONSOLE_ENABLE: "true"
NACOS_AUTH_TOKEN: rE7bYayhpvduYwCxuhckybEPDXyna6xwm5m7MZjtjrdXjVxAbXAMccXHyaJvB346
NACOS_AUTH_IDENTITY_KEY: aixun-admin-key
NACOS_AUTH_IDENTITY_VALUE: aixun-admin-value
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
- "18080:8080"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:8080/ >/dev/null || exit 1"]
interval: 5s
timeout: 5s
retries: 60
gateway:
build:
context: ../../aixun-gateway
image: aixun-admin/aixun-admin-gateway:1.0.0
container_name: aixun-admin-gateway
mem_limit: 768m
environment: &app-environment
TZ: Asia/Shanghai
SPRING_CLOUD_NACOS_SERVER_ADDR: nacos:8848
SPRING_CLOUD_NACOS_USERNAME: nacos
SPRING_CLOUD_NACOS_PASSWORD: AixunNacos2026!
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PASSWORD: aixun123
MYSQL_HOST: mysql
MYSQL_PORT: "3306"
MYSQL_USERNAME: root
MYSQL_PASSWORD: aixun123
SPRING_CLOUD_BUS_ENABLED: "false"
JAVA_GC_OPTS: -XX:+UseSerialGC
JAVA_OPTS: -Xms128m -Xmx384m -XX:MaxMetaspaceSize=192m -XX:MaxDirectMemorySize=96m -XX:ReservedCodeCacheSize=64m -Xss512k
ports:
- "8080:8080"
depends_on:
nacos:
condition: service_healthy
redis:
condition: service_healthy
auth:
build:
context: ../../aixun-auth
image: aixun-admin/aixun-admin-auth:1.0.0
container_name: aixun-admin-auth
mem_limit: 896m
environment:
<<: *app-environment
JAVA_OPTS: -Xms128m -Xmx448m -XX:MaxMetaspaceSize=224m -XX:MaxDirectMemorySize=96m -XX:ReservedCodeCacheSize=64m -Xss512k
SECURITY_CAPTCHA_ENABLED: "false"
ports:
- "9210:9210"
depends_on:
nacos:
condition: service_healthy
redis:
condition: service_healthy
system:
build:
context: ../../aixun-modules/aixun-system
image: aixun-admin/aixun-admin-system:1.0.0
container_name: aixun-admin-system
mem_limit: 1280m
environment:
<<: *app-environment
JAVA_OPTS: -Xms192m -Xmx640m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=128m -XX:ReservedCodeCacheSize=96m -Xss512k
ports:
- "9201:9201"
depends_on:
mysql:
condition: service_healthy
nacos:
condition: service_healthy
redis:
condition: service_healthy
gen:
build:
context: ../../aixun-modules/aixun-gen
image: aixun-admin/aixun-admin-gen:1.0.0
container_name: aixun-admin-gen
mem_limit: 768m
environment:
<<: *app-environment
JAVA_GC_OPTS: -XX:+UseSerialGC
JAVA_OPTS: -Xms96m -Xmx320m -XX:MaxMetaspaceSize=208m -XX:MaxDirectMemorySize=64m -XX:ReservedCodeCacheSize=64m -Xss512k
ports:
- "9202:9202"
depends_on:
mysql:
condition: service_healthy
nacos:
condition: service_healthy
redis:
condition: service_healthy
resource:
build:
context: ../../aixun-modules/aixun-resource
image: aixun-admin/aixun-admin-resource:1.0.0
container_name: aixun-admin-resource
mem_limit: 896m
environment:
<<: *app-environment
JAVA_GC_OPTS: -XX:+UseSerialGC
JAVA_OPTS: -Xms96m -Xmx384m -XX:MaxMetaspaceSize=224m -XX:MaxDirectMemorySize=96m -XX:ReservedCodeCacheSize=64m -Xss512k
ports:
- "9204:9204"
depends_on:
mysql:
condition: service_healthy
nacos:
condition: service_healthy
redis:
condition: service_healthy
workflow:
build:
context: ../../aixun-modules/aixun-workflow
image: aixun-admin/aixun-admin-workflow:1.0.0
container_name: aixun-admin-workflow
mem_limit: 1152m
environment:
<<: *app-environment
JAVA_GC_OPTS: -XX:+UseSerialGC
JAVA_OPTS: -Xms128m -Xmx512m -XX:MaxMetaspaceSize=288m -XX:MaxDirectMemorySize=96m -XX:ReservedCodeCacheSize=96m -Xss512k
ports:
- "9205:9205"
depends_on:
mysql:
condition: service_healthy
nacos:
condition: service_healthy
redis:
condition: service_healthy
demo:
build:
context: ../../aixun-example/aixun-demo
image: aixun-admin/aixun-admin-demo:1.0.0
container_name: aixun-admin-demo
mem_limit: 896m
environment:
<<: *app-environment
JAVA_GC_OPTS: -XX:+UseSerialGC
JAVA_OPTS: -Xms96m -Xmx384m -XX:MaxMetaspaceSize=224m -XX:MaxDirectMemorySize=96m -XX:ReservedCodeCacheSize=64m -Xss512k
ports:
- "9401:9401"
depends_on:
mysql:
condition: service_healthy
nacos:
condition: service_healthy
redis:
condition: service_healthy
volumes:
aixun-admin-mysql-data:
aixun-admin-redis-data:
+449
查看文件
@@ -0,0 +1,449 @@
services:
mysql:
image: mysql:8.4.9
container_name: mysql
environment:
# 时区上海
TZ: Asia/Shanghai
# root 密码
MYSQL_ROOT_PASSWORD: aixun123
# 初始化数据库
MYSQL_DATABASE: aixun_admin
ports:
- "3306:3306"
volumes:
# 数据挂载
- /docker/mysql/data/:/var/lib/mysql/
# 配置挂载
- /docker/mysql/conf/:/etc/mysql/conf.d/
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
privileged: true
network_mode: "host"
nacos:
image: nacos/nacos-server:v3.2.3
container_name: nacos
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
- "18080:18080"
environment:
TZ: Asia/Shanghai
MODE: standalone
PREFER_HOST_MODE: hostname
JVM_XMS: 256m
JVM_XMX: 512m
# 认证相关密钥 自行替换
NACOS_AUTH_TOKEN: rE7bYayhpvduYwCxuhckybEPDXyna6xwm5m7MZjtjrdXjVxAbXAMccXHyaJvB346
NACOS_AUTH_IDENTITY_KEY: aixun-admin-key
NACOS_AUTH_IDENTITY_VALUE: aixun-admin-value
volumes:
- /docker/nacos/logs/:/home/nacos/logs
# 默认单机模式 使用 mysql 等按 nacos 文档在配置文件内修改 所有配置均可在配置文件修改
- /docker/nacos/conf/application.properties:/home/nacos/conf/application.properties
network_mode: "host"
redis:
image: redis:8.6.3
container_name: redis
ports:
- "6379:6379"
environment:
# 时区上海
TZ: Asia/Shanghai
volumes:
# 配置文件
- /docker/redis/conf:/redis/config
# 数据文件
- /docker/redis/data/:/redis/data/
command: "redis-server /redis/config/redis.conf"
privileged: true
network_mode: "host"
minio:
# pgsty 开源社区 fork 重新维护的最新版 minio
image: pgsty/minio:RELEASE.2026-04-17T00-00-00Z
container_name: minio
ports:
# api 端口
- "9000:9000"
# 控制台端口
- "9001:9001"
environment:
# 时区上海
TZ: Asia/Shanghai
# 管理后台用户名
MINIO_ROOT_USER: aixun
# 管理后台密码,最小8个字符
MINIO_ROOT_PASSWORD: aixun123
# https需要指定域名
#MINIO_SERVER_URL: "https://xxx.com:9000"
#MINIO_BROWSER_REDIRECT_URL: "https://xxx.com:9001"
# 开启压缩 on 开启 off 关闭
MINIO_COMPRESS: "off"
# 扩展名 .pdf,.doc 为空 所有类型均压缩
MINIO_COMPRESS_EXTENSIONS: ""
# mime 类型 application/pdf 为空 所有类型均压缩
MINIO_COMPRESS_MIME_TYPES: ""
volumes:
# 映射当前目录下的data目录至容器内/data目录
- /docker/minio/data:/data
# 映射配置目录
- /docker/minio/config:/root/.minio/
command: server --address ':9000' --console-address ':9001' /data # 指定容器中的目录 /data
privileged: true
network_mode: "host"
seata-server:
image: apache/seata-server:2.6.0
container_name: seata-server
ports:
- "7091:7091"
- "8091:8091"
environment:
TZ: Asia/Shanghai
# 注意 此处ip如果是外网使用 要改为外网ip
# SEATA_IP: 127.0.0.1
SEATA_PORT: 8091
volumes:
- /docker/seata/conf/application.yml:/seata-server/resources/application.yml
- /docker/seata/logs/:/root/logs/seata
privileged: true
network_mode: "host"
nginx-web:
image: nginx:1.31.1
container_name: nginx-web
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "80:80"
- "443:443"
volumes:
# 证书映射
- /docker/nginx/cert:/etc/nginx/cert
# 配置文件映射
- /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
# 页面目录
- /docker/nginx/html:/usr/share/nginx/html
# 日志目录
- /docker/nginx/log:/var/log/nginx
privileged: true
network_mode: "host"
aixun-admin-gateway:
image: aixun-admin/aixun-admin-gateway:1.0.0
container_name: aixun-admin-gateway
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "8080:8080"
volumes:
# 配置文件
- /docker/aixun-admin-gateway/logs/:/aixun-admin/gateway/logs
# skywalking 探针
- /docker/skywalking/agent/:/aixun-admin/skywalking/agent
privileged: true
network_mode: "host"
aixun-admin-auth:
image: aixun-admin/aixun-admin-auth:1.0.0
container_name: aixun-admin-auth
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "9210:9210"
volumes:
# 配置文件
- /docker/aixun-admin-auth/logs/:/aixun-admin/auth/logs
# skywalking 探针
- /docker/skywalking/agent/:/aixun-admin/skywalking/agent
privileged: true
network_mode: "host"
aixun-admin-system:
image: aixun-admin/aixun-admin-system:1.0.0
container_name: aixun-admin-system
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "9201:9201"
volumes:
# 配置文件
- /docker/aixun-admin-system/logs/:/aixun-admin/system/logs
# skywalking 探针
- /docker/skywalking/agent/:/aixun-admin/skywalking/agent
privileged: true
network_mode: "host"
aixun-admin-gen:
image: aixun-admin/aixun-admin-gen:1.0.0
container_name: aixun-admin-gen
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "9202:9202"
volumes:
# 配置文件
- /docker/aixun-admin-gen/logs/:/aixun-admin/gen/logs
# skywalking 探针
- /docker/skywalking/agent/:/aixun-admin/skywalking/agent
privileged: true
network_mode: "host"
aixun-admin-resource:
image: aixun-admin/aixun-admin-resource:1.0.0
container_name: aixun-admin-resource
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "9204:9204"
volumes:
# 配置文件
- /docker/aixun-admin-resource/logs/:/aixun-admin/resource/logs
# skywalking 探针
- /docker/skywalking/agent/:/aixun-admin/skywalking/agent
privileged: true
network_mode: "host"
aixun-admin-workflow:
image: aixun-admin/aixun-admin-workflow:1.0.0
container_name: aixun-admin-workflow
environment:
# 时区上海
TZ: Asia/Shanghai
ports:
- "9205:9205"
volumes:
# 配置文件
- /docker/aixun-admin-workflow/logs/:/aixun-admin/workflow/logs
# skywalking 探针
- /docker/skywalking/agent/:/aixun-admin/skywalking/agent
privileged: true
network_mode: "host"
#################################################################################################
#################################### 以下为扩展根据需求搭建 #########################################
#################################################################################################
elasticsearch:
image: elasticsearch:8.19.16
container_name: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
environment:
# 时区上海
TZ: Asia/Shanghai
# 设置集群名称
cluster.name: elasticsearch
# 以单一节点模式启动
discovery.type: single-node
# 默认关闭认证 便于本地联调; 如开启 xpack.security.enabled 需手动初始化 Kibana/Logstash/SkyWalking 账号密码
xpack.security.enabled: "false"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
volumes:
- /docker/elk/elasticsearch/plugins:/usr/share/elasticsearch/plugins
- /docker/elk/elasticsearch/data:/usr/share/elasticsearch/data
- /docker/elk/elasticsearch/logs:/usr/share/elasticsearch/logs
network_mode: "host"
kibana:
image: kibana:8.19.16
container_name: kibana
ports:
- "5601:5601"
depends_on:
# kibana在elasticsearch启动之后再启动
- elasticsearch
environment:
# 时区上海
TZ: Asia/Shanghai
#设置系统语言文中文
I18N_LOCALE: zh-CN
# 访问域名
# SERVER_PUBLICBASEURL: https://kibana.cloud.com
volumes:
- /docker/elk/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml
network_mode: "host"
logstash:
image: logstash:8.19.16
container_name: logstash
ports:
- "4560:4560"
environment:
# 时区上海
TZ: Asia/Shanghai
volumes:
- /docker/elk/logstash/pipeline/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
- /docker/elk/logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
depends_on:
- elasticsearch
network_mode: "host"
rmqnamesrv:
image: apache/rocketmq:5.5.0
container_name: rmqnamesrv
ports:
- "9876:9876"
environment:
JAVA_OPT: -server -Xms512m -Xmx512m
command: sh mqnamesrv
volumes:
- /docker/rocketmq/namesrv/logs:/home/rocketmq/logs/rocketmqlogs
network_mode: "host"
rmqbroker1:
image: apache/rocketmq:5.5.0
container_name: rmqbroker1
ports:
- "10911:10911"
- "10909:10909"
- "10912:10912"
environment:
JAVA_OPT: -server -Xms512M -Xmx512M
NAMESRV_ADDR: 127.0.0.1:9876
# --enable-proxy 开启broker与proxy共用模式 生产部署建议将proxy单独部署
command: sh mqbroker --enable-proxy -c /home/rocketmq/rocketmq-5.5.0/conf/broker.conf
depends_on:
- rmqnamesrv
volumes:
- /docker/rocketmq/broker1/conf/broker.conf:/home/rocketmq/rocketmq-5.5.0/conf/broker.conf
- /docker/rocketmq/broker1/logs:/home/rocketmq/logs/rocketmqlogs
- /docker/rocketmq/broker1/store:/home/rocketmq/store
privileged: true
network_mode: "host"
rmqconsole:
image: apacherocketmq/rocketmq-dashboard:latest
container_name: rmqconsole
ports:
- "19876:19876"
environment:
JAVA_OPTS: -Dserver.port=19876 -Drocketmq.namesrv.addr=127.0.0.1:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false
depends_on:
- rmqnamesrv
network_mode: "host"
rabbitmq:
container_name: rabbitmq
build:
context: ./rabbitmq
environment:
RABBITMQ_DEFAULT_USER: aixun
RABBITMQ_DEFAULT_PASS: aixun123
ports:
- "15672:15672" # 管理界面端口
- "5672:5672" # api 端口
volumes:
- /docker/rabbitmq/log:/var/log/rabbitmq
- /docker/rabbitmq/data:/var/lib/rabbitmq
network_mode: "host"
kafka:
image: apache/kafka:4.3.0
container_name: kafka
ports:
- "9092:9092"
- "9093:9093"
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
# 监听端口
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
# 实际访问ip 本地用 127 内网用 192 外网用 外网ip
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.31.165:9092
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /var/lib/kafka/data
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_LOG_RETENTION_HOURS: 168
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
CLUSTER_ID: "Mk3OEYBSD34fcwNTJENDM2Qk" # 使用 kafka-storage.sh random-uuid 生成
volumes:
- /docker/kafka/data:/var/lib/kafka/data
network_mode: "host"
sky-oap:
image: apache/skywalking-oap-server:10.4.0
container_name: sky-oap
ports:
- "11800:11800"
- "12800:12800"
environment:
JAVA_OPTS: -Xms1G -Xmx2G
#记录数据的有效期,单位天
SW_CORE_RECORD_DATA_TTL: 7
#分析指标数据的有效期,单位天
SW_CORE_METRICS_DATA_TTL: 7
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: 127.0.0.1:9200
TZ: Asia/Shanghai
network_mode: "host"
sky-ui:
image: apache/skywalking-ui:10.4.0
container_name: sky-ui
ports:
- "18080:18080"
environment:
SW_SERVER_PORT: 18080
SW_OAP_ADDRESS: http://127.0.0.1:12800
TZ: Asia/Shanghai
depends_on:
- sky-oap
network_mode: "host"
prometheus:
image: prom/prometheus:v3.12.0
container_name: prometheus
ports:
- "9090:9090"
volumes:
- /docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
network_mode: "host"
grafana:
image: grafana/grafana:13.0.2
container_name: grafana
environment:
TZ: Asia/Shanghai
# 服务地址 用于指定外网ip或域名
GF_SERVER_ROOT_URL: ""
# admin 管理员密码
GF_SECURITY_ADMIN_PASSWORD: 123456
ports:
- "3000:3000"
volumes:
- /docker/grafana/grafana.ini:/etc/grafana/grafana.ini
- /docker/grafana:/var/lib/grafana
network_mode: "host"
shardingproxy:
image: apache/shardingsphere-proxy:5.4.0
container_name: shardingsphere-proxy
command: server /data
ports:
- "3307:3307"
volumes:
- /docker/shardingproxy/conf:/opt/shardingsphere-proxy/conf
- /docker/shardingproxy/ext-lib:/opt/shardingsphere-proxy/ext-lib
environment:
- JVM_OPTS="-Djava.awt.headless=true"
network_mode: "host"
@@ -0,0 +1 @@
数据目录 请执行 `chmod 777 /docker/elk/elasticsearch/data` 赋予读写权限 否则将无法写入数据
@@ -0,0 +1 @@
日志目录 请执行 `chmod 777 /docker/elk/elasticsearch/logs` 赋予读写权限 否则将无法写入数据
@@ -0,0 +1,10 @@
# Elasticsearch plugins
Elasticsearch plugins must match the exact Elasticsearch version.
The Docker Compose file mounts `/docker/elk/elasticsearch/plugins`
for Elasticsearch 8.19.16. Do not reuse a 7.x plugin directory with 8.x,
otherwise Elasticsearch will fail during startup.
If IK analysis is required, install an IK package built for Elasticsearch
8.19.16 into that host directory.
@@ -0,0 +1,4 @@
server.host: "0.0.0.0"
server.shutdownTimeout: "5s"
elasticsearch.hosts: [ "http://127.0.0.1:9200" ]
monitoring.ui.container.elasticsearch.enabled: true
@@ -0,0 +1,2 @@
http.host: "0.0.0.0"
xpack.monitoring.elasticsearch.hosts: [ "http://127.0.0.1:9200" ]
@@ -0,0 +1,14 @@
input {
tcp {
mode => "server"
host => "0.0.0.0"
port => 4560
codec => json_lines
}
}
output {
elasticsearch {
hosts => [ "http://127.0.0.1:9200" ]
index => "%{[spring.application.name]}-%{+YYYY.MM.dd}"
}
}
+1
查看文件
@@ -0,0 +1 @@
数据目录 请执行 `chmod 777 /docker/grafana` 赋予读写权限 否则将无法写入数据
+849
查看文件
@@ -0,0 +1,849 @@
##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to
# change
# possible values : production, development
;app_mode = production
# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
;instance_name = ${HOSTNAME}
#################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
;data = /var/lib/grafana
# Temporary files in `data` directory older than given duration will be removed
;temp_data_lifetime = 24h
# Directory where grafana can store logs
;logs = /var/log/grafana
# Directory where grafana will automatically scan and look for plugins
;plugins = /var/lib/grafana/plugins
# folder that contains provisioning config files that grafana will apply on startup and while running.
;provisioning = conf/provisioning
#################################### Server ####################################
[server]
# Protocol (http, https, h2, socket)
;protocol = http
# The ip address to bind to, empty will bind to all interfaces
;http_addr =
# The http port to use
;http_port = 3000
# The public facing domain name used to access grafana from a browser
;domain = localhost
# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false
# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = %(protocol)s://%(domain)s:%(http_port)s/
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false
# Log web requests
;router_logging = false
# the path relative working path
;static_root_path = public
# enable gzip
;enable_gzip = false
# https certs & key file
;cert_file =
;cert_key =
# Unix socket path
;socket =
#################################### Database ####################################
[database]
# You can configure the database connection by specifying type, host, name, user and password
# as separate properties or as on string using the url properties.
# Either "mysql", "postgres" or "sqlite3", it's your choice
;type = sqlite3
;host = 127.0.0.1:3306
;name = grafana
;user = root
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
;password =
# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
;url =
# For "postgres" only, either "disable", "require" or "verify-full"
;ssl_mode = disable
;ca_cert_path =
;client_key_path =
;client_cert_path =
;server_cert_name =
# For "sqlite3" only, path relative to data_path setting
;path = grafana.db
# Max idle conn setting default is 2
;max_idle_conn = 2
# Max conn setting default is 0 (mean not set)
;max_open_conn =
# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours)
;conn_max_lifetime = 14400
# Set to true to log the sql calls and execution times.
;log_queries =
# For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared)
;cache_mode = private
#################################### Cache server #############################
[remote_cache]
# Either "redis", "memcached" or "database" default is "database"
;type = database
# cache connectionstring options
# database: will use Grafana primary database.
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false`. Only addr is required. ssl may be 'true', 'false', or 'insecure'.
# memcache: 127.0.0.1:11211
;connstr =
#################################### Data proxy ###########################
[dataproxy]
# This enables data proxy logging, default is false
;logging = false
# How long the data proxy waits before timing out, default is 30 seconds.
# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
;timeout = 30
# How many seconds the data proxy waits before sending a keepalive probe request.
;keep_alive_seconds = 30
# How many seconds the data proxy waits for a successful TLS Handshake before timing out.
;tls_handshake_timeout_seconds = 10
# How many seconds the data proxy will wait for a server's first response headers after
# fully writing the request headers if the request has an "Expect: 100-continue"
# header. A value of 0 will result in the body being sent immediately, without
# waiting for the server to approve.
;expect_continue_timeout_seconds = 1
# The maximum number of idle connections that Grafana will keep alive.
;max_idle_connections = 100
# How many seconds the data proxy keeps an idle connection open before timing out.
;idle_conn_timeout_seconds = 90
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
;send_user_header = false
#################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
# No ip addresses are being tracked, only simple counters to track
# running instances, dashboard and error counts. It is very helpful to us.
# Change this option to false to disable reporting.
;reporting_enabled = true
# Set to false to disable all checks to https://grafana.net
# for new versions (grafana itself and plugins), check is used
# in some UI views to notify that grafana or plugin update exists
# This option does not cause any auto updates, nor send any information
# only a GET request to http://grafana.com to get latest versions
;check_for_updates = true
# Google Analytics universal tracking code, only enabled if you specify an id here
;google_analytics_ua_id =
# Google Tag Manager ID, only enabled if you specify an id here
;google_tag_manager_id =
#################################### Security ####################################
[security]
# disable creation of admin user on first start of grafana
;disable_initial_admin_creation = false
# default admin user, created on startup
;admin_user = admin
# default admin password, can be changed before first start of grafana, or in profile settings
;admin_password = admin
# used for signing
;secret_key = SW2YcwTIb9zpOOhoPsMm
# disable gravatar profile images
;disable_gravatar = false
# data source proxy whitelist (ip_or_domain:port separated by spaces)
;data_source_proxy_whitelist =
# disable protection against brute force login attempts
;disable_brute_force_login_protection = false
# set to true if you host Grafana behind HTTPS. default is false.
;cookie_secure = false
# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
;cookie_samesite = lax
# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
;allow_embedding = false
# Set to true if you want to enable http strict transport security (HSTS) response header.
# This is only sent when HTTPS is enabled in this configuration.
# HSTS tells browsers that the site should only be accessed using HTTPS.
;strict_transport_security = false
# Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled.
;strict_transport_security_max_age_seconds = 86400
# Set to true if to enable HSTS preloading option. Only applied if strict_transport_security is enabled.
;strict_transport_security_preload = false
# Set to true if to enable the HSTS includeSubDomains option. Only applied if strict_transport_security is enabled.
;strict_transport_security_subdomains = false
# Set to true to enable the X-Content-Type-Options response header.
# The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised
# in the Content-Type headers should not be changed and be followed.
;x_content_type_options = true
# Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading
# when they detect reflected cross-site scripting (XSS) attacks.
;x_xss_protection = true
#################################### Snapshots ###########################
[snapshots]
# snapshot sharing options
;external_enabled = true
;external_snapshot_url = https://snapshots-origin.raintank.io
;external_snapshot_name = Publish to snapshot.raintank.io
# Set to true to enable this Grafana instance act as an external snapshot server and allow unauthenticated requests for
# creating and deleting snapshots.
;public_mode = false
# remove expired snapshot
;snapshot_remove_expired = true
#################################### Dashboards History ##################
[dashboards]
# Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
;versions_to_keep = 20
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is 5 seconds.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;min_refresh_interval = 5s
# Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
;default_home_dashboard_path =
#################################### Users ###############################
[users]
# disable user signup / registration
;allow_sign_up = true
# Allow non admin users to create organizations
;allow_org_create = true
# Set to true to automatically assign new users to the default organization (id 1)
;auto_assign_org = true
# Set this value to automatically add new users to the provided organization (if auto_assign_org above is set to true)
;auto_assign_org_id = 1
# Default role new users will be automatically assigned (if disabled above is set to true)
;auto_assign_org_role = Viewer
# Require email validation before sign up completes
;verify_email_enabled = false
# Background text for the user field on the login page
;login_hint = email or username
;password_hint = password
# Default UI theme ("dark" or "light")
;default_theme = dark
# External user management, these options affect the organization users view
;external_manage_link_url =
;external_manage_link_name =
;external_manage_info =
# Viewers can edit/inspect dashboard settings in the browser. But not save the dashboard.
;viewers_can_edit = false
# Editors can administrate dashboard, folders and teams they create
;editors_can_admin = false
# The duration in time a user invitation remains valid before expiring. This setting should be expressed as a duration. Examples: 6h (hours), 2d (days), 1w (week). Default is 24h (24 hours). The minimum supported duration is 15m (15 minutes).
;user_invite_max_lifetime_duration = 24h
[auth]
# Login cookie name
;login_cookie_name = grafana_session
# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation.
;login_maximum_inactive_lifetime_duration =
# The maximum lifetime (duration) an authenticated user can be logged in since login time before being required to login. Default is 30 days (30d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month).
;login_maximum_lifetime_duration =
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
;token_rotation_interval_minutes = 10
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
;disable_login_form = false
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false
# URL to redirect the user to after sign out
;signout_redirect_url =
# Set to true to attempt login with OAuth automatically, skipping the login screen.
# This setting is ignored if multiple OAuth providers are configured.
;oauth_auto_login = false
# OAuth state max age cookie duration in seconds. Defaults to 600 seconds.
;oauth_state_cookie_max_age = 600
# limit of api_key seconds to live before expiration
;api_key_max_seconds_to_live = -1
# Set to true to enable SigV4 authentication option for HTTP-based datasources.
;sigv4_auth_enabled = false
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
;enabled = false
# specify organization name that should be used for unauthenticated users
;org_name = Main Org.
# specify role for unauthenticated users
;org_role = Viewer
# mask the Grafana version number for unauthenticated users
;hide_version = false
#################################### GitHub Auth ##########################
[auth.github]
;enabled = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
;auth_url = https://github.com/login/oauth/authorize
;token_url = https://github.com/login/oauth/access_token
;api_url = https://api.github.com/user
;allowed_domains =
;team_ids =
;allowed_organizations =
#################################### GitLab Auth #########################
[auth.gitlab]
;enabled = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = api
;auth_url = https://gitlab.com/oauth/authorize
;token_url = https://gitlab.com/oauth/token
;api_url = https://gitlab.com/api/v4
;allowed_domains =
;allowed_groups =
#################################### Google Auth ##########################
[auth.google]
;enabled = false
;allow_sign_up = true
;client_id = some_client_id
;client_secret = some_client_secret
;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
;auth_url = https://accounts.google.com/o/oauth2/auth
;token_url = https://accounts.google.com/o/oauth2/token
;api_url = https://www.googleapis.com/oauth2/v1/userinfo
;allowed_domains =
;hosted_domain =
#################################### Grafana.com Auth ####################
[auth.grafana_com]
;enabled = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email
;allowed_organizations =
#################################### Azure AD OAuth #######################
[auth.azuread]
;name = Azure AD
;enabled = false
;allow_sign_up = true
;client_id = some_client_id
;client_secret = some_client_secret
;scopes = openid email profile
;auth_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize
;token_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
;allowed_domains =
;allowed_groups =
#################################### Okta OAuth #######################
[auth.okta]
;name = Okta
;enabled = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = openid profile email groups
;auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
;token_url = https://<tenant-id>.okta.com/oauth2/v1/token
;api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
;allowed_domains =
;allowed_groups =
;role_attribute_path =
#################################### Generic OAuth ##########################
[auth.generic_oauth]
;enabled = false
;name = OAuth
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
;email_attribute_name = email:primary
;email_attribute_path =
;login_attribute_path =
;id_token_attribute_name =
;auth_url = https://foo.bar/login/oauth/authorize
;token_url = https://foo.bar/login/oauth/access_token
;api_url = https://foo.bar/user
;allowed_domains =
;team_ids =
;allowed_organizations =
;role_attribute_path =
;tls_skip_verify_insecure = false
;tls_client_cert =
;tls_client_key =
;tls_client_ca =
#################################### Basic Auth ##########################
[auth.basic]
;enabled = true
#################################### Auth Proxy ##########################
[auth.proxy]
;enabled = false
;header_name = X-WEBAUTH-USER
;header_property = username
;auto_sign_up = true
;sync_ttl = 60
;whitelist = 192.168.1.1, 192.168.2.1
;headers = Email:X-User-Email, Name:X-User-Name
# Read the auth proxy docs for details on what the setting below enables
;enable_login_token = false
#################################### Auth LDAP ##########################
[auth.ldap]
;enabled = false
;config_file = /etc/grafana/ldap.toml
;allow_sign_up = true
# LDAP backround sync (Enterprise only)
# At 1 am every day
;sync_cron = "0 0 1 * * *"
;active_sync_enabled = true
#################################### SMTP / Emailing ##########################
[smtp]
;enabled = false
;host = localhost:25
;user =
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
;password =
;cert_file =
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
;ehlo_identity = dashboard.example.com
# SMTP startTLS policy (defaults to 'OpportunisticStartTLS')
;startTLS_policy = NoStartTLS
[emails]
;welcome_email_on_sign_up = false
;templates_pattern = emails/*.html
#################################### Logging ##########################
[log]
# Either "console", "file", "syslog". Default is console and file
# Use space to separate multiple modes, e.g. "console file"
;mode = console file
# Either "debug", "info", "warn", "error", "critical", default is "info"
;level = info
# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
;filters =
# For "console" mode only
[log.console]
;level =
# log line format, valid options are text, console and json
;format = console
# For "file" mode only
[log.file]
;level =
# log line format, valid options are text, console and json
;format = text
# This enables automated log rotate(switch of following options), default is true
;log_rotate = true
# Max line number of single file, default is 1000000
;max_lines = 1000000
# Max size shift of single file, default is 28 means 1 << 28, 256MB
;max_size_shift = 28
# Segment log daily, default is true
;daily_rotate = true
# Expired days of log file(delete after max days), default is 7
;max_days = 7
[log.syslog]
;level =
# log line format, valid options are text, console and json
;format = text
# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
;network =
;address =
# Syslog facility. user, daemon and local0 through local7 are valid.
;facility =
# Syslog tag. By default, the process' argv[0] is used.
;tag =
#################################### Usage Quotas ########################
[quota]
; enabled = false
#### set quotas to -1 to make unlimited. ####
# limit number of users per Org.
; org_user = 10
# limit number of dashboards per Org.
; org_dashboard = 100
# limit number of data_sources per Org.
; org_data_source = 10
# limit number of api_keys per Org.
; org_api_key = 10
# limit number of orgs a user can create.
; user_org = 10
# Global limit of users.
; global_user = -1
# global limit of orgs.
; global_org = -1
# global limit of dashboards
; global_dashboard = -1
# global limit of api_keys
; global_api_key = -1
# global limit on number of logged in users.
; global_session = -1
#################################### Alerting ############################
[alerting]
# Disable alerting engine & UI features
;enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
;execute_alerts = true
# Default setting for new alert rules. Defaults to categorize error and timeouts as alerting. (alerting, keep_state)
;error_or_timeout = alerting
# Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
;nodata_or_nullvalues = no_data
# Alert notifications can include images, but rendering many images at the same time can overload the server
# This limit will protect the server from render overloading and make sure notifications are sent out quickly
;concurrent_render_limit = 5
# Default setting for alert calculation timeout. Default value is 30
;evaluation_timeout_seconds = 30
# Default setting for alert notification timeout. Default value is 30
;notification_timeout_seconds = 30
# Default setting for max attempts to sending alert notifications. Default value is 3
;max_attempts = 3
# Makes it possible to enforce a minimal interval between evaluations, to reduce load on the backend
;min_interval_seconds = 1
# Configures for how long alert annotations are stored. Default is 0, which keeps them forever.
# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month).
;max_annotation_age =
# Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations.
;max_annotations_to_keep =
#################################### Annotations #########################
[annotations.dashboard]
# Dashboard annotations means that annotations are associated with the dashboard they are created on.
# Configures how long dashboard annotations are stored. Default is 0, which keeps them forever.
# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month).
;max_age =
# Configures max number of dashboard annotations that Grafana stores. Default value is 0, which keeps all dashboard annotations.
;max_annotations_to_keep =
[annotations.api]
# API annotations means that the annotations have been created using the API without any
# association with a dashboard.
# Configures how long Grafana stores API annotations. Default is 0, which keeps them forever.
# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month).
;max_age =
# Configures max number of API annotations that Grafana keeps. Default value is 0, which keeps all API annotations.
;max_annotations_to_keep =
#################################### Explore #############################
[explore]
# Enable the Explore section
;enabled = true
#################################### Internal Grafana Metrics ##########################
# Metrics available at HTTP API Url /metrics
[metrics]
# Disable / Enable internal metrics
;enabled = true
# Graphite Publish interval
;interval_seconds = 10
# Disable total stats (stat_totals_*) metrics to be generated
;disable_total_stats = false
#If both are set, basic auth will be required for the metrics endpoint.
; basic_auth_username =
; basic_auth_password =
# Metrics environment info adds dimensions to the `grafana_environment_info` metric, which
# can expose more information about the Grafana instance.
[metrics.environment_info]
#exampleLabel1 = exampleValue1
#exampleLabel2 = exampleValue2
# Send internal metrics to Graphite
[metrics.graphite]
# Enable by setting the address setting (ex localhost:2003)
;address =
;prefix = prod.grafana.%(instance_name)s.
#################################### Grafana.com integration ##########################
# Url used to import dashboards directly from Grafana.com
[grafana_com]
;url = https://grafana.com
#################################### Distributed tracing ############
[tracing.jaeger]
# Enable by setting the address sending traces to jaeger (ex localhost:6831)
;address = localhost:6831
# Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
;always_included_tag = tag1:value1
# Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote
;sampler_type = const
# jaeger samplerconfig param
# for "const" sampler, 0 or 1 for always false/true respectively
# for "probabilistic" sampler, a probability between 0 and 1
# for "rateLimiting" sampler, the number of spans per second
# for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership
;sampler_param = 1
# sampling_server_url is the URL of a sampling manager providing a sampling strategy.
;sampling_server_url =
# Whether or not to use Zipkin propagation (x-b3- HTTP headers).
;zipkin_propagation = false
# Setting this to true disables shared RPC spans.
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
;disable_shared_zipkin_spans = false
#################################### External image storage ##########################
[external_image_storage]
# Used for uploading images to public servers so they can be included in slack/email messages.
# you can choose between (s3, webdav, gcs, azure_blob, local)
;provider =
[external_image_storage.s3]
;endpoint =
;path_style_access =
;bucket =
;region =
;path =
;access_key =
;secret_key =
[external_image_storage.webdav]
;url =
;public_url =
;username =
;password =
[external_image_storage.gcs]
;key_file =
;bucket =
;path =
[external_image_storage.azure_blob]
;account_name =
;account_key =
;container_name =
[external_image_storage.local]
# does not require any configuration
[rendering]
# Options to configure a remote HTTP image rendering service, e.g. using https://github.com/grafana/grafana-image-renderer.
# URL to a remote HTTP image renderer service, e.g. http://localhost:8081/render, will enable Grafana to render panels and dashboards to PNG-images using HTTP requests to an external service.
;server_url =
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
;callback_url =
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
;concurrent_render_request_limit = 30
[panels]
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
;disable_sanitize_html = false
[plugins]
;enable_alpha = false
;app_tls_skip_verify_insecure = false
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
;allow_loading_unsigned_plugins =
;marketplace_url = https://grafana.com/grafana/plugins/
#################################### Grafana Image Renderer Plugin ##########################
[plugin.grafana-image-renderer]
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
# See ICU’s metaZones.txt (https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt) for a list of supported
# timezone IDs. Fallbacks to TZ environment variable if not set.
;rendering_timezone =
# Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert.
# Please refer to the HTTP header Accept-Language to understand how to format this value, e.g. 'fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'.
;rendering_language =
# Instruct headless browser instance to use a default device scale factor when not provided by Grafana, e.g. when rendering panel image of alert.
# Default is 1. Using a higher value will produce more detailed images (higher DPI), but will require more disk space to store an image.
;rendering_viewport_device_scale_factor =
# Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored. Due to
# the security risk it's not recommended to ignore HTTPS errors.
;rendering_ignore_https_errors =
# Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is false and will
# only capture and log error messages. When enabled, debug messages are captured and logged as well.
# For the verbose information to be included in the Grafana server log you have to adjust the rendering log level to debug, configure
# [log].filter = rendering:debug.
;rendering_verbose_logging =
# Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service.
# Default is false. This can be useful to enable (true) when troubleshooting.
;rendering_dumpio =
# Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
# here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
;rendering_args =
# You can configure the plugin to use a different browser binary instead of the pre-packaged version of Chromium.
# Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
# compatible with the plugin.
;rendering_chrome_bin =
# Instruct how headless browser instances are created. Default is 'default' and will create a new browser instance on each request.
# Mode 'clustered' will make sure that only a maximum of browsers/incognito pages can execute concurrently.
# Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
;rendering_mode =
# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
# and will cluster using browser instances.
# Mode 'context' will cluster using incognito pages.
;rendering_clustering_mode =
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
;rendering_clustering_max_concurrency =
# Limit the maximum viewport width, height and device scale factor that can be requested.
;rendering_viewport_max_width =
;rendering_viewport_max_height =
;rendering_viewport_max_device_scale_factor =
# Change the listening host and port of the gRPC server. Default host is 127.0.0.1 and default port is 0 and will automatically assign
# a port not in use.
;grpc_host =
;grpc_port =
[enterprise]
# Path to a valid Grafana Enterprise license.jwt file
;license_path =
[feature_toggles]
# enable features, separated by spaces
;enable =
[date_formats]
# For information on what formatting patterns that are supported https://momentjs.com/docs/#/displaying/
# Default system date format used in time range picker and other places where full time is displayed
;full_date = YYYY-MM-DD HH:mm:ss
# Used by graph and other places where we only show small intervals
;interval_second = HH:mm:ss
;interval_minute = HH:mm
;interval_hour = MM/DD HH:mm
;interval_day = MM/DD
;interval_month = YYYY-MM
;interval_year = YYYY
# Experimental feature
;use_browser_locale = false
# Default timezone for user preferences. Options are 'browser' for the browser local timezone or a timezone name from IANA Time Zone database, e.g. 'UTC' or 'Europe/Amsterdam' etc.
;default_timezone = browser
+1
查看文件
@@ -0,0 +1 @@
数据目录 请执行 `chmod 777 /docker/kafka/data` 赋予读写权限 否则将无法写入数据
+9
查看文件
@@ -0,0 +1,9 @@
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
@@ -0,0 +1,326 @@
#
# Copyright 1999-2025 Alibaba Group Holding Ltd.
#
# 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.
#
#--------------- Nacos Common Configurations ---------------#
#*************** Nacos port Related Configurations ***************#
### Nacos Server Main port
nacos.server.main.port=8848
#*************** Network Related Configurations ***************#
### If prefer hostname over ip for Nacos server addresses in cluster.conf:
# nacos.inetutils.prefer-hostname-over-ip=false
### Specify local server's IP:
# nacos.inetutils.ip-address=
#*************** Datasource Related Configurations ***************#
### nacos.plugin.datasource.log.enabled=true
#spring.sql.init.platform=mysql
### Count of DB:
# db.num=1
### Connect URL of DB:
# db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
# db.user=nacos
# db.password=nacos
#*************** Metrics Related Configurations ***************#
### Metrics for prometheus
#management.endpoints.web.exposure.include=prometheus
### 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
#*************** Console Related Configurations ***************#
### CORS (Cross-Origin Resource Sharing) configurations for console
### Whether to allow credentials (cookies, authorization headers, TLS client certificates)
# nacos.console.cors.allow-credentials=true
### Allowed headers, comma separated. Empty means allow all headers (*)
# nacos.console.cors.allowed-headers=
### Maximum age (in seconds) of the CORS preflight request cache
# nacos.console.cors.max-age=18000
### Allowed HTTP methods, comma separated. Empty means allow all methods (*)
# nacos.console.cors.allowed-methods=
### Allowed origins, comma separated. Empty means allow all origin patterns (*)
### Example: nacos.console.cors.allowed-origins=http://localhost:8080,https://example.com
# nacos.console.cors.allowed-origins=
#*************** Core Related Configurations ***************#
### set the WorkerID manually
# nacos.core.snowflake.worker-id=
### Member-MetaData
# nacos.core.member.meta.site=
# nacos.core.member.meta.adweight=
# nacos.core.member.meta.weight=
### MemberLookup
### Addressing pattern category, If set, the priority is highest
# nacos.core.member.lookup.type=[file,address-server]
## Set the cluster list with a configuration file or command-line argument
# nacos.member.list=192.168.16.101:8847?raft_port=8807,192.168.16.101?raft_port=8808,192.168.16.101:8849?raft_port=8809
## for AddressServerMemberLookup
# Maximum number of retries to query the address server upon initialization
# nacos.core.address-server.retry=5
## Server domain name address of [address-server] mode
# address.server.domain=jmenv.tbsite.net
## Server port of [address-server] mode
#address.server.port=8080
## Request address of [address-server] mode
# address.server.url=/nacos/serverlist
#*************** JRaft Related Configurations ***************#
### Sets the Raft cluster election timeout, default value is 5 second
# nacos.core.protocol.raft.data.election_timeout_ms=5000
### Sets the amount of time the Raft snapshot will execute periodically, default is 30 minute
# nacos.core.protocol.raft.data.snapshot_interval_secs=30
### raft internal worker threads
# nacos.core.protocol.raft.data.core_thread_num=8
### Number of threads required for raft business request processing
# nacos.core.protocol.raft.data.cli_service_thread_num=4
### raft linear read strategy. Safe linear reads are used by default, that is, the Leader tenure is confirmed by heartbeat
# nacos.core.protocol.raft.data.read_index_type=ReadOnlySafe
### rpc request timeout, default 5 seconds
# nacos.core.protocol.raft.data.rpc_request_timeout_ms=5000
### enable to support prometheus service discovery
#nacos.prometheus.metrics.enabled=true
#*************** Distro Related Configurations ***************#
### Distro data sync delay time, when sync task delayed, task will be merged for same data key. Default 1 second.
# nacos.core.protocol.distro.data.sync.delayMs=1000
### Distro data sync timeout for one sync data, default 3 seconds.
# nacos.core.protocol.distro.data.sync.timeoutMs=3000
### Distro data sync retry delay time when sync data failed or timeout, same behavior with delayMs, default 3 seconds.
# nacos.core.protocol.distro.data.sync.retryDelayMs=3000
### Distro data verify interval time, verify synced data whether expired for a interval. Default 5 seconds.
# nacos.core.protocol.distro.data.verify.intervalMs=5000
### Distro data verify timeout for one verify, default 3 seconds.
# nacos.core.protocol.distro.data.verify.timeoutMs=3000
### Distro data load retry delay when load snapshot data failed, default 30 seconds.
# nacos.core.protocol.distro.data.load.retryDelayMs=30000
### enable to support prometheus service discovery
#nacos.prometheus.metrics.enabled=true
#*************** Grpc Configurations ***************#
### Sets the maximum message size allowed to be received on the server.
#nacos.remote.server.grpc.sdk.max-inbound-message-size=10485760
### Sets the time(milliseconds) without read activity before sending a keepalive ping. The typical default is two hours.
#nacos.remote.server.grpc.sdk.keep-alive-time=7200000
### Sets a time(milliseconds) waiting for read activity after sending a keepalive ping. Defaults to 20 seconds.
#nacos.remote.server.grpc.sdk.keep-alive-timeout=20000
### Sets a time(milliseconds) that specify the most aggressive keep-alive time clients are permitted to configure. The typical default is 5 minutes
#nacos.remote.server.grpc.sdk.permit-keep-alive-time=300000
### cluster grpc(inside the nacos server) configuration
#nacos.remote.server.grpc.cluster.max-inbound-message-size=10485760
### Sets the time(milliseconds) without read activity before sending a keepalive ping. The typical default is two hours.
#nacos.remote.server.grpc.cluster.keep-alive-time=7200000
### Sets a time(milliseconds) waiting for read activity after sending a keepalive ping. Defaults to 20 seconds.
#nacos.remote.server.grpc.cluster.keep-alive-timeout=20000
### Sets a time(milliseconds) that specify the most aggressive keep-alive time clients are permitted to configure. The typical default is 5 minutes
#nacos.remote.server.grpc.cluster.permit-keep-alive-time=300000
#*************** Config Module Related Configurations ***************#
### the maximum retry times for push
nacos.config.push.maxRetryTime=50
#*************** Naming Module Related Configurations ***************#
### Data dispatch task execution period in milliseconds:
### If enable data warmup. If set to false, the server would accept request without local data preparation:
# nacos.naming.data.warmup=true
### If enable the instance auto expiration, kind like of health check of instance:
# nacos.naming.expireInstance=true
nacos.naming.empty-service.auto-clean=true
nacos.naming.empty-service.clean.initial-delay-ms=50000
nacos.naming.empty-service.clean.period-time-ms=30000
#*************** AI Module Related Configurations ***************#
### Whether nacos ai module is enabled, default true. the ai module need both config module and naming module enabled.
# nacos.extension.ai.enabled=true
### Whether nacos mcp registry is enabled, default is false.
### When enabled=true, Nacos will start a `mcp registry` server with new port with `nacos.ai.mcp.registry.port`
#nacos.ai.mcp.registry.enabled=false
### Nacos mcp registry port, default 9080:
nacos.ai.mcp.registry.port=9080
#--------------- Nacos Web Server Configurations ---------------#
#*************** Nacos Web Server Related Configurations ***************#
### Nacos Server Web context path:
nacos.server.contextPath=/nacos
#*************** Access Log Related Configurations ***************#
### If turn on the access log:
server.tomcat.accesslog.enabled=false
### accesslog automatic cleaning time
server.tomcat.accesslog.max-days=30
### The access log pattern:
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
### The directory of access log:
server.tomcat.basedir=file:.
#*************** API Related Configurations ***************#
### Include message field
server.error.include-message=ALWAYS
### Enabled for open API compatibility
# nacos.core.api.compatibility.client.enabled=true
### Enabled for admin API compatibility
# nacos.core.api.compatibility.admin.enabled=false
### Enabled for console API compatibility
# nacos.core.api.compatibility.console.enabled=false
#--------------- Nacos Console Configurations ---------------#
#*************** Nacos Console Related Configurations ***************#
### Nacos Console Main port
nacos.console.port=18080
### Nacos Server Web context path:
nacos.console.contextPath=
### Nacos Server context path, which link to nacos server `nacos.server.contextPath`, works when deployment type is `console`
nacos.console.remote.server.context-path=/nacos
#************** Console UI Configuration ***************#
### Turn on/off the nacos console ui.
#nacos.console.ui.enabled=true
#--------------- Nacos Plugin Configurations ---------------#
#*************** CMDB Plugin Related Configurations ***************#
### The interval to dump external CMDB in seconds:
# nacos.cmdb.dumpTaskInterval=3600
### The interval of polling data change event in seconds:
# nacos.cmdb.eventTaskInterval=10
### The interval of loading labels in seconds:
# nacos.cmdb.labelTaskInterval=300
### If turn on data loading task:
# nacos.cmdb.loadDataAtStart=false
#*************** Auth Plugin Related Configurations ***************#
### The ignore urls of auth, will be deprecated in the future:
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
### The auth system to use, default 'nacos' and 'ldap' is supported, other type should be implemented by yourself:
nacos.core.auth.system.type=nacos
### If turn on auth system:
# Whether open nacos server API auth system
nacos.core.auth.enabled=false
# Whether open nacos admin API auth system
nacos.core.auth.admin.enabled=true
# Whether open nacos console API auth system
nacos.core.auth.console.enabled=true
### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
nacos.core.auth.caching.enabled=true
### worked when nacos.core.auth.enabled=true
### The two properties is the white list for auth and used by identity the request from other server.
nacos.core.auth.server.identity.key=aixun-admin-key
nacos.core.auth.server.identity.value=aixun-admin-value
### worked when nacos.core.auth.system.type=nacos or nacos.core.auth.console.enabled=true
### The token expiration in seconds:
nacos.core.auth.plugin.nacos.token.cache.enable=false
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
### The default token (Base64 string):
#nacos.core.auth.plugin.nacos.token.secret.key=VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg=
nacos.core.auth.plugin.nacos.token.secret.key=rE7bYayhpvduYwCxuhckybEPDXyna6xwm5m7MZjtjrdXjVxAbXAMccXHyaJvB346
### worked when nacos.core.auth.system.type=ldap,{0} is Placeholder,replace login username
#nacos.core.auth.ldap.url=ldap://localhost:389
#nacos.core.auth.ldap.basedc=dc=example,dc=org
#nacos.core.auth.ldap.userDn=cn=admin,${nacos.core.auth.ldap.basedc}
#nacos.core.auth.ldap.password=admin
#nacos.core.auth.ldap.userdn=cn={0},dc=example,dc=org
#nacos.core.auth.ldap.filter.prefix=uid
#nacos.core.auth.ldap.case.sensitive=true
#nacos.core.auth.ldap.ignore.partial.result.exception=false
#*************** Control Plugin Related Configurations ***************#
# plugin type
#nacos.plugin.control.manager.type=nacos
# local control rule storage dir, default ${nacos.home}/data/connection and ${nacos.home}/data/tps
#nacos.plugin.control.rule.local.basedir=${nacos.home}
# external control rule storage type, if exist
#nacos.plugin.control.rule.external.storage=
#*************** Config Change Plugin Related Configurations ***************#
# webhook
#nacos.core.config.plugin.webhook.enabled=false
# It is recommended to use EB https://help.aliyun.com/document_detail/413974.html
#nacos.core.config.plugin.webhook.url=http://localhost:8080/webhook/send?token=***
# The content push max capacity ,byte
#nacos.core.config.plugin.webhook.contentMaxCapacity=102400
# whitelist
#nacos.core.config.plugin.whitelist.enabled=false
# The import file suffixs
#nacos.core.config.plugin.whitelist.suffixs=xml,text,properties,yaml,html
# fileformatcheck,which validate the import file of type and content
#nacos.core.config.plugin.fileformatcheck.enabled=false
#*************** Istio Plugin Related Configurations ***************#
### If turn on the MCP server:
nacos.istio.mcp.server.enabled=false
#--------------- Nacos Experimental Features Configurations ---------------#
#*************** K8s Related Configurations ***************#
### If turn on the K8s sync:
nacos.k8s.sync.enabled=false
### If use the Java API from an application outside a kubernetes cluster
#nacos.k8s.sync.outsideCluster=false
#nacos.k8s.sync.kubeConfig=/.kube/config
+110
查看文件
@@ -0,0 +1,110 @@
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
# 可以根据业务并发量适当调高
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# 高效传输文件
sendfile on;
# 长连接超时时间
keepalive_timeout 65;
# 单连接最大请求数,提高长连接复用率
keepalive_requests 100000;
# 限制body大小
client_max_body_size 100m;
client_header_buffer_size 32k;
client_body_buffer_size 512k;
# 开启静态资源压缩
gzip_static on;
# 连接数限制 (防御类配置) 10m 一般够用了,能存储上万 IP 的计数
limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;
# 隐藏 nginx 版本号,防止暴露版本信息
server_tokens off;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
upstream server {
ip_hash;
# gateway 地址
server 127.0.0.1:8080;
# server 127.0.0.1:8081;
}
server {
listen 80;
server_name localhost;
# https配置参考 start
#listen 443 ssl;
# 证书直接存放 /docker/nginx/cert/ 目录下即可 更改证书名称即可 无需更改证书路径
#ssl on;
#ssl_certificate /etc/nginx/cert/xxx.local.crt; # /etc/nginx/cert/ 为docker映射路径 不允许更改
#ssl_certificate_key /etc/nginx/cert/xxx.local.key; # /etc/nginx/cert/ 为docker映射路径 不允许更改
#ssl_session_timeout 5m;
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_prefer_server_ciphers on;
# https配置参考 end
# 演示环境配置 拦截除 GET POST 之外的所有请求
# if ($request_method !~* GET|POST) {
# rewrite ^/(.*)$ /403;
# }
# location = /403 {
# default_type application/json;
# return 200 '{"msg":"演示模式,不允许操作","code":500}';
# }
# 限制外网访问内网 actuator 相关路径
location ~ ^(/[^/]*)?/actuator.*(/.*)?$ {
return 403;
}
location / {
root /usr/share/nginx/html; # docker映射路径 不允许更改
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /prod-api/ {
# 设置客户端请求头中的 Host 信息(保持原始 Host)
proxy_set_header Host $http_host;
# 获取客户端真实 IP
proxy_set_header X-Real-IP $remote_addr;
# 自定义头 REMOTE-HOST,记录客户端 IP
proxy_set_header REMOTE-HOST $remote_addr;
# 获取完整的客户端 IP 链(经过多级代理时)
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 设置后端响应超时时间(这里是 24 小时,适合长连接/SSE)
proxy_read_timeout 86400s;
# SSE (Server-Sent Events) 与 WebSocket 支持参数
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 禁用代理缓冲,数据直接传给客户端
proxy_buffering off;
# 禁用代理缓存
proxy_cache off;
proxy_pass http://server/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
+59
查看文件
@@ -0,0 +1,59 @@
# 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:
- job_name: 'Prometheus'
static_configs:
- targets: ['127.0.0.1:9090']
- job_name: 'Grafana'
static_configs:
- targets: ['127.0.0.1:3000']
- job_name: 'Nacos'
metrics_path: '/nacos/actuator/prometheus'
static_configs:
- targets: ['127.0.0.1:8848']
# monitor 监控的账号密码
basic_auth:
username: aixun
password: 123456
- job_name: AiXun-Admin
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /actuator/prometheus
scheme: http
# monitor 监控的账号密码
basic_auth:
username: aixun
password: 123456
http_sd_configs:
- url: 'http://127.0.0.1:9100/actuator/prometheus/sd'
# monitor 监控的账号密码
basic_auth:
username: aixun
password: 123456
relabel_configs:
# 如果目标有context_path标签,则修改metrics_path以包含该上下文路径
- source_labels: [__meta_http_sd_context_path]
target_label: __metrics_path__
replacement: '${1}/actuator/prometheus'
+11
查看文件
@@ -0,0 +1,11 @@
FROM rabbitmq:3.13.3-management
LABEL maintainer="AiXun Technology <343559364@qq.com>"
ADD ./rabbitmq_delayed_message_exchange-3.13.0.ez /plugins
RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange
ENTRYPOINT ["rabbitmq-server"]
+1
查看文件
@@ -0,0 +1 @@
数据目录 请执行 `chmod 777 /docker/rabbitmq/data` 赋予读写权限 否则将无法写入数据
+1
查看文件
@@ -0,0 +1 @@
日志目录 请执行 `chmod 777 /docker/rabbitmq/log` 赋予读写权限 否则将无法写入数据
二进制文件未显示。
+28
查看文件
@@ -0,0 +1,28 @@
# redis 密码
requirepass aixun123
# key 监听器配置
# notify-keyspace-events Ex
# 配置持久化文件存储路径
dir /redis/data
# 配置rdb
# 15分钟内有至少1个key被更改则进行快照
save 900 1
# 5分钟内有至少10个key被更改则进行快照
save 300 10
# 1分钟内有至少10000个key被更改则进行快照
save 60 10000
# 开启压缩
rdbcompression yes
# rdb文件名 用默认的即可
dbfilename dump.rdb
# 开启aof
appendonly yes
# 文件名
appendfilename "appendonly.aof"
# 持久化策略,no:不同步,everysec:每秒一次,always:总是同步,速度比较慢
# appendfsync always
appendfsync everysec
# appendfsync no
+1
查看文件
@@ -0,0 +1 @@
数据目录 请执行 `chmod 777 /docker/redis/data` 赋予读写权限 否则将无法写入数据
@@ -0,0 +1,26 @@
# 所属集群名称,如果节点较多可以配置多个
brokerClusterName = DefaultCluster
#broker名称,master和slave使用相同的名称,表明他们的主从关系
brokerName = broker1
#0表示Master,大于0表示不同的slave
brokerId = 0
#表示几点做消息删除动作,默认是凌晨4点
deleteWhen = 04
#在磁盘上保留消息的时长,单位是小时
fileReservedTime = 48
#有三个值:SYNC_MASTER,ASYNC_MASTER,SLAVE;同步和异步表示Master和Slave之间同步数据的机制;
brokerRole = ASYNC_MASTER
#刷盘策略,取值为:ASYNC_FLUSH,SYNC_FLUSH表示同步刷盘和异步刷盘;SYNC_FLUSH消息写入磁盘后才返回成功状态,ASYNC_FLUSH不需要;
flushDiskType = ASYNC_FLUSH
# 设置broker节点所在服务器的ip地址(**这个非常重要,主从模式下,从节点会根据主节点的brokerIP2来同步数据,如果不配置,主从无法同步,brokerIP1设置为自己外网能访问的ip,服务器双网卡情况下必须配置,比如阿里云这种,主节点需要配置ip1和ip2,从节点只需要配置ip1即可)
# 此ip由使用环境决定 本机使用 127 局域网使用 192 外网使用 外网ip
brokerIP1 = 192.168.31.165
#Broker 对外服务的监听端口,
listenPort = 10911
#是否允许Broker自动创建Topic
autoCreateTopicEnable = true
#是否允许 Broker 自动创建订阅组
autoCreateSubscriptionGroup = true
#linux开启epoll
useEpollNativeSelector = true
@@ -0,0 +1 @@
日志目录 请执行 `chmod 777 /docker/rocketmq/broker1/logs` 赋予读写权限 否则将无法写入数据
@@ -0,0 +1 @@
数据目录 请执行 `chmod 777 /docker/rocketmq/broker1/store` 赋予读写权限 否则将无法写入数据
@@ -0,0 +1 @@
日志目录 请执行 `chmod 777 /docker/rocketmq/namesrv/logs` 赋予读写权限 否则将无法写入数据
+189
查看文件
@@ -0,0 +1,189 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
server:
port: 8091
spring:
application:
name: seata-server
main:
web-application-type: none
logging:
config: classpath:logback-spring.xml
file:
path: ${log.home:${user.home}/logs/seata}
extend:
logstash-appender:
# off by default
enabled: false
destination: 127.0.0.1:4560
kafka-appender:
# off by default
enabled: false
bootstrap-servers: 127.0.0.1:9092
topic: logback_to_logstash
producer:
acks: 0
linger-ms: 1000
max-block-ms: 0
metric-appender:
# off by default
enabled: false
seata:
config:
# support: nacos 、 consul 、 apollo 、 zk 、 etcd3
type: file
nacos:
server-addr: 127.0.0.1:8848
namespace: public
group: DEFAULT_GROUP
context-path:
##1.The following configuration is for the open source version of Nacos
username: nacos
password: nacos
##2.The following configuration is for the MSE Nacos on aliyun
#access-key:
#secret-key:
##3.The following configuration is used to deploy on Aliyun ECS or ACK without authentication
#ram-role-name:
data-id: seata-server.properties
registry:
# support: nacos 、 eureka 、 redis 、 zk 、 consul 、 etcd3 、 sofa 、 seata
type: file
# preferred-networks: 30.240.*
metadata:
weight: 100
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group: DEFAULT_GROUP
namespace: public
cluster: default
context-path:
##1.The following configuration is for the open source version of Nacos
username: nacos
password: nacos
##2.The following configuration is for the MSE Nacos on aliyun
#access-key:
#secret-key:
##3.The following configuration is used to deploy on Aliyun ECS or ACK without authentication
#ram-role-name:
server:
service-port: 8091 # If not configured, the default is '${server.port}'
max-commit-retry-timeout: -1
max-rollback-retry-timeout: -1
rollback-failed-unlock-enable: false
enable-check-auth: true
enable-parallel-request-handle: true
enable-parallel-handle-branch: false
retry-dead-threshold: 70000
xaer-nota-retry-timeout: 60000
enableParallelRequestHandle: true
applicationDataLimitCheck: true
applicationDataLimit: 64000
recovery:
committing-retry-period: 1000
async-committing-retry-period: 1000
rollbacking-retry-period: 1000
end-status-retry-period: 1000
timeout-retry-period: 1000
undo:
log-save-days: 7
log-delete-period: 86400000
session:
branch-async-queue-size: 5000 #branch async remove queue size
enable-branch-async-remove: false #enable to asynchronous remove branchSession
ratelimit:
enable: false
bucketTokenNumPerSecond: 999999
bucketTokenMaxNum: 999999
bucketTokenInitialNum: 999999
http:
filter:
xss:
keywords: ["<script>", "</script>", "javascript:", "vbscript:"]
store:
# support: file 、 db 、 redis 、 raft
mode: file
session:
mode: file
lock:
mode: file
file:
dir: sessionStore
max-branch-session-size: 16384
max-global-session-size: 512
file-write-buffer-cache-size: 16384
session-reload-read-size: 100
flush-disk-mode: async
db:
datasource: hikari
db-type: mysql
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true
user: root
password: root
min-conn: 10
max-conn: 100
global-table: global_table
branch-table: branch_table
lock-table: lock_table
distributed-lock-table: distributed_lock
vgroup-table: vgroup_table
query-limit: 1000
max-wait: 5000
hikari:
idle-timeout: 600000
keepalive-time: 120000
max-lifetime: 1800000
validation-timeout: 5000
redis:
mode: single
# support: lua 、 pipeline
type: lua
database: 0
min-conn: 10
max-conn: 100
password:
max-total: 100
query-limit: 1000
single:
host: 127.0.0.1
port: 6379
sentinel:
master-name:
sentinel-hosts:
sentinel-password:
metrics:
enabled: false
registry-type: compact
exporter-list: prometheus
exporter-prometheus-port: 9898
transport:
rpc-tc-request-timeout: 15000
enable-tc-server-batch-send-response: false
# HTTP thread pool
min-http-pool-size: 10
max-http-pool-size: 100
max-http-task-queue-size: 1000
http-pool-keep-alive-time: 500
shutdown:
wait: 3
thread-factory:
boss-thread-prefix: NettyBoss
worker-thread-prefix: NettyServerNIOWorker
boss-thread-size: 1
@@ -0,0 +1,119 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
######################################################################################################
#
# Here you can configure the rules for the proxy.
# This example is configuration of encrypt rule.
#
######################################################################################################
#
#databaseName: encrypt_db
#
#dataSources:
# ds_0:
# url: jdbc:postgresql://127.0.0.1:5432/demo_ds_0
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# ds_1:
# url: jdbc:postgresql://127.0.0.1:5432/demo_ds_1
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !ENCRYPT
# encryptors:
# aes_encryptor:
# type: AES
# props:
# aes-key-value: 123456abc
# rc4_encryptor:
# type: RC4
# props:
# rc4-key-value: 123456abc
# tables:
# t_encrypt:
# columns:
# user_id:
# cipher:
# name: user_cipher
# encryptorName: aes_encryptor
# order_id:
# cipher:
# name: order_encrypt
# encryptorName: rc4_encryptor
######################################################################################################
#
# If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
#
######################################################################################################
#
#databaseName: encrypt_db
#
#dataSources:
# ds_0:
# url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# ds_1:
# url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !ENCRYPT
# encryptors:
# aes_encryptor:
# type: AES
# props:
# aes-key-value: 123456abc
# rc4_encryptor:
# type: RC4
# props:
# rc4-key-value: 123456abc
# tables:
# t_encrypt:
# columns:
# user_id:
# cipher:
# name: user_cipher
# encryptorName: aes_encryptor
# order_id:
# cipher:
# name: order_encrypt
# encryptorName: rc4_encryptor
@@ -0,0 +1,127 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
######################################################################################################
#
# Here you can configure the rules for the proxy.
# This example is configuration of mask rule.
#
######################################################################################################
#
#databaseName: mask_db
#
#dataSources:
# ds_0:
# url: jdbc:postgresql://127.0.0.1:5432/demo_ds_0
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# ds_1:
# url: jdbc:postgresql://127.0.0.1:5432/demo_ds_1
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !MASK
# tables:
# t_user:
# columns:
# password:
# maskAlgorithm: md5_mask
# email:
# maskAlgorithm: mask_before_special_chars_mask
# telephone:
# maskAlgorithm: keep_first_n_last_m_mask
#
# maskAlgorithms:
# md5_mask:
# type: MD5
# mask_before_special_chars_mask:
# type: MASK_BEFORE_SPECIAL_CHARS
# props:
# special-chars: '@'
# replace-char: '*'
# keep_first_n_last_m_mask:
# type: KEEP_FIRST_N_LAST_M
# props:
# first-n: 3
# last-m: 4
# replace-char: '*'
######################################################################################################
#
# If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
#
######################################################################################################
#
#databaseName: mask_db
#
#dataSources:
# ds_0:
# url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# ds_1:
# url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !MASK
# tables:
# t_user:
# columns:
# password:
# maskAlgorithm: md5_mask
# email:
# maskAlgorithm: mask_before_special_chars_mask
# telephone:
# maskAlgorithm: keep_first_n_last_m_mask
#
# maskAlgorithms:
# md5_mask:
# type: MD5
# mask_before_special_chars_mask:
# type: MASK_BEFORE_SPECIAL_CHARS
# props:
# special-chars: '@'
# replace-char: '*'
# keep_first_n_last_m_mask:
# type: KEEP_FIRST_N_LAST_M
# props:
# first-n: 3
# last-m: 4
# replace-char: '*'
@@ -0,0 +1,117 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
######################################################################################################
#
# Here you can configure the rules for the proxy.
# This example is configuration of readwrite-splitting rule.
#
######################################################################################################
#
#databaseName: readwrite_splitting_db
#
#dataSources:
# primary_ds:
# url: jdbc:postgresql://127.0.0.1:5432/demo_primary_ds
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# replica_ds_0:
# url: jdbc:postgresql://127.0.0.1:5432/demo_replica_ds_0
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# replica_ds_1:
# url: jdbc:postgresql://127.0.0.1:5432/demo_replica_ds_1
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !READWRITE_SPLITTING
# dataSources:
# readwrite_ds:
# writeDataSourceName: primary_ds
# readDataSourceNames:
# - replica_ds_0
# - replica_ds_1
# loadBalancerName: random
# loadBalancers:
# random:
# type: RANDOM
######################################################################################################
#
# If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
#
######################################################################################################
#databaseName: readwrite_splitting_db
#
#dataSources:
# write_ds:
# url: jdbc:mysql://127.0.0.1:3306/demo_write_ds?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# read_ds_0:
# url: jdbc:mysql://127.0.0.1:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# read_ds_1:
# url: jdbc:mysql://127.0.0.1:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !READWRITE_SPLITTING
# dataSources:
# readwrite_ds:
# writeDataSourceName: write_ds
# readDataSourceNames:
# - read_ds_0
# - read_ds_1
# loadBalancerName: random
# loadBalancers:
# random:
# type: RANDOM
@@ -0,0 +1,175 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
######################################################################################################
#
# Here you can configure the rules for the proxy.
# This example is configuration of shadow rule.
#
######################################################################################################
#
#databaseName: shadow_db
#
#dataSources:
# ds:
# url: jdbc:postgresql://127.0.0.1:5432/demo_ds_0
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# shadow_ds:
# url: jdbc:postgresql://127.0.0.1:5432/demo_ds_1
# username: postgres
# password: postgres
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !SHADOW
# dataSources:
# shadowDataSource:
# productionDataSourceName: ds
# shadowDataSourceName: shadow_ds
# tables:
# t_order:
# dataSourceNames:
# - shadowDataSource
# shadowAlgorithmNames:
# - user_id_insert_match_algorithm
# - user_id_select_match_algorithm
# t_order_item:
# dataSourceNames:
# - shadowDataSource
# shadowAlgorithmNames:
# - user_id_insert_match_algorithm
# - user_id_update_match_algorithm
# - user_id_select_match_algorithm
# t_address:
# dataSourceNames:
# - shadowDataSource
# shadowAlgorithmNames:
# - user_id_insert_match_algorithm
# - user_id_select_match_algorithm
# - sql_hint_algorithm
# shadowAlgorithms:
# user_id_insert_match_algorithm:
# type: REGEX_MATCH
# props:
# operation: insert
# column: user_id
# regex: "[1]"
# user_id_update_match_algorithm:
# type: REGEX_MATCH
# props:
# operation: update
# column: user_id
# regex: "[1]"
# user_id_select_match_algorithm:
# type: REGEX_MATCH
# props:
# operation: select
# column: user_id
# regex: "[1]"
# sql_hint_algorithm:
# type: SQL_HINT
# props:
# foo: bar
######################################################################################################
#
# If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
#
######################################################################################################
#
#databaseName: shadow_db
#
#dataSources:
# ds:
# url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
# shadow_ds:
# url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
# username: root
# password:
# connectionTimeoutMilliseconds: 30000
# idleTimeoutMilliseconds: 60000
# maxLifetimeMilliseconds: 1800000
# maxPoolSize: 50
# minPoolSize: 1
#
#rules:
#- !SHADOW
# dataSources:
# shadowDataSource:
# productionDataSourceName: ds
# shadowDataSourceName: shadow_ds
# tables:
# t_order:
# dataSourceNames:
# - shadowDataSource
# shadowAlgorithmNames:
# - user_id_insert_match_algorithm
# - user_id_select_match_algorithm
# t_order_item:
# dataSourceNames:
# - shadowDataSource
# shadowAlgorithmNames:
# - user_id_insert_match_algorithm
# - user_id_update_match_algorithm
# - user_id_select_match_algorithm
# t_address:
# dataSourceNames:
# - shadowDataSource
# shadowAlgorithmNames:
# - user_id_insert_match_algorithm
# - user_id_select_match_algorithm
# - sql_hint_algorithm
# shadowAlgorithms:
# user_id_insert_match_algorithm:
# type: REGEX_MATCH
# props:
# operation: insert
# column: user_id
# regex: "[1]"
# user_id_update_match_algorithm:
# type: REGEX_MATCH
# props:
# operation: update
# column: user_id
# regex: "[1]"
# user_id_select_match_algorithm:
# type: REGEX_MATCH
# props:
# operation: select
# column: user_id
# regex: "[1]"
# sql_hint_algorithm:
# type: SQL_HINT
# props:
# foo: bar
@@ -0,0 +1,124 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
######################################################################################################
#
# Here you can configure the rules for the proxy.
# This example is configuration of sharding rule.
#
######################################################################################################
databaseName: data-center_db
dataSources:
ds_0:
url: jdbc:mysql://localhost:3306/data-center_0?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url: jdbc:mysql://localhost:3306/data-center_1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !SHARDING
tables: # 数据分片规则配置
t_order: # 订单逻辑表名称
actualDataNodes: ds_${0..1}.t_order_${0..1}
databaseStrategy: # 配置分库策略
standard:
shardingColumn: user_id
shardingAlgorithmName: database_user_inline
tableStrategy: # 分表策略
standard:
shardingColumn: order_id
shardingAlgorithmName: t_order_inline
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
# auditStrategy:
# auditorNames:
# - sharding_key_required_auditor
# allowHintDisable: true
t_order_item: # 子订单逻辑表名称
actualDataNodes: ds_${0..1}.t_order_item_${0..1}
databaseStrategy: # 配置分库策略
standard:
shardingColumn: user_id
shardingAlgorithmName: database_user_inline
tableStrategy: # 分表策略
standard:
shardingColumn: order_id
shardingAlgorithmName: t_order_item_inline
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
bindingTables: # 绑定表规则列表
- t_order,t_order_item
# defaultDatabaseStrategy:
# standard:
# shardingColumn: user_id
# shardingAlgorithmName: database_user_inline
# defaultTableStrategy:
# none:
# defaultAuditStrategy:
# auditorNames:
# - sharding_key_required_auditor
# allowHintDisable: true
# 分片算法配置
shardingAlgorithms:
database_user_inline:
type: INLINE
props:
algorithm-expression: ds_${user_id % 2}
t_order_inline: # 订单表分片算法名称
type: INLINE
props:
algorithm-expression: t_order_${order_id % 2}
allow-range-query-with-inline-sharding: true
t_order_item_inline: # 子订单表分片算法名称
type: INLINE
props:
algorithm-expression: t_order_item_${order_id % 2}
allow-range-query-with-inline-sharding: true
# 分布式序列算法配置
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker-id: 1
# auditors:
# sharding_key_required_auditor:
# type: DML_SHARDING_CONDITIONS
# - !BROADCAST
# tables:
# - t_address
@@ -0,0 +1,92 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
######################################################################################################
#
# If you want to configure governance, authorization and proxy properties, please refer to this file.
#
######################################################################################################
# mode:
# type: Cluster
# repository:
# type: ZooKeeper
# props:
# namespace: governance_ds
# server-lists: localhost:2181
# retryIntervalMilliseconds: 500
# timeToLiveSeconds: 60
# maxRetries: 3
# operationTimeoutMilliseconds: 500
authority:
users:
- user: root@%
password: root
- user: sharding
password: sharding
privilege:
type: ALL_PERMITTED
transaction:
defaultType: XA
providerType: Atomikos
sqlParser:
sqlCommentParseEnabled: false
sqlStatementCache:
initialCapacity: 2000
maximumSize: 65535
parseTreeCache:
initialCapacity: 128
maximumSize: 1024
logging:
loggers:
- loggerName: ShardingSphere-SQL
additivity: true
level: INFO
props:
enable: false
sqlFederation:
sqlFederationEnabled: false
executionPlanCache:
initialCapacity: 2000
maximumSize: 65535
props:
system-log-level: INFO
max-connections-size-per-query: 1
kernel-executor-size: 16 # Infinite by default.
proxy-frontend-flush-threshold: 128 # The default value is 128.
# sql-show is the same as props in logger ShardingSphere-SQL, and its priority is lower than logging rule
sql-show: false
check-table-metadata-enabled: false
# Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
# The default value is -1, which means set the minimum value for different JDBC drivers.
proxy-backend-query-fetch-size: -1
proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
proxy-default-port: 3307 # Proxy default port.
proxy-netty-backlog: 1024 # Proxy netty backlog.
cdc-server-port: 33071 # CDC server port
proxy-frontend-ssl-enabled: false
proxy-frontend-ssl-cipher: ''
proxy-frontend-ssl-version: TLSv1.2,TLSv1.3
二进制文件未显示。
+5
查看文件
@@ -0,0 +1,5 @@
# 说明
自行下载 `skywalking` 官方 `agent` 将内容解压到当前文件夹下(注意解压不要带其他文件夹包裹 应直接把具体的agent程序解压到文件夹下)
当前推荐版本:`9.6.0`
+310
查看文件
@@ -0,0 +1,310 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)"
COMPOSE_FILE="${SCRIPT_DIR}/docker-compose.local.yml"
NACOS_URL="http://127.0.0.1:8848/nacos"
NACOS_USERNAME="nacos"
NACOS_PASSWORD="AixunNacos2026!"
REDIS_PASSWORD="aixun123"
UTF8_CACHE_MIGRATION_MARKER="aixun:migration:utf8-cache-v1"
require_command() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "缺少必需命令:$1" >&2
exit 1
fi
}
require_command docker
require_command curl
require_command java
require_command node
redis_cli() {
docker exec aixun-admin-redis redis-cli \
-a "${REDIS_PASSWORD}" --no-auth-warning "$@"
}
redis_delete_pattern() {
local pattern="$1"
local cache_key
while IFS= read -r cache_key; do
if [ -n "${cache_key}" ]; then
redis_cli DEL "${cache_key}" >/dev/null
fi
done < <(redis_cli --scan --pattern "${pattern}")
}
clear_legacy_utf8_caches_once() {
if [ "$(redis_cli GET "${UTF8_CACHE_MIGRATION_MARKER}")" = "done" ]; then
return
fi
echo "清理旧版本遗留的中文派生缓存和登录会话(仅首次执行)"
for pattern in \
'sys_dict' \
'sys_dict_type' \
'sys_dept' \
'sys_dept_and_child' \
'sys_user_name' \
'sys_nickname' \
'sys_config' \
'global:sys_client' \
'global:sys_oss*' \
'Authorization:login:*' \
'Authorization:var:*' \
'online_tokens:*' \
'redisson__*:{sys_*}' \
'redisson__*:{global:sys_*}' \
'{sys_*}:redisson_options' \
'{global:sys_*}:redisson_options'; do
redis_delete_pattern "${pattern}"
done
redis_cli SET "${UTF8_CACHE_MIGRATION_MARKER}" done >/dev/null
}
wait_for_business_services() {
local services=(
aixun-auth
aixun-gateway
aixun-system
aixun-gen
aixun-resource
aixun-workflow
aixun-demo
)
local service_name
local service_response
local ready_count
for _ in $(seq 1 120); do
ready_count=0
for service_name in "${services[@]}"; do
service_response="$(curl -fsS -G "${NACOS_URL}/v3/admin/ns/instance/list" \
-H "accessToken: ${access_token}" \
--data-urlencode "serviceName=${service_name}" \
--data-urlencode "groupName=DEFAULT_GROUP" \
--data-urlencode "namespaceId=public" 2>/dev/null || true)"
if printf '%s' "${service_response}" | grep -Eq '"code"[[:space:]]*:[[:space:]]*0' &&
printf '%s' "${service_response}" | grep -Eq '"healthy"[[:space:]]*:[[:space:]]*true' &&
printf '%s' "${service_response}" | grep -Eq '"enabled"[[:space:]]*:[[:space:]]*true'; then
ready_count=$((ready_count + 1))
fi
done
if [ "${ready_count}" -eq "${#services[@]}" ]; then
return
fi
sleep 2
done
echo "业务服务未在规定时间内全部注册到 Nacos:" >&2
for service_name in "${services[@]}"; do
service_response="$(curl -fsS -G "${NACOS_URL}/v3/admin/ns/instance/list" \
-H "accessToken: ${access_token}" \
--data-urlencode "serviceName=${service_name}" \
--data-urlencode "groupName=DEFAULT_GROUP" \
--data-urlencode "namespaceId=public" 2>/dev/null || true)"
if ! printf '%s' "${service_response}" | grep -Eq '"healthy"[[:space:]]*:[[:space:]]*true'; then
echo " - ${service_name}" >&2
fi
done
exit 1
}
wait_for_direct_service_ports() {
local service_ports=(8080 9210 9201 9202 9204 9205 9401)
local port
local http_code
local ready_count
for _ in $(seq 1 120); do
ready_count=0
for port in "${service_ports[@]}"; do
http_code="$(curl -sS --max-time 2 -o /dev/null -w '%{http_code}' \
"http://127.0.0.1:${port}/actuator/health" 2>/dev/null || true)"
case "${http_code}" in
200|401|403)
ready_count=$((ready_count + 1))
;;
esac
done
if [ "${ready_count}" -eq "${#service_ports[@]}" ]; then
return
fi
sleep 2
done
echo "以下业务端口未在规定时间内就绪:" >&2
for port in "${service_ports[@]}"; do
http_code="$(curl -sS --max-time 2 -o /dev/null -w '%{http_code}' \
"http://127.0.0.1:${port}/actuator/health" 2>/dev/null || true)"
case "${http_code}" in
200|401|403) ;;
*) echo " - ${port}" >&2 ;;
esac
done
exit 1
}
wait_for_gateway_route() {
local response
for _ in $(seq 1 60); do
response="$(curl -fsS "http://127.0.0.1/prod-api/auth/code" 2>/dev/null || true)"
if printf '%s' "${response}" | grep -Eq '"code"[[:space:]]*:[[:space:]]*200'; then
return
fi
sleep 1
done
echo "网关或认证路由未在规定时间内就绪,请检查 aixun-admin-gateway 与 aixun-admin-auth 日志。" >&2
exit 1
}
if ! docker info >/dev/null 2>&1; then
echo "Docker 尚未启动。" >&2
exit 1
fi
if [ "${AIXUN_SKIP_BUILD:-0}" = "1" ]; then
echo "[1/7] 跳过后端构建(AIXUN_SKIP_BUILD=1)"
echo "[2/7] 跳过前端构建(AIXUN_SKIP_BUILD=1)"
else
echo "[1/7] 构建后端"
"${PROJECT_DIR}/mvnw" -f "${PROJECT_DIR}/pom.xml" clean package -DskipTests
echo "[2/7] 安装并构建前端"
(
cd "${PROJECT_DIR}/aixun-ui"
if command -v pnpm >/dev/null 2>&1; then
pnpm install --frozen-lockfile
pnpm build
elif command -v corepack >/dev/null 2>&1; then
corepack pnpm install --frozen-lockfile
corepack pnpm build
elif command -v npm >/dev/null 2>&1; then
npm exec --yes pnpm@10.34.5 -- install --frozen-lockfile
npm exec --yes pnpm@10.34.5 -- build
else
echo "缺少 Node.js 包管理工具,请安装 pnpm、Corepack 或 npm。" >&2
exit 1
fi
)
fi
echo "[3/7] 启动 MySQL、Redis、Nacos"
docker compose -f "${COMPOSE_FILE}" up -d mysql redis nacos
echo "[4/7] 等待 MySQL、Redis、Nacos 就绪并校验中文数据"
for _ in $(seq 1 90); do
mysql_health="$(docker inspect aixun-admin-mysql --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null || true)"
redis_health="$(docker inspect aixun-admin-redis --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null || true)"
nacos_health="$(docker inspect aixun-admin-nacos --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null || true)"
if [ "${mysql_health}" = "healthy" ] && [ "${redis_health}" = "healthy" ] && [ "${nacos_health}" = "healthy" ]; then
break
fi
sleep 2
done
if [ "$(docker inspect aixun-admin-mysql --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null || true)" != "healthy" ]; then
echo "MySQL 未在规定时间内就绪,请执行 docker logs aixun-admin-mysql 检查。" >&2
exit 1
fi
if [ "$(docker inspect aixun-admin-redis --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null || true)" != "healthy" ]; then
echo "Redis 未在规定时间内就绪,请执行 docker logs aixun-admin-redis 检查。" >&2
exit 1
fi
if [ "$(docker inspect aixun-admin-nacos --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null || true)" != "healthy" ]; then
echo "Nacos 未在规定时间内就绪,请执行 docker logs aixun-admin-nacos 检查。" >&2
exit 1
fi
chinese_seed_count="$(docker exec -e MYSQL_PWD='aixun123' aixun-admin-mysql \
mysql --default-character-set=utf8mb4 -uroot -N -e \
"SELECT COUNT(*) FROM aixun_admin.sys_user WHERE user_name='admin' AND nick_name='艾讯管理员' AND HEX(nick_name)='E889BEE8AEAFE7AEA1E79086E59198';")"
if [ "${chinese_seed_count}" != "1" ]; then
echo "MySQL 中文初始化数据校验失败。请勿继续使用当前数据卷,检查 SQL 与客户端字符集后重新初始化。" >&2
exit 1
fi
chinese_dict_count="$(docker exec -e MYSQL_PWD='aixun123' aixun-admin-mysql \
mysql --default-character-set=utf8mb4 -uroot -N -e \
"SELECT COUNT(*) FROM aixun_admin.sys_dict_data WHERE
(dict_type='sys_normal_disable' AND dict_value='0' AND dict_label='正常' AND HEX(dict_label)='E6ADA3E5B8B8') OR
(dict_type='sys_normal_disable' AND dict_value='1' AND dict_label='停用' AND HEX(dict_label)='E5819CE794A8') OR
(dict_type='sys_user_gender' AND dict_value='0' AND dict_label='男' AND HEX(dict_label)='E794B7') OR
(dict_type='sys_user_gender' AND dict_value='1' AND dict_label='女' AND HEX(dict_label)='E5A5B3') OR
(dict_type='sys_user_gender' AND dict_value='2' AND dict_label='未知' AND HEX(dict_label)='E69CAAE79FA5');")"
if [ "${chinese_dict_count}" != "5" ]; then
echo "MySQL 中文字典校验失败:应存在正常、停用、男、女、未知 5 个 UTF-8 标签。" >&2
exit 1
fi
clear_legacy_utf8_caches_once
"${SCRIPT_DIR}/audit-utf8.sh"
echo "[5/7] 初始化 Nacos 管理员并导入项目配置"
curl -fsS -X POST "${NACOS_URL}/v3/auth/user/admin" \
--data-urlencode "password=${NACOS_PASSWORD}" >/dev/null 2>&1 || true
login_response="$(curl -fsS -X POST "${NACOS_URL}/v3/auth/user/login" \
--data-urlencode "username=${NACOS_USERNAME}" \
--data-urlencode "password=${NACOS_PASSWORD}")"
access_token="$(printf '%s' "${login_response}" | sed -n 's/.*"accessToken"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
if [ -z "${access_token}" ]; then
echo "未能获取 Nacos access token。若复用旧数据卷,请确认管理员密码。" >&2
exit 1
fi
for config_file in \
application-common.yml \
datasource.yml \
aixun-auth.yml \
aixun-gateway.yml \
aixun-gen.yml \
aixun-resource.yml \
aixun-system.yml \
aixun-workflow.yml; do
response="$(curl -fsS -X POST "${NACOS_URL}/v3/admin/cs/config" \
-H "accessToken: ${access_token}" \
--data-urlencode "dataId=${config_file}" \
--data-urlencode "groupName=DEFAULT_GROUP" \
--data-urlencode "namespaceId=public" \
--data-urlencode "type=yaml" \
--data-urlencode "content@${PROJECT_DIR}/script/config/nacos/${config_file}")"
if ! printf '%s' "${response}" | grep -Eq '"code"[[:space:]]*:[[:space:]]*0|"data"[[:space:]]*:[[:space:]]*true'; then
echo "导入 ${config_file} 失败:${response}" >&2
exit 1
fi
done
echo "[6/7] 构建镜像并启动全部服务"
docker compose -f "${COMPOSE_FILE}" up -d --build
echo "[7/7] 等待业务服务注册、网关路由和运行缓存就绪"
wait_for_direct_service_ports
wait_for_business_services
wait_for_gateway_route
"${SCRIPT_DIR}/audit-utf8.sh"
echo
echo "AiXun-Admin v1.0 已启动:"
echo " 管理后台:http://localhost/"
echo " 登录账号:admin"
echo " 登录密码:admin123"
echo " Nacos:http://localhost:18080/"
echo " Nacos 账号:nacos"
echo " Nacos 密码:${NACOS_PASSWORD}"
echo
docker compose -f "${COMPOSE_FILE}" ps