Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Junos Space] csync2 synchronization fails with an error 'Connection to Remote Host Failed' in /var/log/csync2.log of the VIP node

0

0

Article ID: KB30681 KB Last Updated: 16 Dec 2015Version: 1.0
Summary:

As part of synchronizing the nondatabase opennms files from VIP to non-VIP, we cron a utility to run every midnight. The following cron does this job:

0 0 * * * /opt/opennms/contrib/failover/scripts/sync.sh >> /opt/opennms/logs/failover.log 2>&1

This script uses the csync2 utility internally to synchronize the file between the servers. 

Symptoms:

At times, a user might notice certain files missing in the non-VIP node even though the cron job has run. The user can also see similar errors in /var/log/csync2.log on the VIP node.

ERROR: Connection to remote host failed.
ERROR: Connection to remote host failed.
While syncing file /var/opennms/rrd/snmp/10/bme0_32768-000bcafe0000/mib2-X-interfaces-pkts.jrb:
ERROR from peer space-0319062015000027: Connection closed.
ERROR from peer space-0319062015000027: Connection closed.
ERROR: Connection to remote host failed.
ERROR: Connection to remote host failed.
ERROR: Connection to remote host failed.
ERROR: Connection to remote host failed.
Finished with 8 errors.
Cause:

The csync2 utility uses TCP port 30865. The user needs to open TCP port 30865 on both hosts (VIP and non-VIP) so that the other host can connect.

To determine whether a node is a VIP node, execute ifconfig eth0:0 on the CLI to see if it returns an IP address. If it does, it is a VIP node. 

If a firewall rule to open the TCP port is already in place, check the status of csync2 service on the non-VIP node. This can be verified with the following command:

[root@space-005056adfcb6 ~]# chkconfig --list csync2
csync2            off
Solution:

The csync2 service should be turned on for the synchronization to work. If it is off (as shown in the output above), the connection to the remote host will not go through. The same error messages can be seen in /var/log/csync2.log of the VIP node. 

To enable the service, do the following:

[root@space-005056adfcb6 ~]# chkconfig csync2 on

[root@space-005056adfcb6 ~]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd:   [ OK ]

[root@space-005056adfcb6 ~]# chkconfig --list csync2
csync2            on

Then manually run the script /opt/opennms/contrib/failover/scripts/sync.sh and check if the files are getting synchronized. 

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search