XMLRPC sync not working [Solved]

Started by spider, March 16, 2022, 09:11:36 AM

Previous topic - Next topic
March 16, 2022, 09:11:36 AM Last Edit: March 23, 2022, 06:13:29 AM by spider
Hi all,

How can you tell if XMLRPC sync is working?

When the link system→High Availability→Settings→Perform synchronization is clicked, it shows the status page with information about the backup host.

However, the settings on the backup machine are not being updated. For example, if a DHCP reservation is added to the master, it is not being replicated to the backup server.

Another example is to enable the Dashboard, then I would expect to see the updated dashboard on the backup server, but this is not happening.

Are these settings that should be replicated and if not, what setting are replicated?

On this cluster, the Web GUI runs on a non-standard port, does this affect the "Synchronize Config to IP" setting or is this not related?

Many thanks,
- spider.

Hi,

Is it possible to sync DHCPv4 IP reservations?

The other part of the question, about seeing if the XMLPRC sync has worked, has been resolved. The system and audit logs shows the status of the sync.

The reason why this was not visible when I asked is because the sync had not been executed. This is partly due to the interface being less intuitive than it could be.

shows the first row of the status page's service and the upload button on the right-hand side need to be clicked. This is not as clear as a button used in the Virtual IP status page.


Thanks,
-spider




You need to click small cloud button at this status page

Quote from: mimugmail on March 21, 2022, 09:06:04 PM
You need to click small cloud button at this status page

Thanks, after two days I figured it out, meanwhile it was rather frustrating. The wiki page is excellent but didn't say much about synchronization.

Still haven't figured out if it is possible to synchronize DHCP reservations. If it is not possible, then I don't need to spend time on this part.

We use DHCP reservations for almost all the hosts, even hosts with static IPs.

Many thanks
-spider


Quote from: mimugmail on March 22, 2022, 11:25:40 AM
https://docs.opnsense.org/manual/hacarp.html#automatic-replication

https://docs.opnsense.org/manual/hacarp.html#status

Many thanks for this information, helpful, thanks.

In the config.xml the DHCP reservations are under the <dhcpd> so they do get replicated to the backup server when the DHCPD box in the High Availability setting is checked. I guess that I hadn't clicked the Upload icon on the High Availability status page.

As a slight aside

I use cron from a server to back up the configuration files regularly, something like this:
15 6,12 * * * root scp root@office:/conf/config.xml /data/storage1/backup/opnsense/config-office-$(date "+\%Y\%m\%d-\%H\%M").xml > /dev/null 2>&1

Then another cron task removes the duplicated back ups.
#! /bin/bash
cd $(dirname "$0")
PATS='config-office-*.xml config-opcase1-*.xml config-opcase2-*.xml'
LAST=""
for i in ${PATS}; do
    #echo $i;
    if [ "$LAST" == "" ]; then
        LAST="$i"
    else
        SUMS=($(sha256sum $LAST $i 2> /dev/null))
        #echo SUMS: "${#SUMS[@]}" "${SUMS[0]}" "${SUMS[2]}"
        if [ "${SUMS}" == "" ]; then continue; fi
        if [ "${SUMS[0]}" != "" -a "${SUMS[0]}" == "${SUMS[2]}" ]; then
            echo keep ${SUMS[1]} remove ${SUMS[3]}
            rm -v ${SUMS[3]}
        fi
        LAST=$i
    fi
done


For dhcpd you need to configure its builtin synchronisation mechanism. On the master node in e.g. Services > DHCPv4 > LAN put the IP address of the backup node into the "Failover peer IP" field.

Second, for configuration backup I found the os-git-backup plugin to be a really good way to get a versioned configuration history. If you have multiple administrators, each with their own login, it will even log who made the change.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: pmhausen on March 23, 2022, 07:44:54 AM
For dhcpd you need to configure its builtin synchronisation mechanism. On the master node in e.g. Services > DHCPv4 > LAN put the IP address of the backup node into the "Failover peer IP" field.

Thank you for this information. What I did was to download the example files and edited the interfaces and IP addresses. Then restored these to two pc-engines boxes.

Quote from: pmhausen on March 23, 2022, 07:44:54 AM
Second, for configuration backup I found the os-git-backup plugin to be a really good way to get a versioned configuration history. If you have multiple administrators, each with their own login, it will even log who made the change.

Nice tip, thanks,

Never sure how to use git for what I need, for example I wanted to find the last configuration file before moving from a pc-engines box to a Supermicro box and I knew there was a new interface on the new box. I could use grep and retrieve the previous file. With git I wouldn't know where to start. Personally, I find IPv6 addresses, git commit version numbers and other GUID type numbers difficult to read and consequently try not to use them.

Cheers,
-spider