|
|
1 year ago | |
|---|---|---|
| config | 1 year ago | |
| db | 1 year ago | |
| nginx | 1 year ago | |
| .gitignore | 1 year ago | |
| README.md | 1 year ago | |
| build.sh | 1 year ago | |
| shutdown.sh | 1 year ago | |
| start.sh | 1 year ago |
tnb 是一个 bilibili-like 的 VOD 系统, 使用前后端分离模式开发, 后端采用微服务, 整个系统包括下述项目:
构建部署流程如下:
鉴于 oss-store 应用需要在本地磁盘上存储文件, 为了便于文件存储目录的更改, 故采用外部配置. 其的配置文件(tmp/bin/oss-store/oss.yml) 的内容如下:
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/reghao_oss_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
username: test
password: Test@123456
server:
tomcat:
basedir: /opt/tmp/tomcat
oss:
store-host: 127.0.0.1
store-dirs:
- /opt/disk/13f654c8-af87-4710-aac9-7aa086c99aec/
console-host: 127.0.0.1
第一步, 修改 basedir, store-host, store-dirs, console-host 等配置
- basedir
> 上传文件时 tomcat 存放的临时目录- store-host
> oss-store 应用所在机器的地址- store-dirs
> 实际存放文件的目录, 可配置为多个目录, 但必须保证每个目录挂载到不同的磁盘- console-host
> bntweb 应用所在机器的地址若 oss-store 和 bntweb 部署在同一台机器上, 那么只需要修改 basedir 和 store-dirs
第二步, 然后切换到 tmp/bin/oss-store 目录下后执行 start.sh 脚本启动应用
oss-store 启动时会调用 bntweb 的 RCP 接口, 所以需要 bntweb 应用运行后再启动 oss-store
当然如果采用 aliyun-oss 存储文件, 那么就不需要使用 oss-store 应用
首先配置 hosts 文件, 在hosts 文件中添加下述映射:
# 指向 oss-store
127.0.0.1 oss.reghao.cn
# 指向 tnb
127.0.0.1 api.reghao.cn
# 指向 tnbapp
127.0.0.1 tnb.reghao.cn
# 指向 bntweb
127.0.0.1 bnt.reghao.cn
然后配置 nginx, 详见 nginx/nginx.conf 和 nginx/conf.d/tnb.conf 文件
需要修改的是 nginx/conf.d/tnb.conf 文件中 tnb.reghao.cn 域名所在的 block
将 root 修改为 tmp/bin/tnbapp 目录的实际路径
后台系统地址(即 bntweb 应用)
默认提供三个帐号:
- 超级管理员帐号 admin
> 帐号密码 admin12345678- tnb 系统管理员帐号 gjstnb
> 帐号密码 gjstnb12345678- oss 系统管理员帐号 gjsoss > 帐号密码 gjsoss12345678
前台系统地址(即 tnbapp 应用)