概述
owt 整體基于微服務(wù)的架構(gòu)思想先鱼,每個服務(wù)節(jié)點可以單獨部署赡译,多點部署
ClusterManager - 注冊中心
每個運行的節(jié)點都會發(fā)送 RPC join 注冊,并記錄在注冊中心粉私。其他節(jié)點會發(fā)送 RPC schedule 到 ClusterManager 查詢可用節(jié)點绷旗。
ClusterManager 本身使用選舉機(jī)制來實現(xiàn)高可用,ClusterManger 本身也集成了資源調(diào)度的功能际乘,其他節(jié)點使用指定的策略來進(jìn)行調(diào)度坡倔。
OWT 并沒有使用配置中心,每個節(jié)點都是用 TOML 文件來進(jìn)行配置脖含。
(refs: https://en.wikipedia.org/wiki/Leader_election - 選舉機(jī)制)
(refs: https://github.com/open-webrtc-toolkit/owt-server/blob/8a166cc998341ee7a590d8683dfafdfe3d6e0d5f/source/cluster_manager/strategy.js#L72 - 調(diào)度策略)
(refs: https://github.com/open-webrtc-toolkit/owt-server/blob/8a166cc998341ee7a590d8683dfafdfe3d6e0d5f/source/common/clusterWorker.js#L249 - 注冊)
(refs: https://github.com/open-webrtc-toolkit/owt-server/blob/8a166cc998341ee7a590d8683dfafdfe3d6e0d5f/source/agent/conference/rpcRequest.js#L15 - RPC schedule 獲取可用節(jié)點)
RPC and InternalIO - 服務(wù)間通訊
OWT 的節(jié)點間通過使用 RabbitMQ 構(gòu)建的 RPC 服務(wù)進(jìn)行互相調(diào)用罪塔,媒體數(shù)據(jù)通過 InternalIO 來進(jìn)行互相傳輸。
(refs: https://github.com/open-webrtc-toolkit/owt-server/blob/8a166cc998341ee7a590d8683dfafdfe3d6e0d5f/source/common/makeRPC.js#L8 - RPC 調(diào)用)
(refs: https://github.com/open-webrtc-toolkit/owt-server/blob/8a166cc998341ee7a590d8683dfafdfe3d6e0d5f/source/core/owt_base/InternalOut.cpp#L46 - InternalIO 發(fā)送數(shù)據(jù))