暂无描述

reghao 1192eec56c 更新 message-service 配置, 还是要使用 dubbo, 虽然不作为 provider, 但还要所作 account-service 的 consumer 4 月之前
account 5aadb746c3 更新 Dockerfile 中使用的镜像 4 月之前
auth f9395a7b78 jdk11 -> jdk17 4 月之前
common f9395a7b78 jdk11 -> jdk17 4 月之前
content 4b689eaa71 content-service 引入 shardingsphere-jdbc:5.5.2 版本实现读写分离 4 月之前
data 5aadb746c3 更新 Dockerfile 中使用的镜像 4 月之前
eureka 5aadb746c3 更新 Dockerfile 中使用的镜像 4 月之前
file 9ae1929070 更新 pom.xml 和 application.yml 4 月之前
gateway 5aadb746c3 更新 Dockerfile 中使用的镜像 4 月之前
message 1192eec56c 更新 message-service 配置, 还是要使用 dubbo, 虽然不作为 provider, 但还要所作 account-service 的 consumer 4 月之前
oss 59b12ed1b6 pom.xml 中添加 maven-compiler-plugin 并指定 -parameters 配置参数, 解决 parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag 问题 4 月之前
search 5aadb746c3 更新 Dockerfile 中使用的镜像 4 月之前
user 5aadb746c3 更新 Dockerfile 中使用的镜像 4 月之前
zzz 50297584e7 add run_thirdparty.sh 4 月之前
.gitignore 8c81a4cbfd update gitignore 5 月之前
README.md 703a29012c update README.md 4 月之前
pom.xml f9395a7b78 jdk11 -> jdk17 4 月之前

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 > 依赖 redis, rabbitmq, mysql, zookeeper
  • message:6002 > 依赖 redis, rabbitmq, mysql
  • file:6003 > 依赖 redis, mysql, zookeeper
  • user:6004 > 依赖 redis, mysql, zookeeper
  • content:6005 > 依赖 redis, rabbitmq, mysql, zookeeper, mongodb
  • data:6006 > 依赖 redis, rabbitmq, mysql, mongodb
  • search:6007 > 依赖 redis, mysql, zookeeper, 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 系统来自动构建部署应用.