NetXMS in a cluster mode

Started by Genady, March 20, 2011, 04:07:42 PM

Previous topic - Next topic

Genady

 Hi,
I try configuring NetXMS in a cluster ( or HA) mode.
Could you, please clarify whether it possible or not? if not,  do you have any plans adding cluster/HA support for NetXMS installation?

Thanks,
Genady

Victor Kirhenshtein

Hi!

It is possible to create active-passive cluster using any clustering software, like Heartbeat or Microsoft Cluster. As NetXMS server stores all configuration in database, and configuration file contains almost only information necessary to connect to database, you just need to ensure database availability (by using replication or clustering software) and configure cluster software to start netxmsd. You also will need to add addresses of both cluster nodes to agents configuration files, because even if you are using virtual IP, outgoing connections will be made from primary addresses on the nodes.
I have NetXMS HA solution based on Heartbeat and DRBD (with database residing on shared DRBD device), and it works without problems for more than a year now. I can post configuration files for this configuration if it will help.

Best regards,
Victor

Genady

Hi Victor,
Thanks a lot for reply.
It would be great if you can post the cluster config files.

Thanks,
Genady

Victor Kirhenshtein

Hi!

I have two Debian Linux nodes called netxms-1 (10.0.0.11) and netxms-2 (10.0.0.12) with heartbeat and DRBD. Database engine is PostgreSQL, with database on shared disk. There are also virtual IP 10.0.0.10 used for client connection. Configuration files looks like following:

/etc/ha.d/ha.cf

keepalive 1
deadtime 5
warntime 3
initdead 20
bcast eth0
bcast eth1
auto_failback no
node netxms-1
node netxms-2
crm no


/etc/ha.d/haresources

netxms-1 IPaddr::10.0.0.10/24 drbddisk::netxmsdb Filesystem::/dev/drbd0::/postgresql::reiserfs postgresql-8.3 netxmsd


/etc/drbd.conf

global {
        usage-count no;
}

common {
        syncer {
                rate 10M;
        }
}

resource netxmsdb {
        protocol B;
        handlers {
                pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
                pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
                local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
                # outdate-peer "/usr/lib/heartbeat/drbd-peer-outdater -t 5";
        }

        startup {
                wfc-timeout 0;
                degr-wfc-timeout 120;
        }

        disk {
                on-io-error   detach;
        }

        net {
                cram-hmac-alg "sha1";
                shared-secret "*********";
                after-sb-0pri disconnect;
                after-sb-1pri disconnect;
                after-sb-2pri disconnect;
                rr-conflict disconnect;
        }

        syncer {
                al-extents 257;
        }

        on netxms-1 {
                device /dev/drbd0;
                disk /dev/sdb;
                address 10.10.10.1:7788;
                meta-disk  internal;
        }

        on netxms-2 {
                device /dev/drbd0;
                disk /dev/sdb;
                address 10.10.10.2:7788;
                meta-disk internal;
        }
}


/etc/netxmsd.conf

DBDriver = /usr/lib/libnxddr_pgsql.so
DBServer = 127.0.0.1
DBName = netxms_db
DBLogin = netxms
DBPassword = ******
LogFailedSQLQueries = yes
LogFile = /var/log/netxmsd


File /etc/postgresql/8.3/main/postgresql.conf is quite big, so I don't see any reason to put it here entirely. The only non-default setting there is

data_directory = '/postgresql/main'


PostgreSQL and netxmsd removed from auto-start, as they should be started by heartbeat.

Each node has NetXMS agent running instantly. Agent's configuration file looks like following:


MasterServers = 127.0.0.1, 10.0.0.11, 10.0.0.12
LogFile = /var/log/nxagentd
FileStore = /tmp
SubAgent = /usr/lib/libnsm_portCheck.so


Note that IP addresses of both nodes listed in MasterServers parameter.

Best regards,
Victor

Genady

Thanks a lot Victor,
I will give it a try

Genady