瀏覽代碼

生产环境配置

yingp 7 年之前
父節點
當前提交
40cd29e296
共有 22 個文件被更改,包括 398 次插入6 次删除
  1. 65 0
      README.md
  2. 20 0
      applications/commons/commons-server/src/main/resources/config/application-docker-prod.yml
  3. 23 0
      applications/document/document-server/src/main/resources/config/application-docker-prod.yml
  4. 23 0
      applications/money/money-server/src/main/resources/config/application-docker-prod.yml
  5. 20 0
      applications/purchase/purchase-server/src/main/resources/config/application-docker-prod.yml
  6. 20 0
      applications/sale/sale-server/src/main/resources/config/application-docker-prod.yml
  7. 20 0
      applications/storage/storage-server/src/main/resources/config/application-docker-prod.yml
  8. 25 0
      base-servers/account/account-server/src/main/resources/config/application-docker-prod.yml
  9. 9 0
      base-servers/admin-server/src/main/resources/config/application-docker-prod.yml
  10. 26 0
      base-servers/auth/auth-server/src/main/resources/config/application-docker-prod.yml
  11. 7 0
      base-servers/eureka-server/src/main/resources/config/application-docker-prod.yml
  12. 1 1
      base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java
  13. 26 0
      base-servers/file/file-server/src/main/resources/config/application-docker-prod.yml
  14. 5 3
      base-servers/file/file-server/src/test/java/com/usoftchina/saas/file/controller/FileControllerTest.java
  15. 19 0
      base-servers/gateway-server/src/main/resources/config/application-docker-prod.yml
  16. 23 0
      base-servers/mail/mail-server/src/main/resources/config/application-docker-prod.yml
  17. 19 0
      base-servers/socket/socket-server/src/main/resources/config/application-docker-prod.yml
  18. 19 0
      base-servers/ui-server/src/main/resources/config/application-docker-prod.yml
  19. 13 0
      base-servers/zipkin-server/src/main/resources/config/application-docker-prod.yml
  20. 9 0
      script/mysql/init/auth.sql
  21. 5 1
      script/mysql/init/base.sql
  22. 1 1
      script/mysql/init/mail.sql

+ 65 - 0
README.md

@@ -83,6 +83,8 @@
 | --------   | :-----: | :-----:  | :----:  | :----: | :------  |
 | saas_account | mysql | 192.168.253.12:3306 |  root  | select111*** |  账户中心  |
 | saas_auth | mysql | 192.168.253.12:3306 |  root  | select111*** |  鉴权系统  |
+| saas_file | mysql | 192.168.253.12:3306 |  root  | select111*** |  文件系统  |
+| saas_mail | mysql | 192.168.253.12:3306 |  root  | select111*** |  邮件系统  |
 | saas_biz | mysql | 192.168.253.12:3306 |  root  | select111*** |  业务系统  |
 | saas_ui | mongo | 192.168.253.12:27017 |    |  |  UI配置  |
 
