System Configuration for HVR Agent on Linux
This section describes the system configuration required for HVR Agent installed on Linux. The steps mentioned on this page are normally performed during installing HVR Agent on Linux (step - Configure the system for HVR Agent).
There are different ways for configuring the HVR Agent to listen on a TCP/IP port:
- Linux systemd
Standard on some Linux distributions. Requires root privilege. - Linux xinetd
Used on other Linux distributions. Requires root privilege. - HVR Agent Listener
Our own daemon hvragentlistener. Does not require root privilege.
Linux systemd
The following steps should be performed as user root to configure systemd:
Create the systemd unit files hvr.socket and hvr@.service in /etc/systemd/system directory.
hvr.socket should contain the following:
[Unit] Description=HVR service socket [Socket] ListenStream=4343 Accept=true TriggerLimitIntervalSec=1s TriggerLimitBurst=10000 MaxConnectionsPerSource=100 MaxConnections=500 KeepAlive=true [Install] WantedBy=sockets.target
- TriggerLimitIntervalSec is supported since systemd version 230.
- TriggerLimitBurst is supported since systemd version 230.
- MaxConnectionsPerSource is supported since systemd version 232.
In a IPv4/IPv6 mixed system, if you want to force systemd to use IPv4, set ListenStream=0.0.0.0:4343.
hvr@.service should contain the following:
[Unit] Description=HVR service [Service] Environment="HVR_HOME=/home/fivetran/hvr_home" Environment="HVR_CONFIG=/home/fivetran/hvr_config" Environment="HVR_TMP=/home/fivetran/hvr_tmp" User=fivetran ExecStart=/home/fivetran/hvr_home/bin/hvragent StandardInput=socket KillMode=process TimeoutStartSec=infinity [Install] WantedBy=multi-user.target
User must be set to the user under which the HVR Agent is installed/running.
If SELinux is enabled, execute the following commands on the HVR Agent server:
sudo /sbin/restorecon -v $HVR_HOME/bin/hvragent sudo chcon -R -t bin_t $HVR_HOME/bin/
To enable and start the service, execute the following commands:
systemctl enable hvr.socket
systemctl start hvr.socket
To verify whether the service is active, execute the following command:
systemctl status hvr.socket
Sample output:
hvr.socket - HVR service socket Loaded: loaded (/etc/systemd/system/hvr.socket; enabled; vendor preset: enabled) Active: active (listening) since Mon 2020-09-07 17:54:44 CEST; 5s ago Listen: [::]:4343 (Stream) Accepted: 0; Connected: 0
Linux xinetd
The following steps should be performed as user root to configure xinetd:
Create an xinetd service file hvr in /etc/xinetd.d/ directory. This service file should contain the following:
service hvr { socket_type = stream wait = no user = fivetran server = /home/fivetran/hvr_home/bin/hvragent env += HVR_HOME=/home/fivetran/hvr_home env += HVR_CONFIG=/home/fivetran/hvr_config env += HVR_TMP=/home/fivetran/hvr_tmp disable = no cps = 10000 30 per_source = 100 instances = 500 }
user must be set to the user under which HVR Agent is installed/running.
If SELinux is enabled, execute the following commands on the HVR Agent server:
sudo /sbin/restorecon -v $HVR_HOME/bin/hvragent sudo chcon -R -t bin_t $HVR_HOME/bin/
Add the following to /etc/services - the name of the xinetd service for HVR Agent (created in the previous step) and the TCP/IP port number for HVR Agent Listener.
hvr 4343/tcp #Port for HVR Agent
Reload or restart the xinetd service to apply the changes. For information about restarting the xinetd service, refer to the operating system documentation.
HVR Agent Listener
The command hvragentlistener should be executed with option -d
to start the HVR Agent Listener service as a daemon process on the required port:
hvragentlistener -d 4343
Testing Connection to an HVR Agent
To test the connection to HVR Agent, execute the command hvragenttest on the machine from which you are connecting to the HVR Agent. You can also check whether hvragentlistener is running by executing the command hvragenttest directly on the HVR Agent machine.
Following are few examples for testing the connection to an HVR Agent.
Example 1: Check connection to an HVR Agent
You can check the connection to an HVR Agent installed/running on a remote machine with username and password authentication enabled. Execute the following command on the hub machine or on the machine from which you are connecting to the HVR Agent:
hvragenttest -L myuser/mypassword mynode 4343
Sample output in Linux with successful authentication and also indicating that the HVR Agent Listener is running:
hvragenttest: Fivetran 6.1.0/21 (linux_glibc2.17-x64-64bit) hvragenttest: Agent version 6.1.0/21. hvragenttest: Authentication with username and password enabled. hvragenttest: Authentication successful. hvragenttest: Finished. (elapsed=0.34s)
Example 2: Check whether hvragentlistener is running
After installing and starting the HVR Agent Listener service, you can verify whether the hvragentlistener is running on the agent machine. Execute the following command on the agent machine:
hvragenttest mynode 4343
Sample output in Windows with successful authentication indicating that the HVR Agent Listener is running:
hvragenttest: Fivetran 6.1.0/21 (windows-x64-64bit) hvragenttest: Agent version 6.1.0/21. hvragenttest: Authentication with username and password enabled. hvragenttest: Authentication successful. hvragenttest: Finished. (elapsed=0.18s)