- 24 Mar 2022
- 6 Minutes to read
-
Print
-
DarkLight
-
PDF
HOWTO: Content Distribution for Edge Computing
- Updated on 24 Mar 2022
- 6 Minutes to read
-
Print
-
DarkLight
-
PDF
How to use ProGet’s Replication Feature to distribute packages to Edge Locations
Organizations with edge computing architectures need to constantly push out content like system packages (Debian, RPM, Chocolatey), docker images, and other file assets to their edge locations.
ProGet Enterprise can help with edge computing distribution thanks to the Replication feature. This allows different locations to share content without setting up more complicated, global infrastructure.
This guide will explain how to use the Replication feature to create a standard “Hub and Spoke” configuration within ProGet to easily distribute content to other servers.
Feed Replication
Feed replication can be very granular in ProGet. This guide will cover a specific configuration that is best for Edge Computing (e.g. distributing from a main server to many local servers). Our Feed Replication documentation covers other possible configurations in ProGet.
For this specific guide, we’ll be focusing on a “Hub and Spoke” model where the Source server is the “Hub” and the Target/Edge servers are “Spokes.” In this model, content travels one-way from the Hub to the Spoke.
Any server in a group can change communication direction, depending on the configuration set up. This guide, however, is specifically to configure a Source server to only push packages out.
Please note, the replication feature requires a ProGet Enterprise license.
This steps/screenshots in this guide were based on ProGet v2022's replication UI, which are available as a preview feature in ProGet v6.0.11+. The concepts are the same in earlier versions, however.
Step 1: Designate your Hub server and Spoke servers
This will help avoid confusion throughout the guide.
Your Hub will be your Source server; the main server that teams or developers push to first. Your Spokes are your Target Edge locations, which you want to distribute to.
Step 2: In the Hub server, in ProGet, navigate to Replication
In ProGet of your Hub server, navigate to the Replication page from the top ribbon.
Once there, click [Configure New Replication].
A pop-up will appear with “Configuration Replication" options.
Step 3: Configure Hub server for Incoming replication
In the pop-up, select the Feed you want to replicate from the drop-down selection, then click [Communication Mode].
On the Communication mode tab, select the communication type "Incoming (allow other ProGet instance to connect to this instance)"
- Incoming is a “read only” state; Spokes may connect to the Hub and pull changes, but not push changes back.
Set the "Authentication mode" to "Require a specific sync token"
We want the Hub server set to Incoming Replication for easier configuration of our Spoke servers.
Otherwise, you would have to add each Spoke to the Hub server as Outgoing Replication.
Step 4: Generate a Sync Token and Save the Source URL
Once the Communication and Authentication options are selected, the “Sync token” line item will appear.
Click [generate] and copy this token for Step 8.
Click [Replication Mode] to continue.
Step 5: Set the Replication Mode of the Hub Server
In the same pop-up, on the Replication mode tab, select the type of replication for your server.
In this tutorial, we want the Hub server to be read-only so it does not query the Spokes for changes.
Set the mode to "Push Content to Other Instance."
Click [Summary].
Confirm your previous choices on the summary page. If satisfied, click [Add New Replication].
Step 6: In the Spoke server, create a new feed
In the Spoke server, create a new feed that is the same type as the Hub server feed from steps 2 – 5.
The names do not have to be the same.
Step 7: In the Spoke server, navigate to Replication.
Like in Step 2, In ProGet of your Spoke server, navigate to the Replication page from the top ribbon.
Once there, click [Configure New Replication].
Step 8: Configure the Spoke server for Outgoing Replication
In the pop-up, select the feed you want to replicate from the Hub server.
Continue by clicking [Communication Mode].
On the next page, select "Outgoing (routinely connect to another ProGet instance).
The page will populate with more options.
Once the Outgoing optionis selected, paste in the Hub server's base url, as well as the sync token generated in Step 4.
If your Hub feed name and Spoke feed name are the same, be sure this option is checked.
If your Hub feed name and Spoke feed name are not the same, like in this tutorial, uncheck this option and type in the feed name for "Name for nuget-replicate" (e.g. the name of the Hub feed).
Click [Replication Mode]
Step 9: Set the Replication Mode in the Spoke Server
On Replication mode page of the pop-up, select the Replication mode for this server.
In this tutorial, we want the Spoke server to query the Hub feed for changes, and only pull changes without affecting the Hub.
Set the mode to "Pull Content from Other Instance."
Click [Summary].
Confirm your previous choices on the summary page. If satisfied, click [Add New Replication].
The two servers are now configured. The Spoke server will now regularly check the Hub for packages and replicate.
Step 10: (Optional) Check the Connection
You can confirm the two servers have been successfully connected by manually running a replication.
In the Spoke server, navigate to the Replication tab.
Click [run] in the top right of the “Replication Overview” page.
This will manually run a replication.
Browse to your feed and you will see any packages from the Hub server have been replicated into the Spoke server.
You can also view the results of a run via the log history in the Spoke server.
Step 11: (Optional) Add more Spoke servers
You can now add as many spoke servers as you’d like to replicate the Hub Server.
Repeat steps 6, through 9 in the Spoke servers you’d like to add.
You do not need to change anything in the Hub server.
Multi-Hub Configurations
You may be operating in an organization that relies on multiple Source servers and/or feeds (e.g. a "Secondary Hub") across the world to distribute content to multiple Target servers and/or feeds.
A Multi-Hub configuration has two Source feeds (ex. a USA and an ASIA Source feed) and can be configured using the Replication feature in ProGet Enterprise by the same steps above.
A Secondary Source feed would have to be configured for both Incoming and Outgoing Replication, such that it could, for example, both replicate the Main Source Feed (Outgoing) and allow Target Feeds to replicate it (Incoming).
There are many possible configurations using the Feed Replciation feature in ProGet, like complete mirroring of a single feed across multiple ProGet instances. Check out our Feed Replication documentation to learn about other possible configuration set-ups. It's also possible to set up a feed exclusively for disaster recovery purposes.
Troubleshooting
Issue: Outgoing is not replicating
Despite following the steps above, it’s possible the Spoke server is not replicating packages from the Hub server.
You must navigate to Settings to confirm this: The error “Feed replication failed” will display in the diagnostic center.
It’s possible there was an error in inputting the Sync token or Source URL. Confirm both were accurately copied from the Hub server to the Spoke by repeating Steps 4 - 8.