logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
DB problems (and startup script)

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
onthefritz



Joined: 18 Jul 2009
Posts: 14

PostPosted: Sat Aug 29, 2009 18:35    Post subject: DB problems (and startup script) Reply with quote

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
View user's profile Send private message
onthefritz



Joined: 18 Jul 2009
Posts: 14

PostPosted: Tue Sep 08, 2009 19:42    Post subject: Reply with quote

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!! Crying or Very sad

OTF
_________________
Empires Of The Sands PW (Now in Beta)
Web: www.empiresofthesands.com
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Tue Sep 08, 2009 21:22    Post subject: Reply with quote

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
View user's profile Send private message
onthefritz



Joined: 18 Jul 2009
Posts: 14

PostPosted: Tue Sep 08, 2009 23:41    Post subject: Reply with quote

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
View user's profile Send private message
Zaith



Joined: 05 Jun 2007
Posts: 21

PostPosted: Wed Sep 09, 2009 0:20    Post subject: Reply with quote

OnModuleLoad event in the module.
Back to top
View user's profile Send private message
onthefritz



Joined: 18 Jul 2009
Posts: 14

PostPosted: Wed Sep 09, 2009 0:23    Post subject: Reply with quote

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
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Wed Sep 09, 2009 0:29    Post subject: Reply with quote

Frequent DB access would stop it 'going away' but you can use that for the quiet times.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group