View previous topic :: View next topic |
Author |
Message |
onthefritz
Joined: 18 Jul 2009 Posts: 14
|
Posted: Sat Aug 29, 2009 18:35 Post subject: DB problems (and startup script) |
|
|
For some reason NWNX loses connection to the DB. The only error I get is in nwnx_odbc.txt:
Code: |
NWNX2 ODBC2 version 0.3.2 for Linux.
(c) 2005-2006 dumbo (dumbo@nm.ru)
(c) 2006-2008 virusman (virusman@virusman.ru)
o SCO located at 82d9c44.
o RCO located at 82d9b60.
o Connect successful.
! SQL Error: MySQL server has gone away
! SQL Error: MySQL server has gone away
....
|
Also, I am trying to setup a startup script for NW. I have 2 instances that run at the same time. Our wold spans between the two instances. So they both need to be running all the time.
I know Linux, but I'm not very good with scripting.
The startup script isn't as important as the DB errors. It doesn't stay up very long before it errors out.
OTF _________________ Empires Of The Sands PW (Now in Beta)
Web: www.empiresofthesands.com |
|
Back to top |
|
|
onthefritz
Joined: 18 Jul 2009 Posts: 14
|
Posted: Tue Sep 08, 2009 19:42 Post subject: |
|
|
Anyone have an idea on this? It's killing my server. It drops the DB within a few hours.. I can't have that on a prod server.
Please help!!
OTF _________________ Empires Of The Sands PW (Now in Beta)
Web: www.empiresofthesands.com |
|
Back to top |
|
|
Paul R
Joined: 17 Apr 2009 Posts: 42
|
Posted: Tue Sep 08, 2009 21:22 Post subject: |
|
|
Going from memory (and there should be something found in the search) you need to give the DB connection a kick every now and again. Something like:
Code: | // db_ping - ping the database every 60 seconds
#include "aps_include"
void main()
{
SQLExecDirect("SELECT 1");
DelayCommand(60.0f, ExecuteScript("db_ping", GetModule()));
}
|
and add
Code: | DelayCommand(60.0f, ExecuteScript("db_ping", GetModule()));
|
to your mod load event script. |
|
Back to top |
|
|
onthefritz
Joined: 18 Jul 2009 Posts: 14
|
Posted: Tue Sep 08, 2009 23:41 Post subject: |
|
|
That script should be added to the nwnstartup.sh (the mod load script) or added to the module it's self as an "on module load" script?
Sorry if I sound like a noob, it's my first time setting up a large module with SQL.
Thanks,
OTF _________________ Empires Of The Sands PW (Now in Beta)
Web: www.empiresofthesands.com |
|
Back to top |
|
|
Zaith
Joined: 05 Jun 2007 Posts: 21
|
Posted: Wed Sep 09, 2009 0:20 Post subject: |
|
|
OnModuleLoad event in the module. |
|
Back to top |
|
|
onthefritz
Joined: 18 Jul 2009 Posts: 14
|
Posted: Wed Sep 09, 2009 0:23 Post subject: |
|
|
Zaith wrote: | OnModuleLoad event in the module. |
I will give it a shot and let you know how it goes. (it could be b/c we are in beta and don't have many people on the server very often.)
OTF _________________ Empires Of The Sands PW (Now in Beta)
Web: www.empiresofthesands.com |
|
Back to top |
|
|
Paul R
Joined: 17 Apr 2009 Posts: 42
|
Posted: Wed Sep 09, 2009 0:29 Post subject: |
|
|
Frequent DB access would stop it 'going away' but you can use that for the quiet times. |
|
Back to top |
|
|
|