From 3a704adc798141d3ff36eb83aa8353c029a652f3 Mon Sep 17 00:00:00 2001 From: zhoyou <18525788842@163.com> Date: Thu, 9 Jan 2020 16:21:47 +0800 Subject: [PATCH 1/6] =?UTF-8?q?docker=E5=90=AF=E5=8A=A8=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=EF=BC=8C=E5=90=8E=E6=9C=9F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?jekence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docker/docker_neuray_pm.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/docker/docker_neuray_pm.md diff --git a/docs/docker/docker_neuray_pm.md b/docs/docker/docker_neuray_pm.md new file mode 100644 index 0000000..cfaeff5 --- /dev/null +++ b/docs/docker/docker_neuray_pm.md @@ -0,0 +1,33 @@ +## 启动注册中心 + docker run -p 8070:8070 --name neuray-pm-center \ + -v /etc/localtime:/etc/localtime \ + -v /neuray-pm/logs/neuray-pm-center/logs:/var/logs \ + -d 44b0af5e0606 +## 启动鉴权中心 + docker run -p 8071:8071 --name neuray-pm-auth \ + -v /etc/localtime:/etc/localtime \ + -v /neuray-pm/logs/neuray-pm-auth/logs:/var/logs \ + -d b1be51daf91e +## 启动网关 + docker run -p 8072:8072 --name neuray-pm-gate \ + -v /etc/localtime:/etc/localtime \ + -v /neuray-pm/logs/neuray-pm-gate/logs:/var/logs \ + -d d87ab76050f6 +## 启动代码生成服务 + docker run -p 8073:8073 --name neuray-pm-code \ + -v /etc/localtime:/etc/localtime \ + -v /neuray-pm/logs/neuray-pm-code/logs:/var/logs \ + -d 6adb2f61703c +## 启动人员管理服务 + docker run -p 8081:8081 --name neuray-pm-admin \ + -v /etc/localtime:/etc/localtime \ + -v /neuray-pm/logs/neuray-pm-admin/logs:/var/logs \ + -d 43085cbb69ee + + +> 查看容器动态日志。 + + docker logs -f -t --tail 10 docker_id +> 关键字删除镜像。 + +docker rmi --force `docker images | grep doss-api | awk '{print $3}'` //其中doss-api为关键字 -- Gitee From 4bbf50d0b33c3852759a1fb1f607f339ccb5abd0 Mon Sep 17 00:00:00 2001 From: zhoyou Date: Thu, 9 Jan 2020 16:24:26 +0800 Subject: [PATCH 2/6] update README.md. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60f4332..28ab467 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ ### 搭建步骤 > Docker环境部署 +- Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_neuray_pm.md)); - 在VirtualBox或其他环境中安装CenterOs7.6; - Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker.md); - 本项目Docker镜像构建请参考:[使用Maven插件为SpringBoot应用构建Docker镜像](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_maven.md); -- Gitee From 505b2d01cd64d5acb66434bb4b7a2b57b5a01ef6 Mon Sep 17 00:00:00 2001 From: zhoyou Date: Thu, 9 Jan 2020 16:25:21 +0800 Subject: [PATCH 3/6] update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 28ab467..7525c7f 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ ### 搭建步骤 > Docker环境部署 -- Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_neuray_pm.md)); +- Docker环境的安装请参考:[启动本项目docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_neuray_pm.md)); - 在VirtualBox或其他环境中安装CenterOs7.6; - Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker.md); - 本项目Docker镜像构建请参考:[使用Maven插件为SpringBoot应用构建Docker镜像](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_maven.md); -- Gitee From e2529bcec8e237fe6029591f82e7b1156e8febde Mon Sep 17 00:00:00 2001 From: zhoyou Date: Thu, 9 Jan 2020 16:25:49 +0800 Subject: [PATCH 4/6] update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7525c7f..9063716 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ ### 搭建步骤 > Docker环境部署 -- Docker环境的安装请参考:[启动本项目docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_neuray_pm.md)); +- 启动本项目docker命令参考:[启动本项目docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_neuray_pm.md)); - 在VirtualBox或其他环境中安装CenterOs7.6; - Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker.md); - 本项目Docker镜像构建请参考:[使用Maven插件为SpringBoot应用构建Docker镜像](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_maven.md); -- Gitee From f0a92a0db93b4d01c1f006f4ca1e06ae3b1c7ae2 Mon Sep 17 00:00:00 2001 From: zhoyou Date: Thu, 9 Jan 2020 16:49:45 +0800 Subject: [PATCH 5/6] update README.md. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 9063716..2773472 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,4 @@ - 启动本项目docker命令参考:[启动本项目docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_neuray_pm.md)); - 在VirtualBox或其他环境中安装CenterOs7.6; -- Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker.md); -- 本项目Docker镜像构建请参考:[使用Maven插件为SpringBoot应用构建Docker镜像](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_maven.md); -- 本项目在Docker容器下的部署请参考:[mall在Linux环境下的部署(基于Docker容器)](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_file.md); -- 本项目使用Docker Compose请参考: [mall在Linux环境下的部署(基于Docker Compose)](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker_compose.md)。 +- Docker环境的安装请参考:[开发者必备Docker命令](https://gitee.com/zhhongyu/neuray-pm-security/blob/master/docs/docker/docker.md) -- Gitee From 8167d2ab95c713013379ee9aa645fb0d32b7b3a9 Mon Sep 17 00:00:00 2001 From: zhoyou <18525788842@163.com> Date: Wed, 15 Jan 2020 12:02:47 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=B0=86=E6=B3=A8=E5=86=8C=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E7=BB=9F=E4=B8=80=E4=BF=AE=E6=94=B9=E4=B8=BAnacos?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=E9=A1=B9=E7=9B=AE=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base-auth/auth-server/pom.xml | 18 ++- .../security/auth/BaseAuthBootstrap.java | 4 +- .../src/main/resources/application.yml | 125 ------------------ .../src/main/resources/bootstrap.yml | 16 +++ neuray-pm-base-server/base-center/pom.xml | 40 ------ .../security/center/BaseCenterBootstrap.java | 16 --- .../src/main/resources/application.yml | 13 -- .../base-code-generator/pom.xml | 13 +- .../src/main/resources/application.yml | 62 --------- .../src/main/resources/bootstrap.yml | 45 ++----- .../base-gateway/gateway-server/pom.xml | 17 ++- .../src/main/resources/application.yml | 99 -------------- .../src/main/resources/bootstrap.yml | 45 ++----- neuray-pm-base-server/pom.xml | 1 - .../security/admin/ServiceAdminBootstrap.java | 2 - .../src/main/resources/application.yml | 21 --- .../src/main/resources/bootstrap.yml | 10 ++ neuray-pm-provider/pom.xml | 7 +- 18 files changed, 95 insertions(+), 459 deletions(-) create mode 100644 neuray-pm-base-server/base-auth/auth-server/src/main/resources/bootstrap.yml delete mode 100644 neuray-pm-base-server/base-center/pom.xml delete mode 100644 neuray-pm-base-server/base-center/src/main/java/com/gitee/neuray/security/center/BaseCenterBootstrap.java delete mode 100644 neuray-pm-base-server/base-center/src/main/resources/application.yml create mode 100644 neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/bootstrap.yml diff --git a/neuray-pm-base-server/base-auth/auth-server/pom.xml b/neuray-pm-base-server/base-auth/auth-server/pom.xml index 0442c9c..20f8793 100644 --- a/neuray-pm-base-server/base-auth/auth-server/pom.xml +++ b/neuray-pm-base-server/base-auth/auth-server/pom.xml @@ -31,11 +31,6 @@ spring-cloud-starter-openfeign - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - org.springframework.cloud spring-cloud-starter-zipkin @@ -119,6 +114,19 @@ 1.0-SNAPSHOT + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.0.0.RELEASE + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.0.0.RELEASE + neuray-pm-auth diff --git a/neuray-pm-base-server/base-auth/auth-server/src/main/java/com/gitee/neuray/security/auth/BaseAuthBootstrap.java b/neuray-pm-base-server/base-auth/auth-server/src/main/java/com/gitee/neuray/security/auth/BaseAuthBootstrap.java index 9ffe873..f3e05a7 100644 --- a/neuray-pm-base-server/base-auth/auth-server/src/main/java/com/gitee/neuray/security/auth/BaseAuthBootstrap.java +++ b/neuray-pm-base-server/base-auth/auth-server/src/main/java/com/gitee/neuray/security/auth/BaseAuthBootstrap.java @@ -5,7 +5,7 @@ import com.gitee.neuray.security.common.config.DruidConfig; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.EnableEurekaClient; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Import; @@ -17,10 +17,10 @@ import org.springframework.context.annotation.Import; * @des */ @SpringBootApplication -@EnableEurekaClient @EnableFeignClients @MapperScan("com.gitee.neuray.security.auth.mapper") @Import(DruidConfig.class) +@EnableDiscoveryClient //@RemoteApplicationEventScan(basePackages = "com.gitee.neuray.security.auth.common.event") public class BaseAuthBootstrap { public static void main(String[] args) { diff --git a/neuray-pm-base-server/base-auth/auth-server/src/main/resources/application.yml b/neuray-pm-base-server/base-auth/auth-server/src/main/resources/application.yml index f844e73..e69de29 100644 --- a/neuray-pm-base-server/base-auth/auth-server/src/main/resources/application.yml +++ b/neuray-pm-base-server/base-auth/auth-server/src/main/resources/application.yml @@ -1,125 +0,0 @@ -spring: - application: - name: neuray-pm-auth - jackson: - date-format: yyyy-MM-dd HH:mm:ss - time-zone: GMT+8 - default-property-inclusion: non_null - redis: - database: 1 - #需要修改地址 - host: ${REDIS_HOST:192.168.1.205} - port: ${REDIS_PORT:6379} - pool: - max-active: 200 - password: 123456 - datasource: - name: test - url: jdbc:oracle:thin:@${ORACLE_HOST:192.168.1.205}:${ORACLE_PORT:5566}:arltr - username: NeurayPM_Auth - password: NeurayPM_Auth - # 使用druid数据源 - type: com.alibaba.druid.pool.DruidDataSource -# driver-class-name: com.mysql.jdbc.Driver - driver-class-name: oracle.jdbc.OracleDriver - druid: - max-active: 18 - initial-size: 3 - min-idle: 3 - max-wait: 250000 - time-between-eviction-runs-millis: 250000 - min-evictable-idle-time-millis: 120000 - validation-query: select 'x' from dual - test-while-idle: true - test-on-borrow: false - test-on-return: false - max-open-prepared-statements: 20 - filter: stat,wall,log4j - sleuth: - sampler: - percentage: 1 - - -mybatis: - basepackage: com.gitee.neuray.security.auth.mapper - xmlLocation: classpath:mapper/**/*.xml - mapper-locations: "classpath*:mapper/*.xml" - -server: - port: 8071 #启动端口 - -feign: - httpclient: - enabled: false - okhttp: - enabled: true - -ribbon: - eureka: - enabled: true - ReadTimeout: 30000 - ConnectTimeout: 30000 - MaxAutoRetries: 0 - MaxAutoRetriesNextServer: 1 - OkToRetryOnAllOperations: false - -hystrix: - threadpool: - default: - coreSize: 10000 ##并发执行的最大线程数,默认10 - maxQueueSize: 10000 ##BlockingQueue的最大队列数 - queueSizeRejectionThreshold: 5000 ##即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝 - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 60000 - -eureka: - instance: - statusPageUrlPath: /actuator/info - healthCheckUrlPath: /actuator/health - # docker 部署开启 -# prefer-ip-address: true -# ip-address: 127.0.0.1 - client: - serviceUrl: - # docker 部署开启 - defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8070}/eureka/ - ###向注册中心上注册自己 - register-with-eureka: true - ###是否需要从eureka上获取注册信息 - fetch-registry: true - - - -jwt: - token-header: Authorization - ###jwt的存在时间设置为无限期 - expire: 7200 - rsa-secret: xx1WET12^%3^(WE45 - -client: - id: neuray-pm-auth - secret: 123456 - token-header: client-token - expire: 14400 - rsa-secret: x2318^^(*WRYQWR(QW&T -####新增用户时的默认密码 -auth: - user: - defaultPassword: 123456 -##druid数据库连接池管理页面配置 -druid: - enabled: true - ###允许登录的白名单 - whiteip: 127.0.0.1 - ###不允许登录的黑名单 - blackip: 192.168.1.1 - loginUsername: admin - loginPassword: 123456 -sys: - username: larksys - password: larksys - orgcode: '0010000103' diff --git a/neuray-pm-base-server/base-auth/auth-server/src/main/resources/bootstrap.yml b/neuray-pm-base-server/base-auth/auth-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..a96d669 --- /dev/null +++ b/neuray-pm-base-server/base-auth/auth-server/src/main/resources/bootstrap.yml @@ -0,0 +1,16 @@ +server: + port: 8071 +spring: + application: + name: neuray-pm-auth + cloud: + nacos: + discovery: + server-addr: 192.168.1.205:8848 + heart-beat-interval: 10000 + config: + server-addr: 192.168.1.205:8848 + group: NEURAY-PM-AUTH + fileExtension: yaml + + diff --git a/neuray-pm-base-server/base-center/pom.xml b/neuray-pm-base-server/base-center/pom.xml deleted file mode 100644 index 972fcf5..0000000 --- a/neuray-pm-base-server/base-center/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - neuray-pm-base-server - com.gitee.neuray.security - 1.0-SNAPSHOT - - 4.0.0 - - base-center - - 1.5.12 - - - - - org.springframework.cloud - spring-cloud-netflix-eureka-server - - - org.springframework.cloud - spring-cloud-starter - - - - neuray-pm-center - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - - diff --git a/neuray-pm-base-server/base-center/src/main/java/com/gitee/neuray/security/center/BaseCenterBootstrap.java b/neuray-pm-base-server/base-center/src/main/java/com/gitee/neuray/security/center/BaseCenterBootstrap.java deleted file mode 100644 index bb73bff..0000000 --- a/neuray-pm-base-server/base-center/src/main/java/com/gitee/neuray/security/center/BaseCenterBootstrap.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.gitee.neuray.security.center; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; - -/** - * 东睿设计组 - */ -@EnableEurekaServer //启动一个服务注册中心提供给其他应用进行对话 -@SpringBootApplication -public class BaseCenterBootstrap { - public static void main(String[] args) { - SpringApplication.run(BaseCenterBootstrap.class, args); - } -} diff --git a/neuray-pm-base-server/base-center/src/main/resources/application.yml b/neuray-pm-base-server/base-center/src/main/resources/application.yml deleted file mode 100644 index 683aaa8..0000000 --- a/neuray-pm-base-server/base-center/src/main/resources/application.yml +++ /dev/null @@ -1,13 +0,0 @@ -spring: - application: - name: neuray-pm-center - -server: - port: 8070 #启动端口 - -eureka: - client: - registerWithEureka: false #false:不作为一个客户端注册到注册中心 - fetchRegistry: false #为true时,可以启动,但报异常:Cannot execute request on any known server - service-url: - defaultZone: http://127.0.0.1:8070/eureka diff --git a/neuray-pm-base-server/base-code-generator/pom.xml b/neuray-pm-base-server/base-code-generator/pom.xml index 4cd16e3..d028b55 100644 --- a/neuray-pm-base-server/base-code-generator/pom.xml +++ b/neuray-pm-base-server/base-code-generator/pom.xml @@ -93,9 +93,18 @@ neuray-pm-common 1.0-SNAPSHOT + + - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.0.0.RELEASE + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.0.0.RELEASE com.gitee.neuray.security diff --git a/neuray-pm-base-server/base-code-generator/src/main/resources/application.yml b/neuray-pm-base-server/base-code-generator/src/main/resources/application.yml index 3cff34b..e69de29 100644 --- a/neuray-pm-base-server/base-code-generator/src/main/resources/application.yml +++ b/neuray-pm-base-server/base-code-generator/src/main/resources/application.yml @@ -1,62 +0,0 @@ -server: - port: 8073 - servlet: - context-path: /code - - -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - #MySQL配置 -# driverClassName: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://localhost:3306/renren_security?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai -# username: renren -# password: 123456 - #oracle配置 - driverClassName: oracle.jdbc.OracleDriver - url: jdbc:oracle:thin:@192.168.1.205:5566:arltr - username: NeurayPM - password: NeurayPM - #SQLServer配置 -# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver -# url: jdbc:sqlserver://192.168.10.10:1433;DatabaseName=renren_security -# username: sa -# password: 123456 - #PostgreSQL配置 -# driverClassName: org.postgresql.Driver -# url: jdbc:postgresql://192.168.10.10:5432/renren_security -# username: postgres -# password: 123456 - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - default-property-inclusion: non_null - resources: - static-locations: classpath:/static/,classpath:/views/ - application: - name: neuray-pm-code - - - -mybatis: - mapperLocations: classpath:mapper/**/*.xml - - -pagehelper: - reasonable: true - supportMethodsArguments: true - params: count=countSql - - -#指定数据库,可选值有【mysql、oracle、sqlserver、postgresql】 -air: - database: oracle - -auth: - serviceId: neuray-pm-auth - user: - token-header: Authorization - client: - token-header: client-token - id: neuray-pm-code #不填则默认读取spring.application.name - secret: 123456 diff --git a/neuray-pm-base-server/base-code-generator/src/main/resources/bootstrap.yml b/neuray-pm-base-server/base-code-generator/src/main/resources/bootstrap.yml index 5c98689..6f3c311 100644 --- a/neuray-pm-base-server/base-code-generator/src/main/resources/bootstrap.yml +++ b/neuray-pm-base-server/base-code-generator/src/main/resources/bootstrap.yml @@ -1,32 +1,13 @@ -eureka: - instance: - statusPageUrlPath: /actuator/info - healthCheckUrlPath: /actuator/health - home-page-url-path: / - # docker 部署开启 -# prefer-ip-address: true -# ip-address: 127.0.0.1 - client: - serviceUrl: - # docker 部署开启 - defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8070}/eureka/ - ###向注册中心上注册自己 - register-with-eureka: true - ###是否需要从eureka上获取注册信息 - fetch-registry: true - -#请求和响应GZIP压缩支持 -feign: - httpclient: - enabled: false - okhttp: - enabled: true - compression: - request: - enabled: true - mime-types: text/xml,application/xml,application/json - min-request-size: 2048 - response: - enabled: true - hystrix: - enabled: true +server: + port: 8073 +spring: + application: + name: neuray-pm-code + cloud: + nacos: + discovery: + server-addr: 192.168.1.205:8848 + config: + server-addr: 192.168.1.205:8848 + group: NEURAY-PM-CODE + fileExtension: yaml diff --git a/neuray-pm-base-server/base-gateway/gateway-server/pom.xml b/neuray-pm-base-server/base-gateway/gateway-server/pom.xml index 1c3f7ec..5e78b28 100644 --- a/neuray-pm-base-server/base-gateway/gateway-server/pom.xml +++ b/neuray-pm-base-server/base-gateway/gateway-server/pom.xml @@ -47,10 +47,6 @@ org.springframework.cloud spring-cloud-starter-openfeign - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - org.springframework.cloud @@ -76,6 +72,19 @@ feign-jackson 8.18.0 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.0.0.RELEASE + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.0.0.RELEASE + neuray-gateway diff --git a/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/application.yml b/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/application.yml index e3ee341..e69de29 100644 --- a/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/application.yml +++ b/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/application.yml @@ -1,99 +0,0 @@ -spring: - application: - name: neuray-pm-gate - thymeleaf: - mode: LEGACYHTML5 - cache: false - jackson: - date-format: yyyy-MM-dd HH:mm:ss - time-zone: GMT+8 - default-property-inclusion: non_null - redis: - database: 1 - #需要修改地址 - # host: 10.11.24.5 - host: 192.168.1.205 - jedis: - pool: - max-active: 200 - password: 123456 - sleuth: - sampler: - percentage: 1 - zuul: - enabled: true -server: - port: 8072 #启动端口 - -# -zuul: - ignored-services: "*" - sensitive-headers: #默认过滤所有的请求头,为空则放行所有的请求头 - prefix: /api #为zuul设置一个公共的前缀 - ratelimit: # 网关限流 - key-prefix: gate_rate - enabled: true - repository: REDIS #REDIS, JPA, IN_MEMORY - behind-proxy: true - default-policy: #optional - will apply unless specific policy exists - limit: 2000 - refresh-interval: 60 #default value (in seconds) - type: #optional - - user - - origin - - url - routes: - back: - path: /admin/** - serviceId: neuray-pm-admin - - auth: - path: /auth/** - serviceId: neuray-pm-auth - - code: - path: /generator/** - serviceId: neuray-pm-code - -ribbon: - eureka: - enabled: true - ReadTimeout: 30000 - ConnectTimeout: 30000 - MaxAutoRetries: 0 - MaxAutoRetriesNextServer: 1 - OkToRetryOnAllOperations: false - httpclient: - enabled: false - okhttp: - enabled: true - - -hystrix: - threadpool: - default: - coreSize: 10000 ##并发执行的最大线程数,默认10 - maxQueueSize: 10000 ##BlockingQueue的最大队列数 - queueSizeRejectionThreshold: 5000 ##即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝 - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 200000 - strategy: SEMAPHORE - - -gate: - ignore: - startWith: /static,/auth/jwt,/admin/org/tree,/admin/org/orgUsers,/admin/org/user,/admin/api - - -auth: - serviceId: neuray-pm-auth - user: - token-header: Authorization - client: - token-header: client-token - id: neuray-pm-gate #不填则默认读取spring.application.name - secret: 123456 diff --git a/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/bootstrap.yml b/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/bootstrap.yml index b8789d6..6f41da6 100644 --- a/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/bootstrap.yml +++ b/neuray-pm-base-server/base-gateway/gateway-server/src/main/resources/bootstrap.yml @@ -1,32 +1,15 @@ -eureka: - instance: - statusPageUrlPath: /actuator/info - healthCheckUrlPath: /actuator/health - home-page-url-path: / - # docker 部署开启 -# prefer-ip-address: true -# ip-address: 127.0.0.1 - client: - serviceUrl: - # docker 部署开启 - defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8070}/eureka/ - ###向注册中心上注册自己 - register-with-eureka: true - ###是否需要从eureka上获取注册信息 - fetch-registry: true +server: + port: 8072 +spring: + application: + name: neuray-pm-gate + cloud: + nacos: + discovery: + server-addr: 192.168.1.205:8848 + heart-beat-interval: 10000 + config: + server-addr: 192.168.1.205:8848 + group: NEURAY-PM-GATE + fileExtension: yaml -#请求和响应GZIP压缩支持 -feign: - httpclient: - enabled: false - okhttp: - enabled: true - compression: - request: - enabled: true - mime-types: text/xml,application/xml,application/json - min-request-size: 2048 - response: - enabled: true - hystrix: - enabled: true diff --git a/neuray-pm-base-server/pom.xml b/neuray-pm-base-server/pom.xml index 45d1328..cfe30c6 100644 --- a/neuray-pm-base-server/pom.xml +++ b/neuray-pm-base-server/pom.xml @@ -14,7 +14,6 @@ base-auth base-gateway - base-center base-code-generator base-dfsfile-client diff --git a/neuray-pm-provider/neuray-pm-provider-admin/src/main/java/com/gitee/neuray/security/admin/ServiceAdminBootstrap.java b/neuray-pm-provider/neuray-pm-provider-admin/src/main/java/com/gitee/neuray/security/admin/ServiceAdminBootstrap.java index a1529c4..8e46c14 100644 --- a/neuray-pm-provider/neuray-pm-provider-admin/src/main/java/com/gitee/neuray/security/admin/ServiceAdminBootstrap.java +++ b/neuray-pm-provider/neuray-pm-provider-admin/src/main/java/com/gitee/neuray/security/admin/ServiceAdminBootstrap.java @@ -10,7 +10,6 @@ import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.context.annotation.Import; @@ -23,7 +22,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; * @author 协同设计小组 * @create 2017-05-25 12:44 */ -@EnableEurekaClient @EnableDiscoveryClient @EnableCircuitBreaker @SpringBootApplication diff --git a/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/application.yml b/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/application.yml index b05380e..b880af1 100644 --- a/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/application.yml +++ b/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/application.yml @@ -3,8 +3,6 @@ logging: # tk.mybatis: DEBUG com.gitee.neuray.security.admin: DEBUG spring: - application: - name: neuray-pm-admin jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 @@ -44,25 +42,6 @@ mybatis: basepackage: com.gitee.neuray.security.admin.mapper xmlLocation: classpath:mapper/**/*.xml mapper-locations: "classpath*:mapper/*.xml" - -server: - port: 8081 - -eureka: - instance: - statusPageUrlPath: /actuator/info - healthCheckUrlPath: /actuator/health - # docker 部署开启 -# prefer-ip-address: true -# ip-address: 127.0.0.1 - client: - serviceUrl: - # docker 部署开启 - defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8070}/eureka/ - ###向注册中心上注册自己 - register-with-eureka: true - ###是否需要从eureka上获取注册信息 - fetch-registry: true # 必须配置 feign: httpclient: diff --git a/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/bootstrap.yml b/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..9b6f813 --- /dev/null +++ b/neuray-pm-provider/neuray-pm-provider-admin/src/main/resources/bootstrap.yml @@ -0,0 +1,10 @@ +server: + port: 8081 +spring: + application: + name: neuray-pm-admin + cloud: + nacos: + discovery: + server-addr: 192.168.1.205:8848 + diff --git a/neuray-pm-provider/pom.xml b/neuray-pm-provider/pom.xml index 0f7f9c7..adf795b 100644 --- a/neuray-pm-provider/pom.xml +++ b/neuray-pm-provider/pom.xml @@ -27,13 +27,12 @@ org.springframework.cloud spring-cloud-starter-netflix-hystrix - - + org.springframework.cloud - spring-cloud-starter-netflix-eureka-client + spring-cloud-starter-alibaba-nacos-discovery + 0.9.0.RELEASE - org.springframework.cloud -- Gitee