MySQL neni pripraveno vcas pri startu pc pro obsluhu jinych programu.

Daniel Dvořák daniel-dvorak at atlas.cz
Tue Sep 25 23:59:37 CEST 2007


Ahoj pratele,

dovolte mi se vas zeptat zdali nekdo resil problem nepripravenych mysql
na obsluhu pro pristup do databaze jinymi programy pri startu pc.

Mam dva stroje na jednom je PowerDNS s mysql backendem a na druhem
stroji verlihub, ktery sve nastaveni a registrovane uzivatele udrzuje v
mysql.

Domnivam se ze problem je shodny a je celkem jedno jestli ted budu
podrobneji popisovat to co se deje na stroji jedna ci dve, tedy powerdns
ci verlihub, oba
tyto programy shodne potrebuji mysql databazi. Zamerim se jen na ten
stroj s powerdns, podku se to da vyresit tak na stroji dve, to pujde
vyresit shodne jako na tom prvnim.

Mysql se startuje jako prvni (rcorder je mi svedkem). Nasleduje powerdns
recursor, protoze samotny powerdns je jen autoritatvni dns server. Ten
startuje naprosto v pohode, neb mysql nepotrebuje. Pak nasleduje samotny
powerdns a zde je vypis dmesg:

Starting pdns.
Sep 25 15:07:59
This is module gmysqlbackend.so reporting

Sep 25 15:07:59 server pdns[903]: UDP server bound to 81.0.x.y:53
Sep 25 15:07:59 server pdns[903]: UDP server bound to 127.0.0.1:53
Sep 25 15:07:59 server pdns[903]: TCP server bound to 81.0.x.y:53
Sep 25 15:07:59 server pdns[903]: TCP server bound to 127.0.0.1:53
Sep 25 15:07:59 server pdns[903]: DNS Proxy launched, local port 26807,
remote 127.0.0.1:1053
Sep 25 15:07:59 server pdns[903]: Creating backend connection for TCP
Starting denyhosts.
Sep 25 15:07:59 server pdns[903]: Master/slave communicator launching
Sep 25 15:07:59 server pdns[903]: gmysql Connection failed: Unable to
connect to database: Can't connect to MySQL server on '127.0.0.1' (49)
Sep 25 15:07:59 server pdns[903]: Caught an exception instantiating a
backend, cleaning up
Sep 25 15:07:59 server pdns[903]: Communicator thread died because of
error: Unable to launch gmysql connection: Unable to connect to
database: Can't connect to MySQL server on '127.0.0.1' (49)

Co uz v dmesg neni a je jen v messages je toto:

Sep 25 15:07:59 server pdns[903]: gmysql Connection succesful
Sep 25 15:07:59 server pdns[903]: About to create 3 backend threads for UDP
Sep 25 15:07:59 server pdns[903]: gmysql Connection succesful
Sep 25 15:08:00 server last message repeated 2 times

Pro vysvetleni kodu chyby 49 pdns:
server# perror 49
OS error code  49:  Can't assign requested address

Po prihlaseni k serveru po cerstvem rebootu a zjisteni stavu pdns:
server# /usr/local/etc/rc.d/pdns status
pdns is not running.

V kontrastu s:
srwxr-xr-x  1 root        wheel          0 25 zář 15:07 pdns.controlsocket
-rw-r--r--  1 root        wheel          4 25 zář 15:07 pdns.pid
srwxr-xr-x  1 root        wheel          0 25 zář 15:07
pdns_recursor.controlsocket

Vsimete si casu tech souboru.

cat /var/run/pdns.pid
903

Rucni spusteni probehne v naprostem poradku a pdns zacne obsluhovat.

Starting pdns.
Sep 25 23:53:26 This is module gmysqlbackend.so reporting

pdns is running as pid 3201.

Takze konecne moje otazka na vas. Proc pri startu pdns se nemuze pdns
dostat do mysql s chybou 49 a chybo (Unable to connect to database),
zatim co po dokoncenem startu pc, prakticky ihned po tom, co nastartuje
sshd, tak se mi podari nastartovat pdns rucne ? Pomohlo by mi zkusit
pozdrzet start vseho ostatniho nez mysql nejak opravdu najedou a
popripade to mam udelat nejcisteji jak ? Pomoci sleep ve skriptu
mysql-server v /rc.d/ ?

Predem dekuji za napady co s tim.

S pozdravem

Dan




More information about the Users-l mailing list