Açıklama Yok

reghao bd5f230519 update NginxLogService 2 ay önce
account 6494cece84 update 3 ay önce
common f2793677c9 ControllerExceptionHandler 中添加对 RpcException 的处理 3 ay önce
common-auth 8e983e3df4 auth 模块更名为 common-auth, 表示这是一个公共模块 4 ay önce
content 633bfe2263 update sharding-dev.yml 3 ay önce
data 139ec0a129 1.调整 pom.xml 中的依赖结构 4 ay önce
eureka 5aadb746c3 更新 Dockerfile 中使用的镜像 4 ay önce
file 409abc0289 file-service 添加 tess4j 依赖实现 ocr 功能 2 ay önce
gateway abe35ad7ea update gateway AdminServer 3 ay önce
message 981b5c6305 update message-service RouteService 3 ay önce
oauth2 c8e36e2218 将 oauth2-* 相关模块移到新建的 oauth2 模块中 3 ay önce
oss 8e983e3df4 auth 模块更名为 common-auth, 表示这是一个公共模块 4 ay önce
sb 82c2594bed 添加 springboot 模块 sb 3 ay önce
search bd5f230519 update NginxLogService 2 ay önce
user c660db5558 update user-service UserVipService.java 3 ay önce
zzz 257aaf02aa update build.sh 4 ay önce
.gitignore 8c81a4cbfd update gitignore 5 ay önce
README.md f7e25cc1ec update README.md 4 ay önce
pom.xml c8e36e2218 将 oauth2-* 相关模块移到新建的 oauth2 模块中 3 ay önce

README.md

tnb

微服务实践, 本项目实现了一个类似 bilibili 的 VOD 系统后端

客户端包括 Web 应用和 Android 应用

分别由 tnbapp 项目和 tnbdroid 项目提供

版本

jdk 和框架

第三方依赖

  • mysql:5.7
  • redis:6.0.16
  • rabbitmq:3.8.9
  • zookeeper:3.8.4
  • mongodb:4.4
  • nacos-server:v2.4.1
  • elasticsearch:7.17.18 > 仅 search-service 依赖, 选用 lucene 则不再需要 elasticsearch

模块

tnb 项目模块:

  • eureka:6060 > 不依赖第三方
  • gateway:6000 > 依赖 redis, rabbitmq
  • account:6001 > 依赖 mysql, redis, zookeeper, rabbitmq
  • message:6002 > 依赖 mysql, redis, zookeeper, rabbitmq
  • file:6003 > 依赖 mysql, redis, zookeeper
  • user:6004 > 依赖 mysql, redis, zookeeper
  • content:6005 > 依赖 mysql, redis, zookeeper, rabbitmq, mongodb
  • data:6006 > 依赖 mysql, redis, rabbitmq, mongodb
  • search:6007 > 依赖 mysql, redis, zookeeper, rabbitmq, mongodb, elasticsearch, nacos > > 选用 lucene 则不再需要 elasticsearch
  • oss-store:4010 > 依赖 mysql

构建部署

pull 项目源码

cd ~/Downloads
git clone https://git.reghao.cn/reghao/tnb.git

初始化 MySQL

cd ~/Downloads/tnb/zzz
bash db_init.sh

执行 db_init.sh 会自动创建 tnb 项目需要的数据库并初始化数据库表

需要自行指定 db_init.sh 脚本中的 host, username, password 等变量值

构建并运行

cd ~/Downloads/tnb/zzz
bash build_jar.sh

执行 db_init.sh 会自动构建并运行 tnb 项目各应用 jar 包

build_jar.sh 脚本中的 proj_dir 变量默认是 ~/Downloads/tnb

mvn 构建默认使用 dev 环境, 所以需要修改每个应用 resources/application-dev.yml 配置文件中的第三方服务配置

默认运行的是 jar 包, 也可构建并运行 docker 镜像, 详见 build_jar.sh 脚本的 build_image 和 exec_image 函数

停止应用

cd ~/Downloads/tnb/zzz
bash shutdown.sh

执行 shutdown.sh 会结束 tnb 项目中的各个应用

其他

本项目模块太多, 构建部署都太过繁琐, 推荐使用 bnt 项目提供的 devops 系统来自动构建部署应用.