Sin descripción

reghao af9f667971 更新 content-service mapper 中的表名 hace 1 año
account da3fa6e200 1.org.apache.zookeeper.zookeeper 版本升级到 3.4.8 hace 1 año
common 9df70341f6 更新前端 el-select 标签中 el-option 的值对象格式 hace 1 año
content af9f667971 更新 content-service mapper 中的表名 hace 1 año
data da3fa6e200 1.org.apache.zookeeper.zookeeper 版本升级到 3.4.8 hace 1 año
file e76f36b1ab file-service 添加一个 pdf 文件生成功能 hace 1 año
gateway da3fa6e200 1.org.apache.zookeeper.zookeeper 版本升级到 3.4.8 hace 1 año
log afd0a98406 使用 tnb1 项目 master 分支的 2478e4c4 commit 作为起点 hace 1 año
message da3fa6e200 1.org.apache.zookeeper.zookeeper 版本升级到 3.4.8 hace 1 año
user 00e6220525 user-service 中的 UserMessage 和 UserProfile 需要继承 BaseObject hace 1 año
zzz f35d7e2f73 更新脚本文件 hace 1 año
.gitignore afd0a98406 使用 tnb1 项目 master 分支的 2478e4c4 commit 作为起点 hace 1 año
README.md afd0a98406 使用 tnb1 项目 master 分支的 2478e4c4 commit 作为起点 hace 1 año
pom.xml 0fb07c0873 删除 mall 模块 hace 1 año

README.md

tnb

微服务实践

依赖

  • os:Linux
  • jdk:11
  • maven:3.9
  • mysql:5.7
  • redis
  • rabbitmq
  • zookeeper:3.4
  • mongodb:4.4

架构

tnb 项目模块:

  • gateway:6000
  • account:6001
  • user:6002
  • message:6003
  • file:6004
  • content:6005
  • mall:6006
  • data:6007

初始化 MySQL

  • 1.bnt/zzz/bnt_init.sql 文件是系统的初始数据
  • 2.执行 bnt/zzz/init_schema.sh 脚本可完成数据库的创建和初始化 > 需要自行指定脚本中的 host, username, password, db 等变量值
  • 3.然后可以开始构建和部署系统

构建

根据需要构建的类型使用 wget 获取构建脚本:

# 构建 jar 包使用此脚本
wget https://git.reghao.cn/reghao/tnb/raw/master/zzz/build_jar.sh

# 构建 docker 镜像使用此脚本
wget https://git.reghao.cn/reghao/tnb/raw/master/zzz/build_image.sh
  • 1.修改构建脚本中的 base_dir 变量的值
  • 2.执行构建脚本
  • 3.构建完成 > 如果使用 build_jar.sh 脚本构建, 生成的 jar 包会存放在相应模块的 target 目录中 > > 如果使用 build_image.sh 脚本构建, 生成的镜像可使用 docker images | grep 'tnb' 命令查看

部署

使用下述命令启动:

# 构建的 jar 包
java -jar xxx.jar 

# 构建的 docker 镜像
docker run -d --name=tnb-xxx --network=host reghao/tnb-xxx:12345678

默认使用 resources/application-test.yml 配置文件

此项目模块太多, 构建部署都太过繁琐, 推荐使用 devops 项目来自动构建部署应用.