Add multiple Hubs and register new RPA Nodes on RPA server
The article describes how to add multiple Hubs and register new RPA Nodes on the existing physical or virtual RPA Server.
Prerequisites
- You have a physical or virtual RPA server up and running with at least 1 Hub and 1 Node.
- You have created additional Bot users and assigned the Remote Desktop role to them.
- You have an installation user with Admin rights.
- RPA server is inline with system requirements.
- Typical requirements for five bots are as follows:
- 8 cores
- 16 GB RAM
- 250 GB HDD
- Typical requirements for ten bots are as follows:
- 16 cores
- 32 GB RAM
- 500 GB HDD
Deploy independent Hub with associated Nodes
On the RPA server, go to the
$Drive:/RPA/wfagent/confdirectory and make a backup of theenvironment.ymlfile. As soon as it is done, create a copy ofenvironment.ymland name itenvironment1.yml.Edit these configuration files. The following variables should be duplicated and renamed
environment.ymlFrom:
rpa_hub_hostname: rpa.example.com rpa_hub_port: 4444 rpa_hub_protocol: httpTo:
rpa_hub01_hostname: rpa.example.com rpa_hub01_port: 10443 rpa_hub01_protocol: http rpa_nginx_port: 443environment.ymlFrom:
rpa_hub_hostname: rpa.example.com rpa_hub_port: 4444 rpa_hub_protocol: httpTo:
rpa_hub02_hostname: rpa.example.com rpa_hub02_port: 10444 rpa_hub02_protocol: http rpa_nginx_port: 444The port number needs to be changed from the default one (4444) to the number of the port that is specified in the
hub01.jsonandhub02.jsonfiles accordingly.Rename the
wfagent-hub.ymlfile towfagent-hub01.ymland copy it aswfagent-hub02.ymland so on. You can create any number of the configs you wish. It depends on how many Hubs are configured on the server.Change the value of the server.port parameter from 10000 to any non-used port number in both
wfagenthub01.ymlandwfagent-hub02.ymlfiles. For example:wfagent-hub01.ymlserver.port: 10007wfagent-hub02.ymlserver.port: 10008Change the logging folder name in both
wfagent-hub01.ymlandwfagent-hub02.ymlfiles. For example:wfagent-hub01.ymllogging.folder: logs/hub01wfagent-hub02.ymllogging.folder: logs/hub02Change the values of the following parameters in the datasourcescsection in both
wfagent-hub01.ymlandwfagent-hub02.ymlfiles. Forcexample:From:
datasources: - { id: RpaHub, protocol: "%rpa_hub_protocol%", host: "%rpa_hub_hostname%", port: "%rpa_hub_port%", type: http } - { id: PmMaster, protocol: http, host: "%pm_hostname%", port: "%pm_port%", type: http } - { id: NginxTcp, type: tcp, host: "%rpa_hub_hostname%", port: "%rpa_nginx_port%"}To:
wfagent-hub01.ymldatasources: - { id: RpaHub01, protocol: "%rpa_hub01_protocol%", host: "%rpa_hub01_hostname%", port: "%rpa_hub01_port%", type: http } - { id: PmMaster, protocol: http, host: "%pm_hostname%", port: "%pm_port%", type: http } - { id: NginxTcp, type: tcp, host: "%rpa_hub01_hostname%", port: "%rpa_nginx_port%"}wfagent-hub02.ymldatasources: - { id: RpaHub02, protocol: "%rpa_hub02_protocol%", host: "%rpa_hub02_hostname%", port: "%rpa_hub02_port%", type: http } - { id: PmMaster, protocol: http, host: "%pm_hostname%", port: "%pm_port%", type: http } - { id: NginxTcp, type: tcp, host: "%rpa_hub02_hostname%", port: "%rpa_nginx_port%"}Change the values of RPA Bot Relay parameters in the components section in both
wfagent-hub01.ymlandwfagent-hub02.ymlfiles. For example:From:
- id: rpa.hub name: "RPA Bot Relay" group: rpa.server alerts: [ rpa.hub ]To:
wfagent-hub01.yml- id: rpa.hub01 name: "RPA Bot Relay 1“ group: rpa.server alerts: [ rpa.hub01 ]wfagent-hub02.yml- id: rpa.hub02 name: "RPA Bot Relay 2" group: rpa.server alerts: [ rpa.hub02 ]Change the values of the following parameters in the alerts section in both
wfagent-hub01.ymlandwfagenthub02.ymlfiles. For example:From:
alerts: - id: rpa.hub triggers: - { metric: rpa.hub.slots.status, points: 15, neq: 0, message: "RPA Hub slots API call failed" } - { metric: rpa.hub.console.http.code, neq: 200, message: "RPA Hub is not responding properly" } - { metric: rpa.hub.hc.status, neq: 0, message: "Healthcheck API call failed", type: partial_outage } - { metric: rpa.hub.hc.http.code, neq: 200, message: "Healthcheck API has bad response code", type: partial_outage } - { metric: rpa.hub.hc.health.check.errors, neq: 0, message: "Healthcheck API response contains errors", type: partial_outage } - { metric: rpa.hub.hc.health.check.warnings, neq: 0, message: "Healthcheck API response contains warnings", type: partial_outage }To:
wfagent-hub01.ymlalerts: - id: rpa.hub01 triggers: - { metric: rpa.hub01.slots.status, points: 15, neq: 0, message: "RPA Hub 1 slots API call failed" } - { metric: rpa.hub01.console.http.code, neq: 200, message: "RPA Hub 1 is not responding properly" } - { metric: rpa.hub01.hc.status, neq: 0, message: "Healthcheck API call failed", type: partial_outage } - { metric: rpa.hub01.hc.http.code, neq: 200, message: "Healthcheck API has bad response code", type: partial_outage } - { metric: rpa.hub01.hc.health.check.errors, neq: 0, message: "Healthcheck API response contains errors", type: partial_outage } - { metric: rpa.hub01.hc.health.check.warnings, neq: 0, message: "Healthcheck API response contains warnings", type: partial_outage }wfagent-hub02.ymlalerts: - id: rpa.hub02 triggers: - { metric: rpa.hub02.slots.status, points: 15, neq: 0, message: "RPA Hub 2 slots API call failed" } - { metric: rpa.hub02.console.http.code, neq: 200, message: "RPA Hub 2 is not responding properly" } - { metric: rpa.hub02.hc.status, neq: 0, message: "Healthcheck API call failed", type: partial_outage } - { metric: rpa.hub02.hc.http.code, neq: 200, message: "Healthcheck API has bad response code", type: partial_outage } - { metric: rpa.hub02.hc.health.check.errors, neq: 0, message: "Healthcheck API response contains errors", type: partial_outage } - { metric: rpa.hub02.hc.health.check.warnings, neq: 0, message: "Healthcheck API response contains warnings", type: partial_outage }Enable the respective Nodes in the
processessection in bothwfagent-hub01.ymlandwfagent-hub02.ymlfiles. For example:wfagent-hub01.yml- id: rdp1 expression: "cmd /c start /wait node1.RDP" directory: "rdp" enabled: "${environment.node1_enabled:true}" - id: rdp2 expression: "cmd /c start /wait node2.RDP" directory: "rdp" enabled: "${environment.node2_enabled:true}“wfagent-hub02.yml- id: rdp3 expression: "cmd /c start /wait node3.RDP" directory: "rdp" enabled: "${environment.node3_enabled:true}" - id: rdp4 expression: "cmd /c start /wait node4.RDP" directory: "rdp" enabled: "${environment.node4_enabled:true}"Change the name of the
rpa.bot_relayprocess and specify the respective name of a BAT file in theprocessessection in bothwfagent-hub01.ymlandwfagent-hub02.ymlfiles. For example:From:
- id: rpa.bot_relay expression: "cmd /c start /wait start-hub.bat" directory: "../rpa-grid" tag: "hub"To:
wfagent-hub01.yml- id: rpa.bot_relay01 expression: "cmd /c start /wait start-hub01.bat" directory: "../rpa-grid" tag: "hub"wfagent-hub02.yml- id: rpa.bot_relay02 expression: "cmd /c start /wait start-hub02.bat" directory: "../rpa-grid" tag: "hub"Do not rename the value of the
tagparameter.Comment the following processes in the
processessection inwfagent-hub02.ymlonly.wfagent-hub02.yml# - id: rpa.nginx # expression: "cmd /c start /wait start_nginx.bat" # directory: "../nginx" # tag: "nginx" # - id: rpa.filebeat # expression: "cmd /c start /wait filebeat-pipeline.bat ${environment.agent.hostname} ${environment.pm_hostname} ${environment.logstash_port}“ ${environment.logstash_port}" # directory: "../filebeat" # tag: "filebeat"Change the values of the RPA related metrics in the
checkssection in bothwfagent-hub01.ymlandwfagenthub02.ymlfiles. For example:From:
#RPA related metrics - id: rpa.hub.slots description: "Generate robot metrics from RPA Hub" type: http schedule: 30 expression: "/grid/api/hub" source: RpaHub parameters: request: GET body: "{\"configuration\":[\"newSessionRequestCount\",\"slotCounts\"]}" evaluate: - { id: http.json, arg: newSessionRequestCount, type: int, metric_name: waiting } - { id: http.json, arg: slotCounts.free, type: int, metric_name: free } - { id: http.json, arg: slotCounts.total, type: int, metric_name: max } - { id: expression, arg: "%max% - %free%", type: int, metric_name: running } - id: rpa.hub.console type: http source: RpaHub description: "Generates list of all nodes of a hub" expression: "/grid/console" schedule: 60 evaluate: - { id: rpa.agent.items, arg: nodes } - id: rpa.hub.hc type: http-json source: RpaHub description: "Get RPA Hub health check info" expression: "/grid/admin/HealthCheckHubServlet" schedule: 60 evaluate: - { id: health.check, arg: rpa.hub }To:
wfagent-hub01.yml#RPA related metrics - id: rpa.hub01.slots description: "Generate robot metrics from RPA Hub 1" type: http schedule: 30 expression: "/grid/api/hub" source: RpaHub01 parameters: request: GET body: "{\"configuration\":[\"newSessionRequestCount\",\"slotCounts\"]}" evaluate: - { id: http.json, arg: newSessionRequestCount, type: int, metric_name: waiting } - { id: http.json, arg: slotCounts.free, type: int, metric_name: free } - { id: http.json, arg: slotCounts.total, type: int, metric_name: max } - { id: expression, arg: "%max% - %free%", type: int, metric_name: running } - id: rpa.hub01.console type: http source: RpaHub01 description: "Generates list of all nodes of a hub 1" expression: "/grid/console" schedule: 60 evaluate: - { id: rpa.agent.items, arg: nodes } - id: rpa.hub01.hc type: http-json source: RpaHub01 description: "Get RPA Hub 1 health check info" expression: "/grid/admin/HealthCheckHubServlet" schedule: 60 evaluate: - { id: health.check, arg: rpa.hub01 }wfagent-hub02.yml#RPA related metrics - id: rpa.hub02.slots description: "Generate robot metrics from RPA Hub 2" type: http schedule: 30 expression: "/grid/api/hub" source: RpaHub02 parameters: request: GET body: "{\"configuration\":[\"newSessionRequestCount\",\"slotCounts\"]}" evaluate: - { id: http.json, arg: newSessionRequestCount, type: int, metric_name: waiting } - { id: http.json, arg: slotCounts.free, type: int, metric_name: free } - { id: http.json, arg: slotCounts.total, type: int, metric_name: max } - { id: expression, arg: "%max% - %free%", type: int, metric_name: running } - id: rpa.hub02.console type: http source: RpaHub02 description: "Generates list of all nodes of a hub 2" expression: "/grid/console" schedule: 60 evaluate: - { id: rpa.agent.items, arg: nodes } - id: rpa.hub02.hc type: http-json source: RpaHub02 description: "Get RPA Hub 2 health check info" expression: "/grid/admin/HealthCheckHubServlet" schedule: 60 evaluate: - { id: health.check, arg: rpa.hub02 }Take as a template any of
wfagent-node.ymlfiles and duplicate them according to the number of Nodes.
Modify newly created files. The example below is for
wfagent-node7.yml.wfagent-node7.ymlserver.port: 10008 node_id: 7 environment.node_port: 5007Navigate to
$Drive:/RPA/wfagent/bin.Copy
wfagent-hub.battowfagent-hub1.bat.Edit
wfagent-hub.bat.From:
@ECHO OFF cd %~dp0 set config=conf\environment.yml,conf\wfagent-hub.yml call wfagent.cmd run Hub "%config%"To:
@ECHO OFF cd %~dp0 set config=conf\environment.yml,conf\wfagent-hub01.yml call wfagent.cmd run Hub "%config%"Edit
wfagent-hub1.bat.From:
@ECHO OFF cd %~dp0 set config=conf\environment.yml,conf\wfagent-hub.yml call wfagent.cmd run Hub "%config%"To:
@ECHO OFF cd %~dp0 set config=conf\environment1.yml,conf\wfagent-hub02.yml call wfagent.cmd run Hub "%config%"Edit
wfagent-node*.batfiles. As per examples below, node 1 is running under Hub 1, and node 7 under Hub 2.wfagent-node0.bat@ECHO OFF cd %~dp0 set config=conf\environment.yml,conf\wfagent-node-common.yml,conf\wfagent-node0.yml call wfagent.cmd run Node0 "%config%“wfagent-node7.bat@ECHO OFF cd %~dp0 set config=conf\environment1.yml,conf\wfagent-node-common.yml,conf\wfagent-node7.yml call wfagent.cmd run Node7 "%config%“Navigate to
C:/RPA/rpa-grid.Copy
hub.jsontohub1.json.Change the port in
hub.jsonandhub1.json.hub.json"host": null, "port": 10443, "newSessionWaitTimeout": 300000,hub1.json"host": null, "port": 10444, "newSessionWaitTimeout": 300000,Copy any of
logback-node*.xmlfiles tologback-nodeN.xml.
Edit
logback-nodeN.xmlfiles accordingly. The example below is forlogback-node7.xml.logback-node7.xml<property name="LOG_DIR" value="../logs"/> <property name="LOG_FILE_NAME" value="rpa-node7"/>Copy any of
nodeX.jsonfiles tonodeN.json.Edit the
nodeN.jsonfiles accordingly. The example below is fornode1.jsonwhich is connected to Hub1, andnode7.json, which is connected to Hub2.Node1.json"servlets": ["org.openqa.grid.selenium.workfusion.grid.web.HealthCheckNodeServlet"], "maxSession":2, "port":5001, "host": "127.0.0.1", "hubPort":10443, "hubHost":"127.0.0.1", "nodePolling":2000, "cleanUpCycle":2000, "timeout":600000Node7.json"servlets": ["org.openqa.grid.selenium.workfusion.grid.web.HealthCheckNodeServlet"], "maxSession":2, "port":5007, "host": "127.0.0.1", "hubPort":10444, "hubHost":"127.0.0.1", "nodePolling":2000, "cleanUpCycle":2000, "timeout":600000Copy
logback-hub.xmltologback-hub1.xml.Edit
logback-hub1.xml.logback-hub1.xml<property name="LOG_DIR" value="../logs"/> <property name="LOG_FILE_NAME" value="rpa-hub1"/>Navigate to
C:/RPA/wfagent/rdp.Create a copy of any
nodeX.rdpfiles and name them accordingly.
Edit newly created files. The example below is for
node7.rdp.node7.rdpbitmapcachepersistenable:i:1 full address:s:127.0.0.8Create scheduled tasks for launching Hub and Nodes under each user on logon. To do that, open Command Prompt and create tasks.
SchTasks /Create /SC onlogon /TN "Hub1" /TR "C:\RPA\wfagent\bin\wfagent-hub1.bat" /RU Hub /IT /F SchTasks /Create /SC onlogon /TN "wfagent-node5" /TR "C:\RPA\wfagent\bin\wfagent-node5.bat" /RU BotUser6 /IT /F SchTasks /Create /SC onlogon /TN "wfagent-node6" /TR "C:\RPA\wfagent\bin\wfagent-node6.bat" /RU BotUser7 /IT /F SchTasks /Create /SC onlogon /TN "wfagent-node7" /TR "C:\RPA\wfagent\bin\wfagent-node7.bat" /RU BotUser8 /IT /F SchTasks /Create /SC onlogon /TN "wfagent-node8" /TR "C:\RPA\wfagent\bin\wfagent-node8.bat" /RU BotUser9 /IT /F SchTasks /Create /SC onlogon /TN "wfagent-node9" /TR "C:\RPA\wfagent\bin\wfagent-node9.bat" /RU BotUser10 /IT /FIf RPA configured via SSL, change
$Drive:/RPA/nginx/conf/nginx.confand restart NGINX.Change the
serverblock:server { listen 443 default ssl; listen 444 default ssl; server_name rpa.example.com;Change the
locationblock in the end of the file.location / { proxy_pass http://127.0.0.1:10$server_port;Log in to APP via SSH.
Switch to run a time user.
Navigate to
$Installation_Folder/rpa-manager/grid-router/quota.Edit the
user.xmlfile. Add entries for each browser.vi user.xml <qa:browsers xmlns:qa="urn:config.gridrouter.qatools.ru"> <browser name="chrome" defaultVersion="1.0"> <region name="hub1"> <host name=" rpa.example.com " port="443" count="5"/> <host name=" rpa.example.com " port="444" count="5"/> </region>Restart rpa-manager:
wfmanager restart rpa-manager