if [ -f "/var/ftp/pub/tgcw-service-usermanagement/target/tgcw-service-usermanagement-0.0.1-SNAPSHOT.jar" ];then
ps -ef |grep tgcw-service-usermanagement-0.0.1-SNAPSHOT |awk '{print $2}'|xargs kill -9
echo "tgcw-service-usermanagement-0.0.1-SNAPSHOT进程被杀掉。"
cp /var/ftp/pub/tgcw-service-usermanagement/target/tgcw-service-usermanagement-0.0.1-SNAPSHOT.jar /tmp/tgcw/tgcw-service-usermanagement-0.0.1-SNAPSHOT.jar
nohup java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8003,suspend=n -jar /tmp/tgcw/tgcw-service-usermanagement-0.0.1-SNAPSHOT.jar> /dev/null 2>&1 &
nohup java -jar /tmp/tgcw/tgcw-service-usermanagement-0.0.1-SNAPSHOT.jar --spring.profiles.active=demo > /dev/null 2>&1 &
echo "tgcw-service-usermanagement-0.0.1-SNAPSHOT重新启动。"
rm /var/ftp/pub/tgcw-service-usermanagement/target/tgcw-service-usermanagement-0.0.1-SNAPSHOT.jar
else
echo "tgcw-service-usermanagement-0.0.1-SNAPSHOT文件不存在"
fi
----------------------------------------------------------------------------------------application-demo.yml
spring:
application:
name: tgcw-service-usermanagement
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
host: 10.11.63.209
port: 8000
password: GoldWind
database: 0
timeout: 0
pool:
max-active: 8
max-wait: -1
max-idle: 500
min-idle: 0
eureka:
client:
serviceUrl:
defaultZone: http://localhost:1110/eureka/
instance:
preferIpAddress: true
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
#注册服务默认心跳时间,默认是30秒,也就是每30秒会向Eureka Server发起Renew操作。
leaseRenewalIntervalInSeconds: 10
#服务失效时间。默认是90秒,也就是如果Eureka Server在90秒内没有接收到来自ServiceProvider的Renew操作,就会把Service Provider剔除。
leaseExpirationDurationInSeconds: 20
# eureka:
# client:
# register-with-eureka: false
# fetch-registry: false
server:
port: 8088
# contextPath: /tgcw-service-usermanagement
jwt:
header: www-Authorization
secret: goldwindtgcw
tokenHead: "Bearer "
access_token:
expiration: 604800
refresh_token:
expiration: 28800
management:
security:
enabled: false
health:
mail:
enabled: false
endpoints:
restart:
enabled: true
shutdown:
enabled: true
health:
sensitive: false
#datasource
druid:
datasource:
name: era
url: jdbc:postgresql://10.11.63.233:5432/fyz_demo
#url: jdbc:postgresql://10.11.63.223:5434/fyz_demo
username: fyz_demo
password: JzoY6zbz4Dp0bdhp
# 使用druid数据源
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: org.postgresql.Driver
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initialSize: 5
minIdle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
spring.datasource.filters: stat,wall,log4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 合并多个DruidDataSource的监控数据
#useGlobalDataSourceStat: true
# 默认mybatis配置
mybatis:
mapperLocations: classpath*:mapper/**/*Dao.xml
executor-type: REUSE
configuration:
map-underscore-to-camel-case: true
# logging配置,本地默认使用debug级别
logging:
level:
org:
mybatis: DEBUG
----------------------------------------------------------------------------------------application.yml
spring:
application:
name: tgcw-service-usermanagement
http:
encoding:
force: true
charset: UTF-8
enabled: true
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
host: 10.11.63.209
port: 8000
password: GoldWind
database: 0
timeout: 0
pool:
max-active: 8
max-wait: -1
max-idle: 500
min-idle: 0
#eureka:
# client:
# serviceUrl:
# defaultZone: http://10.11.63.215:1110/eureka/
# instance:
# preferIpAddress: true
# instance-id: ${spring.cloud.client.ipAddress}:${server.port}
eureka:
client:
register-with-eureka: false
fetch-registry: false
server:
port: 8088
contextPath: /tgcw-service-usermanagement
# feign:
# httpclient:
# enabled: true
jwt:
header: www-Authorization
secret: goldwindtgcw
tokenHead: "Bearer "
access_token:
expiration: 604800
refresh_token:
expiration: 28800
management:
security:
enabled: false
health:
mail:
enabled: false
endpoints:
restart:
enabled: true
shutdown:
enabled: true
health:
sensitive: false
# datasource:
# url: jdbc:postgresql://10.11.63.233:5432/fyz_dev
# username: fyz_dev
# password: 1mFak09P
# max-idle: 10
# max-wait: 10000
# min-idle: 5
# initial-size: 5
# validation-query: SELECT 1
# test-on-borrow: false
# test-while-idle: true
# time-between-eviction-runs-millis: 18800
# jdbc-interceptors: ConnectionState;SlowQueryReport(threshold=1000)
# driver-class-name: org.postgresql.Driver
#datasource
druid:
datasource:
name: era
url: jdbc:postgresql://10.11.63.233:5432/fyz_dev
#url: jdbc:postgresql://10.11.63.223:5434/fyz_dev
username: fyz_dev
password: 1mFak09P
# 使用druid数据源
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: org.postgresql.Driver
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initialSize: 5
minIdle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
spring.datasource.filters: stat,wall,log4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 合并多个DruidDataSource的监控数据
#useGlobalDataSourceStat: true
# 默认mybatis配置
mybatis:
mapperLocations: classpath*:mapper/**/*Dao.xml
executor-type: REUSE
configuration:
map-underscore-to-camel-case: true
# logging配置,本地默认使用debug级别
logging:
level:
org:
mybatis: DEBUG