| Store | Cart

Re: can't log into proxy

From: Hardy Merrill <merr...@missioncriticallinux.com>
Tue, 14 Aug 2001 08:37:21 -0400
Are you sure
  1. The proxy daemon is up and running?
  2. you can connect from the "new" script machine to the database
     server machine?  Try telneting from the "new" script machine
     to the dbi proxy port on the database server - if dbiproxy is
     running, your telnet on the script machine should get this
     response:

         Trying 1.2.3.4...
         Connected to your.database.server.com.
         Escape character is '^]'.

     if the dbiproxy is not up, or the networking isn't working
     properly, then you may get this response from telnet:

         Trying 1.2.3.4...
         telnet: Unable to connect to remote host: Connection refused


Try writing a simple dbi connection script and put that on the
"new" script machine and try getting that to work first.  Here's
one I use to test a dbiproxy connection to an Oracle db:

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

#!/usr/bin/perl -w

BEGIN {
  $ENV{ORACLE_HOME} = "/path/to/oracle/product/8.1.7";
}

use strict;
use DBI;

my $DSN = "DBI:Proxy:hostname=my.host.com;port=1234;dsn=DBI:Oracle:MY_SID";

my $dbh = DBI->connect("$DSN",
                       "scott", ### user
                       "tiger", ### password
                       { RaiseError => 1, PrintError => 0 }
);

if (defined($dbh)) {
   print "Connected fine!\n\n";
}
else {
   print "Could *NOT* connect!\n\n";
   exit -1;
}

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

if you can get that to work, then just add a little more code
to query one table in a database to make sure you can do that.

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

Jan-Hendrik Petersen [jan-...@epost.de] wrote:
> hi there> > I am using the dbi proxy. there are two scripts that work on the same mashine with the proxy. now I copy the scripts to another server and try to connect. all I got was the following message> > Cannot log in to DBI::ProxyServer: Cannot connect: Bad file descriptor at /usr/lib/perl5/site_perl/Net/Daemon/Log.pm line 125. > > the net::daemon is installed on both servers. I minimized the configfile for the proxy but it doesn't work.> > the script:> > my $dbh = DBI->connect("dbi:Proxy:$proxy;dsn=$dsnrad", "$userrad", "$passrad") || print "$DBI::errstr";> my $sth = $dbh->prepare("6 ? ?") || print "$DBI::errstr";> $sth->execute($username, $cpass) || print "$DBI::errstr";> $hash = $sth->fetchrow_hashref();> %hash = %{$hash};> $sth->finish;> $dbh->disconnect;> > the configfile> > use DBI;> require DBD::Oracle;> {> facility => 'daemon',> pidfile => '/var/dbiproxy/dbiproxy.pid',> logfile => '/var/log/dbiproxy.log',> mode => 'fork',    # | threads | single> clients => [>                     SQL's>                 ]> }> > > the $proxy is correct.> > can someone give me a hand??> > thx jan-hendrik

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

Recent Messages in this Thread
Jan-Hendrik Petersen Aug 14, 2001 09:09 am
Hardy Merrill Aug 14, 2001 12:37 pm
Messages in this thread