[+] 添加集群配置

This commit is contained in:
acgist
2023-01-15 20:05:22 +08:00
parent fed00218fb
commit 03f34ca888
7 changed files with 102 additions and 6 deletions

View File

@@ -8,6 +8,7 @@
|:--|:--|:--|
|taoyao|桃夭|桃之夭夭灼灼其华|
|taoyao-boot|基础|基础模块|
|taoyao-node|集群|集群模块|
|taoyao-live|直播|直播、连麦、本地视频同看|
|taoyao-media|媒体|录制<br />音频(降噪、混音、变声)<br />视频水印、美颜、AI识别|
|taoyao-signal|信令|信令服务|

View File

@@ -36,6 +36,7 @@
<modules>
<module>taoyao-boot</module>
<module>taoyao-node</module>
<module>taoyao-live</module>
<module>taoyao-media</module>
<module>taoyao-signal</module>

View File

@@ -0,0 +1,47 @@
package com.acgist.taoyao.boot.property;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* 节点配置
*
* @author acgist
*/
@Getter
@Setter
@Schema(title = "节点配置", description = "节点配置")
public class NodeProperties {
/**
* 节点主机
*/
@Schema(title = "节点主机", description = "节点主机")
private String host;
/**
* 节点端口
*/
@Schema(title = "节点端口", description = "节点端口")
private Integer port;
/**
* 用户
*/
@Schema(title = "节点用户", description = "节点用户")
@JsonIgnore
private String username;
/**
* 密码
*/
@Schema(title = "节点密码", description = "节点密码")
@JsonIgnore
private String password;
/**
* 服务节点ID
*/
@Schema(title = "服务节点ID", description = "服务节点ID")
private String serverId;
}

View File

@@ -2,6 +2,7 @@ package com.acgist.taoyao.boot.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@@ -16,24 +17,35 @@ import lombok.Setter;
public class TaoyaoProperties {
/**
* 地址
* 项目地址
*/
@Schema(title = "项目地址", description = "项目地址")
private String url;
/**
* 名称
* 项目名称
*/
@Schema(title = "项目名称", description = "项目名称")
private String name;
/**
* 超时时间
*/
@Schema(title = "超时时间", description = "超时时间")
private Long timeout;
/**
* 版本
* 项目版本
*/
@Schema(title = "项目版本", description = "项目版本")
private String version;
/**
* 描述
* 项目描述
*/
@Schema(title = "项目描述", description = "项目描述")
private String description;
/**
* 服务节点ID
* 集群使用
*/
@Schema(title = "服务节点ID", description = "服务节点ID")
private String serverId;
}

6
taoyao-node/README.md Normal file
View File

@@ -0,0 +1,6 @@
# 集群
## 实现逻辑
1. 集群启动时加载所有节点,同步节点信息,定时监测节点状态。
2. 设备注册同步设备信息到直连节点,其他信令处理完成以后在发送设备时分发。

22
taoyao-node/pom.xml Normal file
View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.acgist</groupId>
<artifactId>taoyao</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>taoyao-node</artifactId>
<packaging>jar</packaging>
<name>taoyao-node</name>
<description>集群服务:集群服务</description>
<dependencies>
</dependencies>
</project>

View File

@@ -52,6 +52,7 @@ taoyao:
timeout: 5000
version: 1.0.0
description: WebRTC信令服务
server-id: 1
id:
sn: 0
max-index: 999999
@@ -109,8 +110,8 @@ taoyao:
port: 18888
schema: wss
websocket: /websocket.signal
username: username
password: password
username: taoyao
password: taoyao
# Moon架构配置
moon:
audio-mix: true
@@ -130,3 +131,9 @@ taoyao:
password: taoyao
scheduled:
session: 0 * * * * ?
node-list:
- host: localhost
port: 8888
username: ${taoyao.security.username:taoyao}
password: ${taoyao.security.username:taoyao}