2
0
Files
build.wfc/docs/03-configuration/03-wfc-quickstart.md

242 lines
6.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# WANFi Control and Billing Management System
## 准备工作
* 硬件要求
```text
CPU: >= 4 core
Memory: >= 16GiB
Storage:
OS: >= 50GiB
/opt/wfc: >= 50GiB # work and database storage
/var/lib/docker: >= 50GiB
```
* 系统环境
```text
Linux >= Ubuntu 22.04
JDK >= 1.8 (Recommended version 1.8) (用于Omada SDN Controller)
docker >= 24.0.7, build 24.0.7-0ubuntu2~22.04.1
docker-compose >= v2.10.0
```
* 安装docker和docker-compose
```sh
sudo apt-get update
sudo apt-get install -y docker.io
sudo curl -L "https://github.com/docker/compose/releases/download/v2.10.0/docker-compose-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)" -o /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
```
* 请确认docker和docker-compose的版本是否符合要求
```sh
docker -v
docker-compose -v
```
## 获取安装包
安装包名: wfc-1.0.2-20241212.tar.gz
说明:
* 版本号: 1.0.2
* 构建日期20241212
根据情况获取最新版本的软件安装包
## 安装和配置软件
* 创建安装目录
```sh
sudo mkdir /opt/wfc
```
* 解压软件包至安装目录
```sh
sudo tar xvfz wfc-1.0.2-20241212.tar.gz -C /opt/wfc
```
* 安装后目录树
```text
/opt/wfc # work root directory
├── bin # shell script and binary file
├── docker # docker compose work directory
│   ├── env # default docker environment file, will be copy to docker compose work directory
│   ├── java # java image directory
│   ├── mysql # mysql database container directory
│   │   ├── conf
│   │   ├── conf.d
│   │   ├── data
│   │   ├── db
│   │   ├── logs
│   │   └── tmp
│   ├── nacos # nacos container directory
│   │   ├── conf
│   │   └── logs
│   ├── nginx # nginx container directory
│   │   ├── conf
│   │   ├── conf.d
│   │   ├── html
│   │   │   └── dist
│   │   │   ├── sys # system portal
│   │   │   └── u # user portal
│   │   └── logs
│   ├── redis # redis container directroy
│   │   ├── conf
│   │   └── data
│   └── wfc # wfc container root directory
│   ├── auth # auth root directory
│   │   └── jar
│   ├── gateway # gateway root directory
│   │   └── jar
│   ├── modules # modules root directory
│   │   ├── file
│   │   │   └── jar
│   │   ├── gen
│   │   │   └── jar
│   │   ├── job
│   │   │   └── jar
│   │   ├── payment
│   │   │   └── jar
│   │   ├── system
│   │   │   └── jar
│   │   └── user
│   │   └── jar
│   ├── upload # file upload directory
│   └── visual
│   └── monitor
│   └── jar
└── systemd # service daemon filewill be copy to /etc/systemd/system
└── system
```
* 配置软件
```sh
cd /opt/wfc/bin
sudo ./wfcsetup.sh all 192.168.13.128 # 参数2是宿主机IP地址
```
* 修改docker环境参数
根据实际情况修改如下环境参数配置(*WFC_SERVER_IP的地址已经在上面配置过程被替换)
```sh
cd /opt/wfc/docker
cat .env
WFC_CONFIG_DATABASE=wfc_config_db
WFC_SYSTEM_DATABASE=wfc_system_db
WFC_USER_DATABASE=wfc_user_db
MYSQL_SERVICE_NAME=wfc-mysql
MYSQL_SERVICE_PORT=3306
MYSQL_ROOT_PASSWORD=123456
MYSQL_SERVICE_USER=root
MYSQL_SERVICE_PASSWORD=123456
REDIS_PORT=6379
NACOS_PROFILE_NAME=prod
NACOS_NAME_SPACE=wfc-prod
NACOS_SERVER_NAME=wfc-nacos
WFC_SERVER_PORT=80
NACOS_SERVER_PORT=8848
GATEWAY_SERVER_PORT=8080
AUTH_SERVER_PORT=8081
WFC_FILE_PORT=9201
WFC_JOB_PORT=9203
WFC_PAYMENT_PORT=9204
WFC_SYSTEM_PORT=9205
WFC_USER_PORT=9206
WFC_SERVER_IP=192.168.13.128
NACOS_SERVER_IP=${WFC_SERVER_IP}
GATEWAY_SERVER_IP=${WFC_SERVER_IP}
RESTART_OPTION=on-failure:5
```
## 配置整合Omada平台的连接参数
* 从Omada服务中获取门户平台整合连接参数如下图
![Omada platform integration configuration screenshot](wfc-omada-integration.png)
注意连接的MODE采用Client 具体的配置方式可参考Omada的相关文档
* 修改配置文件
修改如下omada的配置项
```sh
cd /opt/wfc/conf
cat application-common.yml
spring:
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
# feign 配置
feign:
sentinel:
enabled: true
okhttp:
enabled: false
httpclient:
enabled: true
disable-ssl-validation: true
client:
config:
default:
connectTimeout: 60000
readTimeout: 60000
compression:
request:
enabled: true
min-request-size: 8192
response:
enabled: true
# 暴露监控端点
management:
endpoints:
web:
exposure:
include: '*'
# Omada 配置
omada:
omada-url: 'https://192.168.2.249:8043'
omadac-id: 'f3aa6e479b94222581523710cc2c2a9d'
client-id: '5036e77c81a74008821c694a715fe2b8'
client-secret: '29faa06fb7f244b094377b48eb3083a7
```
* 启动/查看/停止/版本软件
```sh
cd /opt/wfc/bin
sudo ./wfccontrol.sh start/restart/status/stop/version
```
## 通过浏览器访问客户平台和用户平台
* 客户平台门户地址:
```url
http://192.168.13.128/sys
```
* 用户平台门户地址:
```url
http://192.168.13.128/u
```