Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  


Pages: [1]   Go Down

Author Topic: One MySQL DB, for multiple services  (Read 2035 times)

0 Members and 1 Guest are viewing this topic.


  • Anope User
  • Offline Offline
  • Posts: 34
One MySQL DB, for multiple services
« on: September 02, 2008, 11:22:25 PM »

Now, my topic is slightly misleading... And this isn't so much a 'support it's broken' request as a 'support is it possible' query.

[Note, I did a search for this, and couldn't find anything recent enough to be relevant. My apologies if this exists already]

What I am wanting to do is configure two anope's (latest versions) to act as a backup to each other on the same network.

They would both be named, so they couldn't be online at the same time.

In the past, I've had a script regularly copying the .db files from the master to the slave, the slave has started in readonly mode and staff have squitted the slave when the master becomes available again.

What I want to know, is if I can run both services as read-write, using an SQL db as the common point.

I figure that if one drops, the other will pick up, reading from the SQL and thus starting where the others left.

Essentially I have three questions:
1) If services starts and fails to connect, does it read the SQL and write it to it's .db files?
2) If services can't reach the SQL server, will it print and error and continue to connect, or will it fail and stop again?
3) If there is a mismatch between SQL and the .db files, is one taken preferentially? IE, if an oper deletes a channel or nick, it will remove from SQL. If it exists in a .db on the other server, will it be readded to SQL upon the failover?

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
Re: One MySQL DB, for multiple services
« Reply #1 on: September 03, 2008, 12:03:02 AM »

 - if anope fails to connect nothing will be written to DB, but it will read from whatever is it configured to read, by default the .db or when UseRDB is enabled from MySQL
 - anope doesn't continuously write to SQL so the  Mysql DB wouldn't be entirely up2date when the master goes offline, only its .db's are.
 - if anope fails to connect to the mysql DB and is configured with a mysql db, whether it s readonly or not, it will not start
 - unless specified otherwise the mysql DB is readonly.. anope dumps to it every once in a while. anope can be configured to start from it in which case the .db's are overwritten
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)


  • Guest
Re: One MySQL DB, for multiple services
« Reply #2 on: September 03, 2008, 01:27:18 AM »

sql db's are written to when the FFF db's are written, default is every 5 minutes. The second set of services should be using UseRDB as Viper mentioned. Anope can use a remote sql db as well. So ideally if the second set is started at the same minute the primary dies, even if the primary fails save to db before hand, the second set would be using no more than 10 minute old data.

Even if the second set is started hours later, the data will still be no more than 10 minutes out of sysnc.
« Last Edit: September 03, 2008, 01:29:01 AM by katsklaw »
Pages: [1]   Go Up