From b4c4e34663e4e27acdc3563fe122ae66215b3bc0 Mon Sep 17 00:00:00 2001 From: wangjx <1609724385@qq.com> Date: Mon, 9 Aug 2021 16:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=95=B4=E7=90=86=E5=90=8E?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/NettyServerHandler.java | 6 -- src/main/resources/application.properties | 45 +++++++--- src/main/resources/bootstrap-dev.yaml | 10 --- src/main/resources/bootstrap-pro.yaml | 79 ----------------- src/main/resources/bootstrap-test.yaml | 87 ------------------- src/main/resources/bootstrap.yaml | 67 -------------- 6 files changed, 34 insertions(+), 260 deletions(-) delete mode 100644 src/main/resources/bootstrap-dev.yaml delete mode 100644 src/main/resources/bootstrap-pro.yaml delete mode 100644 src/main/resources/bootstrap-test.yaml diff --git a/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java b/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java index b275124..c3cc96d 100644 --- a/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java +++ b/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java @@ -72,12 +72,6 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { log.info("链接报告Port:" + channel.localAddress().getPort()); log.info("链接报告完毕"); //通知客户端链接建立成功 - // 默认返回取得时间成功 - // String ackAckCheckRef = "233E0101020004020A1D"; - //String ackAckCheckRef = "23 3E 01 01 02 00 04 21 29 3C"; - //ByteBuf buf = Unpooled.buffer(ackAckCheckRef.getBytes().length); - //buf.writeBytes(ackAckCheckRef.getBytes(CharsetUtil.UTF_8)); - //ctx.writeAndFlush(buf); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f168b0d..4abfccf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,15 +1,15 @@ -server.port=8105 +#server.port=8105 logging.config=classpath:log/logback-spring.xml logging.level.com.telpo.dipperposition.service.impl=DEBUG logging.level.com.telpo.dipperposition.service.mapper=DEBUG spring.application.name=dipperposition-service -spring.redis.database=1 -spring.redis.host=127.0.0.1 +#spring.redis.database=1 +#spring.redis.host=127.0.0.1 #8090 -spring.redis.port=6379 -spring.redis.password=telpo#1234 -spring.redis.timeout=3000 +#spring.redis.port=6379 +#pring.redis.password=telpo#1234 +#spring.redis.timeout=3000 spring.redis.lettuce.pool.max-active=100 # 连接池最大连接数(使用负值表示没有限制) spring.redis.lettuce.pool.max-idle=100 @@ -17,12 +17,35 @@ spring.redis.lettuce.pool.max-idle=100 spring.redis.lettuce.pool.min-idle=50 # 连接池中的最小空闲连接 spring.redis.lettuce.pool.max-wait=6000 +#设置redis集群的节点信息,其中namenode为域名解析,通过解析域名来获取相应的地址; +spring.redis.cluster.nodes=172.19.42.40:6372,172.19.42.40:6373,172.19.42.40:6374,172.19.42.41:6375,172.19.42.41:6376,\ + 172.19.42.41:6377 + +#设置key的生存时间,当key过期时,它会被自动删除 +spring.redis.cluster.expire-seconds=120 +#设置命令的执行时间,如果超过这个时间,则报错; +spring.redis.cluster.command-timeout=15000 +# 重试次数 +spring.redis.cluster.max-attempts=5 +# 跨集群执行命令时要遵循的最大重定向数量 +spring.redis.cluster.max-redirects=3 +# 连接池最大连接数(使用负值表示没有限制) +spring.redis.cluster.max-active=100 +# 连接池最大阻塞等待时间(使用负值表示没有限制) +spring.redis.cluster.max-wait=6000 +# 连接池中的最大空闲连接 +spring.redis.cluster.max-idle=50 +# 连接池中的最小空闲连接 +spring.redis.cluster.min-idle=0 +# 是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个 +spring.redis.cluster.test-on-borrow=true + # 连接池最大阻塞等待时间(使用负值表示没有限制) -spring.data.mongodb.host=172.19.42.45 -spring.data.mongodb.port=27017 +spring.data.mongodb.host=172.19.42.40 +spring.data.mongodb.port=27018 spring.data.mongodb.database=common -spring.data.mongodb.username=wangjx -spring.data.mongodb.password=wangjx#1234 +spring.data.mongodb.username=linwl +spring.data.mongodb.password=linwl#1234 position-server.serverAddr=172.19.42.45 position-server.timeAsycPort=9011 @@ -54,7 +77,7 @@ async.pool.corePoolSize=4 async.pool.maxPoolSize=8 async.pool.queueCapacity=5000 -mongo.datasource.dblist.uri=mongodb://wangjx:wangjx#1234@172.19.42.45:27017/common +mongo.datasource.dblist.uri=mongodb://linwl:linwl#1234@172.19.42.40:27018/common mongo.datasource.dblist.database=common diff --git a/src/main/resources/bootstrap-dev.yaml b/src/main/resources/bootstrap-dev.yaml deleted file mode 100644 index 8f21889..0000000 --- a/src/main/resources/bootstrap-dev.yaml +++ /dev/null @@ -1,10 +0,0 @@ -spring: - main: - allow-bean-definition-overriding: true - application: - name: dipperposition-service - cloud: - nacos: - config: - server-addr: 172.16.192.26:8848 - file-extension: yaml \ No newline at end of file diff --git a/src/main/resources/bootstrap-pro.yaml b/src/main/resources/bootstrap-pro.yaml deleted file mode 100644 index 1c50d09..0000000 --- a/src/main/resources/bootstrap-pro.yaml +++ /dev/null @@ -1,79 +0,0 @@ -server: - port: 8105 - -logging: - config: classpath:log/logback-spring.xml - level: - com: - telpo: - dipperposition: - service: - impl: debug - mapper: debug - org.springframework.data.mongodb.core.MongoTemplate: DEBUG -spring: - application: - name: dipperposition-service - redis: - database: 1 - host: 172.19.42.45 - #8090 - port: 6379 - password: telpo#1234 - timeout: 3000 - lettuce: - pool: - max-active: 100 # 连接池最大连接数(使用负值表示没有限制) - max-idle: 100 # 连接池中的最大空闲连接 - min-idle: 50 # 连接池中的最小空闲连接 - max-wait: 6000 # 连接池最大阻塞等待时间(使用负值表示没有限制) - data: - mongodb: - host: 172.19.42.45 - port: 27017 - database: common - username: wangjx - password: wangjx#1234 - -mongo: - datasource: - dblist: - - uri: mongodb://wangjx:wangjx#1234@172.19.42.45:27015/common - database: common - -scheduler: - pool: - size: 2 - #等待任务完成退出最大秒数 - await-seconds: 600 - task: - cron: "0 */30 * * * *" - -pos: - ipPositionRequestPath: https://restapi.amap.com/v3/ip - ipPositionRequestKey: 46eb0eba39494a6e9a90a0dc9e76639e - centerProvince: 湖北省 - astServer: agnss.techtotop.com - astPosAstPort: 8012 - astEphAstHexPort: 9012 - astTimeout: 30000 - -position-server: - serverAddr: 172.19.42.45 - timeAsycPort: 9011 - posAsycPort: 9013 - starsAsycPort: 9012 - -OkHttp-config: - pool: - max-conn: 200 - keep-alive: 5 - read-timeout: 10 - conn-timeout: 10 - write-timeout: 10 - -async: - pool: - corePoolSize: 4 - maxPoolSize: 8 - queueCapacity: 5000 \ No newline at end of file diff --git a/src/main/resources/bootstrap-test.yaml b/src/main/resources/bootstrap-test.yaml deleted file mode 100644 index 22f9b81..0000000 --- a/src/main/resources/bootstrap-test.yaml +++ /dev/null @@ -1,87 +0,0 @@ -server: - port: 8105 - -logging: - config: classpath:log/logback-spring.xml - level: - com: - telpo: - dipperposition: - service: - impl: debug - mapper: debug - org.springframework.data.mongodb.core.MongoTemplate: DEBUG -spring: - application: - name: dipperposition-service - cloud: - nacos: - config: - server-addr: 172.19.42.44:8848 - namespace: fee328ef-7348-4984-879a-fd75f9f59cd2 - redis: - database: 1 - host: 172.19.42.44 - #8090 - port: 8090 - password: telpo#1234 - timeout: 3000 - lettuce: - pool: - max-active: 100 # 连接池最大连接数(使用负值表示没有限制) - max-idle: 100 # 连接池中的最大空闲连接 - min-idle: 50 # 连接池中的最小空闲连接 - max-wait: 6000 # 连接池最大阻塞等待时间(使用负值表示没有限制) - data: - mongodb: - host: 172.19.42.40 - port: 27018 - database: common - username: wangjx - password: wangjx#1234 - -mongo: - datasource: - dblist: - - uri: mongodb://wangjx:wangjx#1234@172.19.42.40:27018/common - database: common - - uri: mongodb://wangjx:wangjx#1234@172.19.42.40:27018/basicdata - database: basicdata - -scheduler: - pool: - size: 2 - #等待任务完成退出最大秒数 - await-seconds: 600 - task: - cron: "0 */30 * * * *" - -pos: - centerProvinceFilePath: /csv/provinceLonAlt.csv - ipPositionRequestPath: https://restapi.amap.com/v3/ip - ipPositionRequestKey: 46eb0eba39494a6e9a90a0dc9e76639e - centerProvince: 湖北省 - astServer: agnss.techtotop.com - astPosAstPort: 8012 - astEphAstHexPort: 9112 - astTimeout: 30000 - -position-server: - serverAddr: 172.19.42.44 - timeAsycPort: 9011 - posAsycPort: 9013 - starsAsycPort: 9012 - -OkHttp-config: - pool: - max-conn: 200 - keep-alive: 5 - read-timeout: 10 - conn-timeout: 10 - write-timeout: 10 - -async: - pool: - corePoolSize: 4 - maxPoolSize: 8 - queueCapacity: 5000 \ No newline at end of file diff --git a/src/main/resources/bootstrap.yaml b/src/main/resources/bootstrap.yaml index c34181b..86de549 100644 --- a/src/main/resources/bootstrap.yaml +++ b/src/main/resources/bootstrap.yaml @@ -4,70 +4,3 @@ logging: com: telpo: dipperposition: debug -spring: - application: - name: dipperposition-service - cloud: - nacos: - config: - server-addr: 172.16.192.26:8848 - file-extension: yaml - redis: - database: 1 - host: 172.16.192.26 - port: 8090 - password: telpo#1234 - timeout: 3000 - lettuce: - pool: - max-active: 100 # 连接池最大连接数(使用负值表示没有限制) - max-idle: 100 # 连接池中的最大空闲连接 - min-idle: 50 # 连接池中的最小空闲连接 - max-wait: 6000 # 连接池最大阻塞等待时间(使用负值表示没有限制) - -scheduler: - pool: - size: 2 - #等待任务完成退出最大秒数 - await-seconds: 600 - task: - cron: "0 0 1 * * ?" - -pos: - centerProvinceFilePath: /csv/provinceLonAlt.csv - ipPositionRequestPath: https://restapi.amap.com/v3/ip - ipPositionRequestKey: 65e794b0a1a4b87eeec86f93fea05411 - centerProvince: 湖北省 - ast: - server: agnss.techtotop.com - ephAstPort: 8012 - ephAstHexPort: 9012 - timeout: 30000 - -position-server: - serverAddr: localhost - timeAsycPort: 9011 - posAsycPort: 9013 - starsAsycPort: 9012 - -mongo: - datasource: - dblist: - - uri: mongodb://wangjx:wangjx#1234@172.16.192.26:27017/basicdata - database: basicdata - - uri: mongodb://wangjx:wangjx#1234@172.16.192.26:27017/common - database: common - -OkHttp-config: - pool: - max-conn: 200 - keep-alive: 5 - read-timeout: 10 - conn-timeout: 10 - write-timeout: 10 - -async: - pool: - corePoolSize: 4 - maxPoolSize: 8 - queueCapacity: 5000 \ No newline at end of file