@@ -124,4 +126,67 @@
 * [admin](http://192.168.0.181:8520) **账号** admin **密码** select111***
 * [zipkin](http://192.168.0.181:8540) **账号** admin **密码** select111***
 
+> 访问
 
+* [门户 https://saas-dev.usoftchina.com:5443](https://saas-dev.usoftchina.com:5443)
+* [系统 https://trade-dev.usoftchina.com:5443](https://trade-dev.usoftchina.com:5443)
+* [打印 https://saas-report-dev.usoftchina.com:5443](https://saas-report-dev.usoftchina.com:5443)
+* [接口 https://saas-api-dev.usoftchina.com:5443](https://saas-api-dev.usoftchina.com:5443)
+
+# 生产环境
+
+> 数据库
+
+| 数据库      | 类型   | 地址   |  账号  |  密码  |  说明  |
+| --------   | :-----: | :-----:  | :----:  | :----: | :------  |
+| saas_account | mysql | 10.10.100.18:3306 |  saas  | select111*** |  账户中心  |
+| saas_auth | mysql | 10.10.100.18:3306 |  saas  | select111*** |  鉴权系统  |
+| saas_file | mysql | 10.10.100.18:3306 |  saas  | select111*** |  文件系统  |
+| saas_mail | mysql | 10.10.100.18:3306 |  saas  | select111*** |  邮件系统  |
+| saas_biz | mysql | 10.10.100.18:3306 |  saas  | select111*** |  业务系统  |
+| saas_ui | mongo | 10.10.100.123:27017 |    |  |  UI配置  |
+
+> 中间件
+
+| 类型 | 地址 | 账号 | 密码 | 说明 |
+| ---- | :----: | :----: | :----: | ---- |
+| rabbitmq | 10.10.100.103:5672 | saas | select123*** | 消息中间件 [控制台](http://10.10.100.103:15672)|
+| redis | 10.10.100.173:6379 | | | 内存数据库 |
+
+
+> 服务器
+
+| IP      |  账号  |  密码  |  环境  |  资源  |
+| --------   | :----:  | :----: | :------:  | :------:  |
+| 10.10.100.103 |  centos  | mykey.key |  CentOS6, RabbitMQ  | Cpu: 4, Mem: 8G, Disk: 35G |
+| 10.10.100.123 |  centos  | mykey.key |  CentOS6, MongoDB  | Cpu: 8, Mem: 8G, Disk: 60G |
+| 10.10.100.160 |  centos  | mykey.key |  CentOS6, ELK  | Cpu: 8, Mem: 8G, Disk: 60G |
+| 10.10.100.173 |  centos  | mykey.key |  CentOS6, Redis  | Cpu: 4, Mem: 8G, Disk: 35G |
+| 10.10.100.23 |  root  | 62cddbcc624b1b072d84117cc0e5a4db |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |
+| 10.10.100.24 |  root  | 4fd19c28ee472ef9ebc3c06de9277c1b |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |
+| 10.10.100.25 |  root  | 61a12a65cd42ef77a52dfef8e436bacc |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |
+| 10.10.100.26 |  root  | 8743e445c7a308edf4588b7997b21c73 |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |
+
+> 构建
+
+* [jenkins](http://10.10.100.200:5001/job/saas/prod) **账号** admin **密码** select123***
+
+> 日志
+
+* [kibana](http://10.10.100.160:5601)
+* [logstash](tcp://10.10.100.160:5000)
+* [elasticsearch](http://10.10.100.160:9200/_search?pretty)
+
+> 服务
+
+* [eureka http://10.10.100.23:8500](http://10.10.100.23:8500) **账号** admin **密码** select111***
+* [gateway http://10.10.100.23:8560](http://10.10.100.23:8560)
+* [admin](http://10.10.100.23:8520) **账号** admin **密码** select111***
+* [zipkin](http://10.10.100.23:8540) **账号** admin **密码** select111***
+
+> 访问
+
+* [门户 https://saas.usoftchina.com](https://saas.usoftchina.com)
+* [系统 https://trade.usoftchina.com](https://trade.usoftchina.com)
+* [打印 https://saas-report.usoftchina.com](https://saas-report.usoftchina.com)
+* [接口 https://saas-api.usoftchina.com](https://saas-api.usoftchina.com)

+ 20 - 0
applications/commons/commons-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,20 @@
+eureka:
+  instance:
+    hostname: saas-commons-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+logging:
+  destination: 10.10.100.160:5000

+ 23 - 0
applications/document/document-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,23 @@
+eureka:
+  instance:
+    hostname: saas-document-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 23 - 0
applications/money/money-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,23 @@
+eureka:
+  instance:
+    hostname: saas-money-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 20 - 0
applications/purchase/purchase-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,20 @@
+eureka:
+  instance:
+    hostname: saas-purchase-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+logging:
+  destination: 10.10.100.160:5000

+ 20 - 0
applications/sale/sale-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,20 @@
+eureka:
+  instance:
+    hostname: saas-sale-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+logging:
+  destination: 10.10.100.160:5000

+ 20 - 0
applications/storage/storage-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,20 @@
+eureka:
+  instance:
+    hostname: saas-storage-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+logging:
+  destination: 10.10.100.160:5000

+ 25 - 0
base-servers/account/account-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,25 @@
+eureka:
+  instance:
+    hostname: saas-account-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_account?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000
+sso:
+  base-url: https://sso.ubtob.com

+ 9 - 0
base-servers/admin-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,9 @@
+eureka:
+  instance:
+    hostname: saas-admin-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+logging:
+  destination: 10.10.100.160:5000

+ 26 - 0
base-servers/auth/auth-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,26 @@
+eureka:
+  instance:
+    hostname: saas-auth-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    virtual-host: docker
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_auth?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 7 - 0
base-servers/eureka-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,7 @@
+eureka:
+  instance:
+    hostname: saas-eureka-server
+server:
+  port: 8500
+logging:
+  destination: 10.10.100.160:5000

+ 1 - 1
base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java

@@ -199,7 +199,7 @@ public class FileController {
 
     @ApiOperation(value = "查看子文件")
     @GetMapping(value = "/list")
-    public Result<List<FileInfoDTO>> listFiles(@RequestParam("folderId") Long folderId) {
+    public Result<List<FileInfoDTO>> listFiles(@RequestParam(value = "folderId", required = false) Long folderId) {
         List<FileInfo> files = fileService.findByFolderId(checkFolder(folderId).getId());
         return Result.success(BeanMapper.mapList(files, FileInfoDTO.class));
     }

+ 26 - 0
base-servers/file/file-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,26 @@
+eureka:
+  instance:
+    hostname: saas-file-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_file?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+fdfs:
+  tracker-list:
+    - 10.10.100.200:22122
+logging:
+  destination: 10.10.100.160:5000

+ 5 - 3
base-servers/file/file-server/src/test/java/com/usoftchina/saas/file/controller/FileControllerTest.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.file.controller;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.file.dto.FileInfoDTO;
 import com.usoftchina.saas.file.dto.FolderDTO;
+import com.usoftchina.saas.file.dto.FolderSaveDTO;
 import com.usoftchina.saas.file.util.RandomTextFile;
 import com.usoftchina.saas.test.BaseControllerTest;
 import org.apache.commons.lang.RandomStringUtils;
@@ -28,9 +29,10 @@ public class FileControllerTest extends BaseControllerTest {
     public static Long folder_1_2_1;
 
     private FolderDTO newFolder(Long folderId, String name) throws Exception{
-        MvcResult mvcResult = mockMvc.perform(post("/folder")
-                .param("folderId", String.valueOf(folderId))
-                .param("name", name))
+        FolderSaveDTO folderSaveDTO = new FolderSaveDTO();
+        folderSaveDTO.setFolderId(folderId);
+        folderSaveDTO.setName(name);
+        MvcResult mvcResult = mockMvc.perform(requestBody("/folder", folderSaveDTO))
                 .andExpect(isSuccess())
                 .andReturn();
         Result<FolderDTO> result = result(mvcResult, FolderDTO.class);

+ 19 - 0
base-servers/gateway-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,19 @@
+eureka:
+  instance:
+    hostname: saas-gateway-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 23 - 0
base-servers/mail/mail-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,23 @@
+eureka:
+  instance:
+    hostname: saas-mail-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  datasource:
+    url: jdbc:mysql://10.10.100.18:3306/saas_mail?characterEncoding=utf-8&useSSL=false
+    username: saas
+    password: select111***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 19 - 0
base-servers/socket/socket-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,19 @@
+eureka:
+  instance:
+    hostname: saas-socket-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 19 - 0
base-servers/ui-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,19 @@
+eureka:
+  instance:
+    hostname: saas-ui-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  data:
+    mongodb:
+      uri: mongodb://10.10.100.123:27017/saas_ui
+logging:
+  destination: 10.10.100.160:5000

+ 13 - 0
base-servers/zipkin-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,13 @@
+eureka:
+  instance:
+    hostname: saas-zipkin-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+zipkin:
+  collector:
+    rabbitmq:
+      uri: amqp://saas:select123***@10.10.100.103:5672/docker
+logging:
+  destination: 10.10.100.160:5000

+ 9 - 0
script/mysql/init/auth.sql

@@ -8,4 +8,13 @@ create table `au_authorize_log` (
   client_ip varchar(100) comment '客户端IP',
   user_agent varchar(300) comment 'User Agent',
   login_time datetime comment '登录时间'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='登录日志';
+
+create table `au_virtual_authorize_log` (
+  id int unsigned primary key not null auto_increment,
+  app_id varchar(30) comment '应用',
+  mobile varchar(20) not null comment '手机号',
+  client_ip varchar(100) comment '客户端IP',
+  user_agent varchar(300) comment 'User Agent',
+  login_time datetime comment '登录时间'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='登录日志';

+ 5 - 1
script/mysql/init/base.sql

@@ -1,3 +1,7 @@
 CREATE USER 'saas'@'%' IDENTIFIED BY 'select111***';
-GRANT All privileges ON 'saas_*'.* TO 'saas'@'%';
+GRANT All privileges ON saas_account.* TO 'saas'@'%' identified by 'select111***' with grant option;
+GRANT All privileges ON saas_auth.* TO 'saas'@'%' identified by 'select111***' with grant option;
+GRANT All privileges ON saas_file.* TO 'saas'@'%' identified by 'select111***' with grant option;
+GRANT All privileges ON saas_mail.* TO 'saas'@'%' identified by 'select111***' with grant option;
+GRANT All privileges ON saas_biz.* TO 'saas'@'%' identified by 'select111***' with grant option;
 flush privileges;

+ 1 - 1
script/mysql/init/mail.sql

@@ -14,7 +14,7 @@ create table `m_log` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='邮件日志';
 
 create table `m_template` (
-  `id` varchar(300) primary key not null,
+  `id` varchar(100) primary key not null,
   `subject` varchar(300) not null comment '主题',
   `text` text comment '内容'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='邮件模板';