Files
my-vault/01_Projects/Work/Government-Projects/Virtual-Data-Center/prod.md
T

2162 lines
49 KiB
Markdown

# 广州市虚拟数据中心二、三级总线部署
## 部署架构图
![image-20220210150915590](https://s2.loli.net/2022/02/10/7kdRmTjSIaKqrOE.png)
## CMDB信息:
### 二级中心(荔湾):10.196.76.87
#### 访问地址
http://10.194.67.122:8081
#### Nginx代理配置
IP地址:10.194.67.122
```shell
#配置文件地址
/opt/nginx/conf/nginx.conf
#配置信息
server {
listen 8081;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root html;
# index index.html index.htm;
#}
#charset koi8-r;
location ^~ /rancher/ {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.194.67.123/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.196.76.87:92/;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
```
#### Redis配置信息
IP地址:10.196.76.87
端口:6379
```shell
#Redis启动
docker run --name gzzn-redis -p 6379:6379 -d redis:latest
#配置信息
密码:gZzN2022#
##设置密码命令
config set requirepass gZzN2022#
```
#### Zookeeper配置信息
IP地址: 10.194.67.161,10.194.67.162,10.194.67.163
端口:2181
```shell
#zookeeper启动
#zookeeper配置路径
/opt/zookeeper-3.4.11/conf/zoo.cfg
#zookeeper关键配置
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is store
# do not use /tmp for storage, /tmp here is just
# example sakes.
#dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
dataDir=/opt/zookeeper-3.4.11/zkData
logDir=/opt/zookeeper-3.4.11/logs
server.1=10.196.76.87:2888:3888
```
#### Kafka配置信息
IP地址:10.194.67.161,10.194.67.162,10.194.67.163
端口:9092
```shell
#Kafka启动
nohup /opt/kafka_2.12-1.0.0/bin/kafka-server-start.sh /opt/kafka_2.12-1.0.0/config/server.properties > /dev/null 2>&1 &
#Kafka配置路径
/opt/kafka_2.12-1.0.0/config/server.properties
#Kafka 关键配置
host.name=10.196.76.87
advertised.host.name=10.196.76.87
advertised.listeners=PLAINTEXT://10.196.76.87:9092
zookeeper.connect=10.196.76.87:2181
```
#### MYSQL配置信息
IP地址:10.196.76.90
端口:3306
```shell
#账号密码
库名:zmsm_lw
账号:zmsmlw
密码:gzzN@2022
```
#### APPS应用配置信息
##### zms
###### 基本配置
```shell
#ZMS 启动
/opt/gzzn/apps/zms/start.sh
#ZMS 配置路径
/opt/gzzn/apps/zms/conf
#ZMS 配置文件
app.conf
application.conf
kafkaReceiverMessage.properties
kafkaSenderMessage.properties
```
###### 关键配置
```shell
app.conf
#本环境是荔湾二级信息中心的生产环境
kafkaReceiverMessage=[
"bootstrap.servers=10.194.67.161:9092,10.194.67.162:9092,10.194.67.163:9092"
"enable.auto.commit=false"
"auto.commit.interval.ms=1000"
"max.poll.records=1"
"connections.max.idle.ms=3600000"
"key.deserializer=org.apache.kafka.common.serialization.StringDeserializer"
"value.deserializer=org.apache.kafka.common.serialization.StringDeserializer"
"custom_seek_last_offset=false"
"auto.offset.reset=latest"
]
kafkaSenderMessage=[
"bootstrap.servers=10.194.67.161:9092,10.194.67.162:9092,10.194.67.163:9092"
"acks=1"
"retries=2"
"retry.backoff.ms=100"
"batch.size=1"
"linger.ms=1"
"buffer.memory=2097152"
"key.serializer=org.apache.kafka.common.serialization.StringSerializer"
"value.serializer=org.apache.kafka.common.serialization.StringSerializer"
"request.timeout.ms=3000"
]
```
```shell
application.conf
#本环境是荔湾二级信息中心的生产环境
zmsSettings {
// Server address.
mainPipelineListenAddress = 0.0.0.0
mainPipelineListenAddress = ${?SERVER_LISTEN_ADDRESS}
// Server listen port.
mainPipelineListenPort = 80
mainPipelineListenPort = ${?SERVER_LISTEN_PORT}
// manager server address.
managerPipelineListenAddress = 0.0.0.0
managerPipelineListenAddress = ${?MANAGER_SERVER_LISTEN_ADDRESS}
// manager server listen port.
managerPipelineListenPort = 8081
managerPipelineListenPort = ${?MANAGER_SERVER_LISTEN_PORT}
// unicast server address.
unicastServerAddress = 0.0.0.0
unicastServerAddress = ${?UNICAST_SERVER_ADDRESS}
// unicast server listen port.
unicastServerPort = 6868
unicastServerPort = ${?UNICAST_SERVER_PORT}
// unicast server timeout connection second.
unicastServerTimeoutConnection = 15
unicastServerTimeoutConnection = ${?UNICAST_SERVER_TIMEOUT_CONNECTION}
// Monitoring domain name of root
jmxDomain = "com.gzzn.zms"
//初始化环境开关 remote or local
initEnvironmentSwitch = "remote"
//加载远程地址
initEnvironmentRemoteURL = "http://10.196.76.87:82/zmsm/initEnvironment"
//加载本地配置
//windows C://xxx.json
//linux /opt/xxx.json
initEnvironmentLocalPath = "/opt/gzzn/apps/zms/conf/initEnvironment.json"
//拉取 zmsm dynamicClassLoader配置
dynamicClassLoaderConfigURL = "http://10.196.76.87:82/zmsm/sdk/getDynamicClassLoaderConfig?"
//类加载器加载的配置,用来做avro内容校验功能
dynamicClassLoader {
blobType = "quename^v1"
mainQualifiedName = "com.gzzn.avro.test.model.ObjectIsNullModel"
qualifiedNames = [ "com.gzzn.avro.test.model.Apple" , "com.gzzn.avro.test.model.ObjectIsNullModel" ]
classFilePaths = [ "C:/Users/admin/Desktop/v1/Apple.txt" ,"C:/Users/admin/Desktop/v1/ObjectIsNullModel.txt" ]
}
//schema registry conf
schemaRegistry {
ip = "10.196.76.79"
port = "8899"
}
// Kafka conf
kafka {
client {
brokers = "10.194.67.161:9092,10.194.67.162:9092,10.194.67.163:9092"
}
}
// jedis conf
jedis {
ip = "10.196.76.87"
port = 6379
database = 1
passWord = gZzN2022#
timeout = 3000
pool{
maxActive = 100
maxIdle = 50
maxWait = 1500
testOnBorrow = true
testOnReturn = true
}
}
// cluster session management
hazelcast {
group {
name = zmsAPPnewprod
password = 123456
}
network {
nic {
ip = "10.196.67.*"
enabled = false
}
}
eventMap {
name = "zms_event_map"
backupCount = 2
maxSize = 100
}
userDetailMap {
name = "zms_userDetail_map"
backupCount = 2
maxSize = 10000
}
topicsSet {
name = "zms_topics_set"
backupCount = 2
maxSize = 5000
}
topicSchemaMap {
name = "zms_topicSchema_map"
backupCount = 2
maxSize = 5000
}
groupIdsMap {
name = "zms_groupIds_map"
backupCount = 2
maxSize = 5000
}
groupIdsAckMap {
name = "groupids_ack_map"
backupCount = 2
maxSize = 5000
maxIdleSeconds = 300
}
groupIdsTimeoutMap {
name = "groupids_timeout_map"
backupCount = 2
maxSize = 5000
maxIdleSeconds = 600
}
}
// for kafka queue management
zookeeper {
address = "10.194.67.161:2181,10.194.67.162:2181,10.194.67.163:2181"
sessionTimeout = 2000
connectionTimeout = 2000
}
c3p0Mysql {
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://10.196.76.90:3306/zmsm_lw?useUnicode=true&characterEncoding=utf8"
username = "zmsmlw"
password = "gzzN@2022"
}
// core http framework
znetty {
transports {
mainPipeline {
http {
// set http connection keep-alive, default of HTTP/1.1
keepAlive = true
// Maximal number of bytes in a single request. The same value should be configured in nginx and Kafka.
maxContentLength = 2M
}
connection {
idleTimeout = 5 seconds
}
}
}
}
}
```
```shell
kafkaReceiverMessage.properties
#本环境是荔湾二级信息中心的生产环境
bootstrap.servers=10.194.67.161:9092,10.194.67.162:9092,10.194.67.163:9092
auto.offset.reset=latest
enable.auto.commit=false
auto.commit.interval.ms=1000
max.poll.records=1
connections.max.idle.ms=3600000
key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
value.deserializer=org.apache.kafka.common.serialization.StringDeserializer
custom_seek_last_offset=false
```
```shell
kafkaSenderMessage.properties
#本环境是荔湾二级信息中心的生产环境
bootstrap.servers=10.194.67.161:9092,10.194.67.162:9092,10.194.67.163:9092
#acks=0如果设置为零,则生产者将不会等待服务器的任何确认。该记录将立即添加到套接字缓冲区并被认为发送。在这种情况下,retries不能保证服务器已经收到记录,并且配置不会生效(因为客户端通常不会知道任何故障)。每个记录返回的偏移量将始终设置为-1。
#acks=1这将意味着领导者将记录写入其本地日志,但将在不等待所有关注者完全确认的情况下进行响应。在这种情况下,如果领导者在确认记录之后立即失败,但在追随者复制之前,该记录将丢失。
#acks=all这意味着领导者将等待全套同步副本来确认记录。只要至少有一个同步处理副本仍然存在,这将保证记录不会丢失。这是最强有力的保证。这相当于acks= -1设置。
acks=1
retries=2
batch.size=1
#延迟1毫秒
linger.ms=1
#一次发送数据的总缓存
buffer.memory=2097152
key.serializer=org.apache.kafka.common.serialization.StringSerializer
value.serializer=org.apache.kafka.common.serialization.StringSerializer
request.timeout.ms=3000
```
---
##### zmsm
###### 基本配置
```shell
#ZMSM 启动
参考单容器实例启动命令或stack服务部署
#ZMSM 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/zmsm/config/application-pro.yml
#ZMSM 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/zmsm/config/application.yml
```
###### 关键配置
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.zmsm: debug
file: logs/zmsm.log
spring:
datasource:
zmsm:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1
testWhileIdle: true
testOnBorrow: true
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
zms:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&autoReconnect=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1
testWhileIdle: true
testOnBorrow: true
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
ZmsBusinessApi:
path: /opt/gzzn/apps/zms-business-api-master/src/main/avro/
dir: /opt/gzzn/apps/zms-business-api-master/target
buildPath: /opt/gzzn/apps/zms-business-api-master
copyFileDir: /opt/gzzn/apps/zms-business-api-jar
sysApi:
userDetailListUrl: http://10.196.76.87:86/setting/user/detail/list
prometheus:
query_range_url: http://10.196.76.79:9090/api/v1/query_range
query_url: http://10.196.76.79:9090/api/v1/query
userUrl:
interfaceIp: http://10.196.76.87:8081
schemaUrl: http://10.196.76.79:8899
grafanaIp: http://10.196.76.79:3000/api/dashboards/db
grafanaHost: http://10.196.76.79:3000
logoutUrl: http://10.194.67.122:8080/logout
#生产环境107grafana密钥#
grafanaKey: Bearer eyJrIjoiRHZwdXliNjNJUDdFWms1TDZ1aWY1SVJzWkp5WGZYVmciLCJuIjoiYWRtaW4iLCJpZCI6MX0=
unicastPort: 6868
serviceUrl: http://10.196.76.87
dquality:
reportDir: /opt/myapp/dquality/reports/
workOrder:
updateResourceUrl: http://10.194.67.143:87/queue_resource/updateResourceWithOrderNoAndQueueName
```
---
##### sysapi
###### 基本配置
```shell
#sysapi启动
参考单容器实例启动命令或stack服务部署
#sysapi 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/sysapi/config/application-pro.yml
#sysapi 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/sysapi/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
#环境说明
#dev--内网开发环境
#local--开发机器环境
#test--测试环境(客户机器)
#pro---生产环境(客户机器)
spring:
profiles:
active: pro
resources:
static-locations: classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/templates/
server:
tomcat:
max-threads: 2000
mybatis:
config-locations: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.gzzn.sysapi.entity
logging:
level:
root: info
com.gzzn.sysapi.dao: debug
file: logs/sysapi.log
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.vdcapi.dao: debug
file: logs/sysapi.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
sysApi:
elkHost: 192.168.46.141:4569
rancher:
host: http://10.194.67.123
adminAccount: rancher
adminPass: gzzn
```
---
##### oauthapi
###### 基本配置
```shell
#oauthapi 启动
参考单容器实例启动命令或stack服务部署
#oauthapi 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/oauthapi/config/application-prod.yml
#oauthapi 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/oauthapi/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
spring:
profiles:
active: prod
oauthApi:
tokenExpireTime: 3600000
jedis:
pool:
maxActive: 100
maxIdle: 50
maxWait: 1500
testOnBorrow: true
testOnReturn: true
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
redis:
host: 10.196.76.87
port: 6379
passWord: gZzN2022#
timeout: 3000
oauthApi:
elkHost: 192.168.46.141:4569
```
#####
---
##### vdcapi
###### 基本配置
```shell
#vdcapi 启动
参考单容器实例启动命令或stack服务部署
#vdcapi 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/vdcapi/config/application-pro.yml
#vdcapi 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/vdcapi/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
#环境说明
#dev--内网开发环境
#local--开发机器环境
#test--测试环境(客户机器)
#pro---生产环境(客户机器)
spring:
profiles:
active: pro
resources:
static-locations: classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/templates/
jpa:
database: MYSQL
show-sql: true
hibernate:
ddl-auto: update
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
dialect: org.hibernate.dialect.MySQL5Dialect
server:
tomcat:
max-threads: 2000
logging:
level:
org.springframework.scheduling: info
mybatis:
config-locations: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
total:
vdc:
res:
upSpeed: 10000
downSpeed: 10000
storeage: 50000
cpu: 256
mem: 1000
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.vdcapi.dao: debug
file: logs/vdcapi.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
sysApi:
host: http://10.196.76.87:86
userDetailListUrl: ${sysApi.host}/setting/user/detail/list
vdcapi:
config:
#信息中心的rancher账号信息
rancher:
username: xxzx
password: xxzx
elkHost: 192.168.46.141:4569
zdgovapi:
host: http://10.196.76.87:84
refreshUrl: ${zdgovapi.host}/tasks/sync/refresh
initUrl: ${zdgovapi.host}/tasks/sync/init
immediateUrl: ${zdgovapi.host}/tasks/sync/immediate
dsjpt:
host: http://10.196.76.87:94
refreshUrl: ${dsjpt.host}/tasks/sync/refresh
initUrl: ${dsjpt.host}/tasks/sync/init
immediateUrl: ${dsjpt.host}/tasks/sync/immediate
```
---
##### xnsj-gateway
###### 基本配置
```shell
#xnsj-gateway 启动
参考单容器实例启动命令或stack服务部署
#xnsj-gateway 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/xnsj-gateway/config/application-pro.yml
#xnsj-gateway 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/xnsj-gateway/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
#环境说明
#dev--内网开发环境
#local--开发机器环境
#test--测试环境(客户机器)
#pro---生产环境(客户机器)
mybatis:
config-locations: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.gzzn.gateway.entity
server:
tomcat:
max-threads: 2000
spring:
profiles:
active: pro
mvc:
static-path-pattern: /**
resources:
static-locations: classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/templates/,file:${my.custom.static}
servlet:
load-on-startup: 1
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 50000
remote:
maxTotalConnect: 30
maxConnectPerRoute: 200
connectTimeout: 5000
readTimeout: 30000
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.gateway.dao: debug
file: logs/xnsj-gateway.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
my:
custom:
static: /opt/myapp/static/
zuul:
host:
connect-timeout-millis: 20000
socket-timeout-millis: 60000
routes:
zmsm:
url: http://10.196.76.87:82/zmsm
vdcapi:
url: http://10.196.76.87:83
dgovapi:
url: http://10.196.76.87:84
sysapi:
url: http://10.196.76.87:86
woapi:
url: http://10.196.76.87:87
dholographyapi:
url: http://10.196.76.87:88
zmsmapi:
url: http://10.196.76.87:89
dquality:
url: http://10.196.76.87:90
oauthapi:
url: http://10.196.76.87:91
reportapi:
url: http://10.196.76.87:93
oauthApi:
attainTokenUrl: http://10.196.76.87:91/token
refreshTokenUrl: http://10.196.76.87:91/token/refresh
local:
login:
#不进拦截的文件类型/地址 根据endWith判断
unInterceptMethod: /logout,/loginCheck,/login.html,.css,.js,.jpg,.png,.ico,.gif,.jpeg,.bmp,.tiff,.mpeg,.doc,.docx,/login_guide_step1.html,/login_guide_step2.html,/login_guide_step3.html,.js.map,.scss,.less,.txt,.eot,.svg,.ttf,.woff,.woff2,.otf
nginxAddr: http://10.196.76.87:92
ssoIframeUrl: https://172.16.13.103/caunion/tp_login.jsp?response_type=token&client_id=tyrz_virtdata_1031&scope=sn&redirect_uri=http://10.196.76.87:92/index
ssoTokenValidUrl: http://172.16.13.103/caunion/oauth2/tokeninfo?access_token={access_token}
ssoRegisterUrl: https://172.16.13.103/caunion/combinedauth/unify/reg.do?ret=index&userType=0
ssoLogoutUrl: https://172.16.13.103/caunion/logout.do?service=http://10.194.67.122:8080/index
```
---
##### zmsmapi
###### 基本配置
```shell
#zmsmapi 启动
参考单容器实例启动命令或stack服务部署
#zmsmapi 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/zmsmapi/config/application-pro.yml
#zmsmapi 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/zmsmapi/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
#环境说明
#dev--内网开发环境
#local--开发机器环境
#test--测试环境(客户机器)
#pro---生产环境(客户机器)
spring:
profiles:
active: pro
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.gzzn.zmsmapi.entity
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.zmsmapi.dao: debug
file: logs/zmsmapi.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
sysApi:
userDetailListUrl: http://10.196.76.87:86/setting/user/detail/list
Prometheus:
host: http://10.196.76.79:9090
query_range: /api/v1/query_range
query: /api/v1/query
#最近多少分钟无接收及发送量
lastTime: 60
grafana:
host: http://10.196.76.79:3000
dashboardsUrl: /api/dashboards/db
grafanaKey: Bearer eyJrIjoiRHZwdXliNjNJUDdFWms1TDZ1aWY1SVJzWkp5WGZYVmciLCJuIjoiYWRtaW4iLCJpZCI6MX0=
```
---
##### woapi
###### 基本配置
```shell
#woapi 启动
参考单容器实例启动命令或stack服务部署
#woapi 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/woapi/config/application-pro.yml
#woapi 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/woapi/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
#环境说明
#dev--内网开发环境
#local--开发机器环境
#test--测试环境(客户机器)
#pro---生产环境(客户机器)
spring:
profiles:
active: pro
http:
multipart:
enabled: true
max-file-size: 10MB
max-request-size: 10MB
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.gzzn.woapi.entity
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
version: '1'
services:
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch:6.4.0'
ports:
- ${public_port}:${public_port}
kibana:
image: 'docker.elastic.co/elasticsearch/kibana:6.4.0'
ports:
- ${public_port}:${public_port}
depends_on:
- elasticsearch
links:
- elasticsearch:elasticsearch
logstash:
image: docker.elastic.co/elasticsearch/logstash:6.4.0
ports:
- ${public_port}:${public_port}
- ${public_port}:${public_port}
links:
- elasticsearch:elasticsearch
depends_on:
- elasticsearch
environment:
- 'input { tcp { port=> 4569 codec=>"json"} } output { elasticsearch { action => "index" hosts => ["elasticsearch:9200"] } }'
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.woapi.dao: debug
file: logs/woapi.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
sysApi:
userDetailListUrl: http://10.196.76.87:86/setting/user/detail/list
getOrg: http://10.196.76.87:86/setting/organization/getById/{id}
zdgov:
syncResouceUrl: http://10.196.76.87:84/resource_list
vdcApi:
getInstances: http://10.196.76.87:83/instances/orgCode/{orgCode}
updateInstance: http://10.196.76.87:83/instances/update
addInstance: http://10.196.76.87:83/instances/add
updateInstanceStatusById: http://10.196.76.87:83/instances/{id}/deployStatus
workOrderType:
busCreate: BUS_CR
busCreateProcessName: bus_create_workorder
busCancel: BUS_CA
busCancelProcessName: bus_cancel_workorder
vdcCreate: VDC_CR
vdcCreateProcessName: vdc_create_workorder
vdcCancel: VDC_CA
vdcCancelProcessName: vdc_cancel_workorder
vdcChange: VDC_CH
vdcChangeProcessName: vdc_change_workorder
queueShare: QUE_SH
queueShareProcessName: queue_share_workorder
queueReceive: QUE_RE
queueReceiveProcessName: queue_receive_workorder
queueReceiveCancel: QUE_RC
queueReceiveCancelProcessName: queue_receive_cancel_workorder
queueChange: QUE_CH
queueChangeProcessName: queue_change_workorder
queueCancel: QUE_CA
queueCancelProcessName: queue_cancel_workorder
```
---
##### dgovapi
###### 基本配置
```shell
#dgovapi 启动
参考单容器实例启动命令或stack服务部署
#dgovapi 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/dgovapi/config/application-pro.yml
#dgovapi 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/dgovapi/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
#环境说明
#dev--内网开发环境
#local--开发机器环境
#test--测试环境(客户机器)
#pro---生产环境(客户机器)
spring:
profiles:
active: pro
logging:
level:
org.springframework.scheduling: info
mybatis:
config-locations: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.gzzn.zdgov.entity
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
zdgov:
mainDataModel:
physicalTablePrefix: dgov_py
zmsBusSynEnable: false
zmsBusSchedule: 0 0 11 * * ?
zmsBusPerRecords: 100
zmsBusMaxRecords: 10000
metaData_oracle:
dataSource:
driver: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@130.120.2.219:1521/orcl
name: dc0124
password: 123456
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
file: logs/zdgov.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
validation-query: SELECT 1
sysApi:
host: http://10.196.76.87:86
userDetailListUrl: ${sysApi.host}/setting/user/detail/list
userSelectByIdUrl: ${sysApi.host}/setting/user/selectByIds
zdgov:
elkHost: 192.168.46.141:4569
#不需要关联全量资源目录
zmsBusSynUrl: http://192.168.0.1:8081/fullres-api/resource/resourceDataSync
#资源目录初始化接口
#不需要关联全量资源目录
zmsBusInitUrl: http://192.168.0.1:8081/fullres-api/resource/resourceDataInit
```
---
##### sync-dsjpt
###### 基本配置
```shell
#sync-dsjpt 启动
参考单容器实例启动命令或stack服务部署
#sync-dsjpt 配置路径(生产) -- 实际配置参数
/opt/gzzn/apps/sync-dsjpt/config/application-pro.yml
#sync-dsjpt 一级配置路径(生产) -- 决定使用的配置脚本模板(生产采用pro)
/opt/gzzn/apps/sync-dsjpt/config/application.yml
```
###### 关键配置
```yaml
application.yml
#本环境是荔湾二级信息中心的生产环境
spring:
profiles:
active: pro
mybatis:
config-locations: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.gzzn.dholography.entity
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
server:
port: 8080
```
```yaml
application-pro.yml
#本环境是荔湾二级信息中心的生产环境
logging:
level:
root: info
com.gzzn.zms.sync.dsjpt.dao: debug
file: logs/zms_sync_dsjpt.log
druid:
url: jdbc:mysql://10.196.76.90:3306/zmsm_lw?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: zmsmlw
password: gzzN@2022
driver: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
#dsjpt datasource
mysqlConfig:
driverClassName: "com.mysql.jdbc.Driver"
url: "jdbc:mysql://10.194.67.2:3306/znrzgjdb?useUnicode=true&characterEncoding=utf8"
username: "znrzgjdb"
password: "znrzgjDB@0788"
```
---
#### 单容器实例服务启动命令
```shell
#
docker run -d -p 94:8080 --restart unless-stopped -v /opt/gzzn/apps/sync-dsjpt:/opt/myapp --name sync-dsjpt gzzn/springboot
#
docker run -d -p 84:8080 --restart unless-stopped -v /opt/gzzn/apps/dgovapi:/opt/myapp --name dgovapi gzzn/springboot
#
docker run -d -p 83:8080 --restart unless-stopped -v /opt/gzzn/apps/vdcapi:/opt/myapp --name vdcapi gzzn/springboot
#
docker run -d -p 87:8080 --restart unless-stopped -v /opt/gzzn/apps/woapi:/opt/myapp --name woapi gzzn/springboot
#
docker run -d -p 89:8080 --restart unless-stopped -v /opt/gzzn/apps/zmsmapi:/opt/myapp --name zmsmapi gzzn/springboot
#
docker run -d -p 82:8080 --restart unless-stopped -v /opt/gzzn/apps/zmsm:/opt/myapp --name zmsm gzzn/zmsm
#
docker run -d -p 91:8080 --restart unless-stopped -v /opt/gzzn/apps/oauthapi:/opt/myapp --name oauthapi gzzn/springboot
#
docker run -d -p 92:8080 --restart unless-stopped -v /opt/gzzn/apps/xnsj-gateway:/opt/myapp --name xnsj-gateway gzzn/springboot
#
docker run -d -p 86:8080 --restart unless-stopped -v /opt/gzzn/apps/sysapi:/opt/myapp --name sysapi gzzn/springboot
```
#### Docker Stack服务管理脚本
###### 服务启动
```shell
#建立docker swarm集群
docker swarm init
#通过stack部署(本地仓库,不解析远程仓库接口,提高部署速度)
docker stack deploy --resolve-image never -c docker-stack.yml lwxnsj
```
###### 脚本模板
```yaml
version: '3.0'
services:
xnsj-gateway:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "92:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/xnsj-gateway:/opt/myapp
vdcapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "83:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/vdcapi:/opt/myapp
dgovapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "84:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/dgovapi:/opt/myapp
sync-dsjpt:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "94:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/sync-dsjpt:/opt/myapp
woapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "87:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/woapi:/opt/myapp
zmsmapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "89:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/zmsmapi:/opt/myapp
zmsm:
image: "gzzn/zmsm:latest"
networks:
- xnsjlw
ports:
- "82:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/zmsm:/opt/myapp
oauthapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "91:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/oauthapi:/opt/myapp
sysapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "86:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/sysapi:/opt/myapp
networks:
xnsjlw:
ipam:
config:
- subnet: 132.19.0.0/16
```
---
### 三级中心(荔湾逢源街):10.194.67.161
#### 访问地址
http://10.194.67.122:8188
#### Nginx代理配置
IP地址:10.194.67.122
```shell
#配置文件地址
/opt/nginx/conf/nginx.conf
#配置信息
server {
listen 8188;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root html;
# index index.html index.htm;
#}
#charset koi8-r;
location ^~ /rancher/ {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.194.67.123/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.194.67.161:92/;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
```
#### Redis配置信息
IP地址:10.194.67.162
端口:6379
```shell
#Redis启动
docker run --name gzzn-redis -p 6379:6379 -d redis:latest
#配置信息
密码:gZzN2022#
##设置密码命令
config set requirepass gZzN2022#
```
#### Zookeeper配置信息
IP地址: 10.194.67.161,10.194.67.162,10.194.67.163
端口:2181
```shell
#zookeeper启动
/opt/zookeeper-3.4.11/bin/zkServer.sh start
#zookeeper关闭
/opt/zookeeper-3.4.11/bin/zkServer.sh stop
#zookeeper关键配置
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is store
# do not use /tmp for storage, /tmp here is just
# example sakes.
#dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
dataDir=/opt/zookeeper-3.4.11/zkData
logDir=/opt/zookeeper-3.4.11/logs
server.1=10.196.76.87:2888:3888
```
#### Kafka配置信息
IP地址:10.194.67.161,10.194.67.162,10.194.67.163
端口:9092
```shell
#Kafka启动
nohup /opt/kafka_2.12-1.0.0/bin/kafka-server-start.sh /opt/kafka_2.12-1.0.0/config/server.properties > /dev/null 2>&1 &
#Kafka配置路径
/opt/kafka_2.12-1.0.0/config/server.properties
#Kafka 关键配置
host.name=10.196.76.87
advertised.host.name=10.196.76.87
advertised.listeners=PLAINTEXT://10.196.76.87:9092
zookeeper.connect=10.194.67.161:2181,10.194.67.162:2181,10.194.67.163:2181
```
#### MYSQL配置信息
IP地址:10.196.76.90
端口:3306
```shell
#账号密码
库名:zmsm_lw_fengyuan
账号:zmsmlwfy
密码:gzzN@2022
```
#### Docker Stack服务管理脚本
###### 服务启动
```shell
#建立docker swarm集群
docker swarm init
#通过stack部署(本地仓库,不解析远程仓库接口,提高部署速度)
docker stack deploy --resolve-image never -c docker-stack.yml lwbhdxnsj
```
###### 脚本模板
```yaml
version: '3.0'
services:
xnsj-gateway:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "92:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/xnsj-gateway:/opt/myapp
vdcapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "83:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/vdcapi:/opt/myapp
dgovapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "84:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/dgovapi:/opt/myapp
sync-dsjpt:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "94:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/sync-dsjpt:/opt/myapp
woapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "87:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/woapi:/opt/myapp
zmsmapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "89:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/zmsmapi:/opt/myapp
zmsm:
image: "gzzn/zmsm:latest"
networks:
- xnsjlw
ports:
- "82:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/zmsm:/opt/myapp
oauthapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "91:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/oauthapi:/opt/myapp
sysapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "86:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/sysapi:/opt/myapp
networks:
xnsjlw:
ipam:
config:
- subnet: 132.19.0.0/16
```
---
### 三级中心(荔湾白鹤洞街):10.194.67.162
#### 访问地址
http://10.194.67.122:8088
#### Nginx代理配置
IP地址:10.194.67.122
```shell
#配置文件地址
/opt/nginx/conf/nginx.conf
#配置信息
server {
listen 8088;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root html;
# index index.html index.htm;
#}
#charset koi8-r;
location ^~ /rancher/ {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.194.67.123/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.194.67.162:92/;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
```
#### Redis配置信息
IP地址:10.194.67.162
端口:6379
```shell
#Redis启动
docker run --name gzzn-redis -p 6379:6379 -d redis:latest
#配置信息
密码:gZzN2022#
##设置密码命令
config set requirepass gZzN2022#
```
#### Zookeeper配置信息
IP地址: 10.194.67.161,10.194.67.162,10.194.67.163
端口:2181
```shell
#zookeeper启动
/opt/zookeeper-3.4.11/bin/zkServer.sh start
#zookeeper关闭
/opt/zookeeper-3.4.11/bin/zkServer.sh stop
#zookeeper配置路径
/opt/zookeeper-3.4.11/conf/zoo.cfg
#zookeeper关键配置
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is store
# do not use /tmp for storage, /tmp here is just
# example sakes.
#dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
dataDir=/opt/zookeeper-3.4.11/zkData
logDir=/opt/zookeeper-3.4.11/logs
server.1=10.196.76.87:2888:3888
```
#### Kafka配置信息
IP地址:10.194.67.161,10.194.67.162,10.194.67.163
端口:9092
```shell
#Kafka启动
nohup /opt/kafka_2.12-1.0.0/bin/kafka-server-start.sh /opt/kafka_2.12-1.0.0/config/server.properties > /dev/null 2>&1 &
#Kafka配置路径
/opt/kafka_2.12-1.0.0/config/server.properties
#Kafka 关键配置
host.name=10.196.76.87
advertised.host.name=10.196.76.87
advertised.listeners=PLAINTEXT://10.196.76.87:9092
zookeeper.connect=10.194.67.161:2181,10.194.67.162:2181,10.194.67.163:2181
```
#### MYSQL配置信息
IP地址:10.196.76.90
端口:3306
```shell
#账号密码
库名:zmsm_lw_baihedong
账号:zmsmlwbhd
密码:gzzN@2022
```
#### Docker Stack服务管理脚本
###### 服务启动
```shell
#建立docker swarm集群
docker swarm init
#通过stack部署(本地仓库,不解析远程仓库接口,提高部署速度)
docker stack deploy --resolve-image never -c docker-stack.yml lwbhdxnsj
```
###### 脚本模板
```yaml
version: '3.0'
services:
xnsj-gateway:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "92:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/xnsj-gateway:/opt/myapp
vdcapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "83:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/vdcapi:/opt/myapp
dgovapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "84:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/dgovapi:/opt/myapp
sync-dsjpt:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "94:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/sync-dsjpt:/opt/myapp
woapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "87:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/woapi:/opt/myapp
zmsmapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "89:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/zmsmapi:/opt/myapp
zmsm:
image: "gzzn/zmsm:latest"
networks:
- xnsjlw
ports:
- "82:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/zmsm:/opt/myapp
oauthapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "91:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/oauthapi:/opt/myapp
sysapi:
image: "gzzn/springboot:latest"
networks:
- xnsjlw
ports:
- "86:8080"
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- /opt/gzzn/apps/sysapi:/opt/myapp
networks:
xnsjlw:
ipam:
config:
- subnet: 132.19.0.0/16
```
---
### 其它中心:10.196.76.89【部署中】
#### MYSQL配置信息
IP地址:10.196.76.90
端口:3306
```shell
#账号密码
库名:zmsm_other
账号:zmsmother
密码:gzzN@2022
```