Re: [Brahms-dev-l] More on rundb question

From: flemming videbaek <videbaek_at_rcf.rhic.bnl.gov>
Date: Tue, 18 Jul 2006 06:55:53 -0400
Hi,

I know this has been done before, with just proper bratmain scripts, no reason to change code or
tables in database. (please don't do this ). I am sorry I cannot do more a this point, but I am on travel for the
day. There are possible some .C bratmain script in some of my directories on rcf that does this.

Flemming



----------------------------------------------------------------
Flemming Videbaek
Physics Department
Brookhaven National Laboratory

e-mail: videbaek_at_bnl.gov
phone: 631-344-4106
cell:      631-681-1596
  ----- Original Message ----- 
  From: Catalin Ristea 
  To: brahms-dev-l_at_lists.bnl.gov 
  Sent: Tuesday, July 18, 2006 6:14 AM
  Subject: Re: [Brahms-dev-l] More on rundb question



  Hi Steve,


  The way to change the host for databases could be like this:

  change the maindb host, like you did,


  mainDb->SetHostName("brahms-db0.rcf.bnl.gov");


  but then is coming the trick: the maindb contains a table called DB, which stores the host for the calibdb, FILECATALOG, geomdb and runsdb, which are actually the hosts considered for the respective databases. I don't think you could change this by any bratmain script command like


  BrRunsDb * runDb = BrRunsDb::Instance();

  runDb->SetDbName("RUNDB");

  runDb->SetHostName("brahms-db0.rcf.bnl.gov");


  So, the way without changing the brat would be to update the DB table on the main host to look something like below, which is not a big thing, since you are doing the whole story because you want to change the database server.


  hilux19//~> mysql -u query -h ristea.priv.nbi.dk

  mysql> use BrahmsMain;

  mysql> select * from DB;

  +--------------+------------------------+-------------+

  | name | host | file |

  +--------------+------------------------+-------------+

  | calibrations | ristea.priv.nbi.dk | BrahmsCalib |

  | runs | ristea.priv.nbi.dk | RUNDB |

  | geometries | ristea.priv.nbi.dk | BrahmsGeom |

  | filecatalog | brahms-db0.rcf.bnl.gov | FILECATALOG |

  +--------------+------------------------+-------------+

  4 rows in set (0.00 sec)


  And finaly, you have to add the corresponding lines into the .bratdbrc, so that you don't have to supply each time the passwords...


  I've only explained here the way I handle these sort of things, which could not be the right way, but it's an alternative. I hope it could help you.


  Kind regards,

  Catalin.



  On Tuesday 18 July 2006 00:48, Stephen Sanders wrote:

  > So... I've installed swish-e in my home directory.

  > I've searched the archives and located Flemming's relevant message:

  > http://www.sdcc.bnl.gov/brahms/private/list_hyper/brahms-dev-l/

  > 4036.html

  >

  > What is suggested there doesn't work:

  >

  > My

  > code...............................................................

  >..... .................

  > BrMainDb * mainDb = BrMainDb::Instance();

  > mainDb->SetUserName("query");

  > mainDb->SetHostName("brahms-db0.rcf.bnl.gov");

  > mainDb->SetDbName("BrahmsMain");

  > if (!mainDb->Connect()) {

  > Error("CentMacro", "No connection to %s",

  > mainDb->GetDbName()); return;

  > }

  > cout<<"connected to mainDb"<<endl;

  > if (!mainDb->ConnectToCalib()) {

  > Error("CentMacro", "No connection to calib DB");

  > return;

  > }

  > if (!mainDb->ConnectToGeom("query")) {

  > Error("CentMacro", "No connection to geom DB");

  > return;

  > }

  > BrRunsDb * runDb = BrRunsDb::Instance();

  > runDb->SetDbName("RUNDB");

  > runDb->SetHostName("brahms-db0.rcf.bnl.gov");

  > runDb->SetUserName("query");

  >

  > if (!mainDb->ConnectToRun("query")) {

  > Error("CentMacro", "No connection to run DB");

  > return;

  > }

  > cout<<"Connected to runDB"<<endl;

  >

  >

  > The

  > results............................................................

  >..... brat [0] .L MultCheck.C

  > brat [1] MultCheck(12224)

  > Warning: Automatic variable FlSi is allocated MultCheck.C:117:

  > Warning: Automatic variable Si is allocated MultCheck.C:118:

  > Warning: Automatic variable Tile is allocated MultCheck.C:119:

  > connected to mainDb

  > Error in <TMySQLServer::TMySQLServer>: connection to database RUNDB

  > on brahms-rundb0.brahms.bnl.gov failed (error: Can't connect to

  > MySQL server on 'brahms-rundb0.brahms.bnl.gov' (110))

  > Error in <BrRdbmDb::Connect>: User query couldn't connect to

  > database RUNDB @ brahms-rundb0.brahms.bnl.gov

  > Error in <BrRdbmMainDb::ConnectToDb>: couldn't connect to database

  > RUNDB Error in <CentMacro>: No connection to run DB

  >

  > _______________________________________________

  > Brahms-dev-l mailing list

  > Brahms-dev-l_at_lists.bnl.gov

  > http://lists.bnl.gov/mailman/listinfo/brahms-dev-l


  -- 

  Catalin Ristea---------------------------------

  High Energy and Heavy Ions Group

  Niels Bohr Institute

  Blegdamsvej 17, 2100 Copenhagen, Denmark

  Tel (+45) 35 32 54 04 / Fax (+45) 35 32 50 16


  E-mail: catalin.ristea_at_nbi.dk

  http : www.nbi.dk/~ristea

  -----------------------------------------------



------------------------------------------------------------------------------


  _______________________________________________
  Brahms-dev-l mailing list
  Brahms-dev-l_at_lists.bnl.gov
  http://lists.bnl.gov/mailman/listinfo/brahms-dev-l



_______________________________________________
Brahms-dev-l mailing list
Brahms-dev-l_at_lists.bnl.gov
http://lists.bnl.gov/mailman/listinfo/brahms-dev-l
Received on Tue Jul 18 2006 - 06:55:07 EDT

This archive was generated by hypermail 2.2.0 : Tue Jul 18 2006 - 06:55:17 EDT