dragonflyoss / Dragonfly2

Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project.
https://d7y.io
Apache License 2.0
2.29k stars 292 forks source link

Sync peers' host info from scheduler #3634

Open gaius-qi opened 3 weeks ago

gaius-qi commented 3 weeks ago

Feature request:

Manager will send sync peers job to scheduler by MQ(Redis). There is too much data(peers' host), so mysql is needed to store peers' host info instead of creating a sync peers job every time.

Manager console should display peers' host info, it needs to query information from mysql.

When is sync peers triggered?

  1. Triggers every 12 hours by default and the interval is configurable.
  2. For forced triggering, the manager needs to provide a REST API for forced triggering.

Related files:

  1. https://github.com/dragonflyoss/Dragonfly2/blob/main/manager/job/sync_peers.go
  2. https://github.com/dragonflyoss/Dragonfly2/blob/main/manager/router/router.go#L188
  3. https://github.com/dragonflyoss/Dragonfly2/blob/main/scheduler/job/job.go#L466

Use case:

UI Example: