Version:
RayVentory Data Hub Agent 12.2 or later
Introduction:
This article describes how to install two or more instances of the Data Hub Agent on the same Windows server. The first agent should be installed by using the Windows Installer setup (.MSI).
Every further and additional Data Hub Agent must be installed manually.
Proceed as follows:
- Copy the whole installation folder of the default agent
from "C:\Program Files (x86)\RayVentory\DataHubAgent"
into a new folder, for example "C:\Program Files (x86)\RayVentory\DHAgentTwo" - Every additional Agent requires a new AgentID, which must be different from all other ones. To generate a new GUID, start PowerShell terminal and execute the following command
[Guid]::NewGuid().ToString().ToUpper()
Copy the result as new GUID (globally unique identifier) into the clipboard (CTRL+C) - Open "Raynet.RayVentory.DataHub.Agent.dll.config" in the new folder by using a text editor (changing that file may require Administrator privilege)
- Edit line " <add key="AgentId" value="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"/> " and replace the current ID (36 characters) by the new GUID within the braces
- Edit line " <add key="TemporaryFilesDirectory" value="{driveletter:\temp\folder}"/> " and enter an existing folder used as location for temporary files (preferably a location with sufficient free disc space)
- Save changes and close "Raynet.RayVentory.DataHub.Agent.dll.config"
- Open "log4net.config" in the new folder by using a text editor (changing that file may require Administrator privilege)
- If the additonal agent will run under its own Windows account and if folders for log files points to "%env{LOCALAPPDATA}\...." then there is nothing to do. Otherwise search for "\Logs\{filename}.log" and replace "{filename}" with a new unique name.
Attention: There are at least 3 different log file names.
Example: change "Agent.log" into "AgentTwo.log", "Agent-ETL.log" into "Agent-ETLtwo.log", "Collector.Log" into "CollectorTwo.log"
Save your changes, if any. - Open CMD.EXE as Administrator and change the current director to "C:\Program Files (x86)\RayVentory\DHAgentTwo"
- Execute the following command to create an extra Windows Service for the new agent (example):
Raynet.RayVentory.DataHub.Agent.exe install -servicename "RayVentory Data Hub Agent 2"
Note: the parameter servicename must have a unique value. - If the service was installed successfully, open Windows "Services" and check that the new service name exists. Then edit and change the "Log On" account of this new Windows Service.
- If the new service is configured, start the new service and check if the new Agent appears in the agent list of the corresponding tenant within RayVentory Data Hub. Once the new agent is active, select "edit agent" and "authorize" the new agent in Data Hub tenant.
Great article. If this approach is used, how does upgrading multiple agents on the same system work? I know the registry is used to help determine if an agent already exists, but I'm assuming the registry can only be used for one of the agents, is that correct?
Hello Lao, yes the registry is only used by the MSI installation, as all additional instances are simply portable versions of the MSI install.
So, after you have performed an in-place upgrade, you need to update all portable instances by copying and pasting the new binaries from the MSI's INSTALLDIR to their instance directories.
Thank you for your help. Regarding the following statement:
"So, after you have performed an in-place upgrade, you need to update all portable instances by copying and pasting the new binaries from the MSI's INSTALLDIR to their instance directories."
When we update the portable instances, I'm assuming that before we overwrite the portable installation, we have to note down the AgentID that was in use. Then we overwrite the the portable installation. Finally, we update Raynet.RayVentory.DataHub.Agent.dll.config with the AgentID that we used previously so that a new agent is not created, but the previous agent is reused. Is this correct? Anything else we have to do to make sure a new agent record is not created within the database?
Also, as part of the upgrade, do we have to delete/remove the windows service for the portable installation, and then recreate it using the instructions above after copying over the new version of the portable datahub agent?
Thanks again for your help!
Before updating a "portable" Data Hub Agent, you need to stop it's corresponding Windows Service. Then you can update all files and keep the AgentID. Compare, if the command and options of the "portable" agent service is still equal with the original command (apart from the different folder). If there is a new parameter for the service command, then apply this also to the command for your "portable" version.
Once the update is fine, just restart the corresponding Windows Service, which then should match the existing Agent record within Data Hub.