Once EyeDB server has been launched, information can be obtained on server status (server uptime, listening ports, clients...) using eyedbctl.
Independently from server status, the EyeDB server can be launched with logging option, that allows to trace precisely all server actions (client connections, transactions...).
The EyeDB server status can be obtained using the following command:
eyedbctl
status
[options...]
This command will print on its standard output informations about the EyeDB server currently running: server PID and user, version, listening ports and list of connected clients.
Example 2.5. eyedbctl status
eyedbctl status
EyeDB Server running since Thu Mar 5 16:08:45 2009
Version V2.8.8
Date Feb 14 2009 00:16:45
Architecture i686-pc-linux-gnu
Program Pid 19433
Running Under francois
Listening on localhost:6240
localhost:/home/francois/projects/eyedb/install/var/lib/eyedb/pipes/eyedbd
Datafile Directory /home/francois/projects/eyedb/install/var/lib/eyedb/db
No Clients connected.
Same as for stopping server, if the server was started with the --listen option to set the listening port, the same option must be passed to eyedbctl when getting server status.
Example 2.6. eyedbctl status with --listen option
eyedbctl status --listen=localhost:10000,/var/tmp/eyedb-socket
EyeDB Server running since Thu Mar 5 16:09:07 2009
Version V2.8.8
Date Feb 14 2009 00:16:45
Architecture i686-pc-linux-gnu
Program Pid 19560
Running Under francois
Listening on localhost:10000
localhost:/var/tmp/eyedb-socket
Datafile Directory /home/francois/projects/eyedb/install/var/lib/eyedb/db
No Clients connected.
If clients are connected, the server status will show the list of connected clients, giving for each client a list of open databases.
Example 2.7. eyedbctl status with connected clients
eyedbctl status
EyeDB Server running since Thu Mar 5 16:46:55 2009
Version V2.8.8
Date Feb 14 2009 00:16:45
Architecture i686-pc-linux-gnu
Program Pid 20332
Running Under francois
Listening on localhost:6240
localhost:/home/francois/projects/eyedb/install/var/lib/eyedb/pipes/eyedbd
Datafile Directory /home/francois/projects/eyedb/install/var/lib/eyedb/db
1 Client connected
Client #0
Connected on Thu Mar 5 16:53:01 2009
Host:Port localhost:/home/francois/projects/eyedb/install/var/lib/eyedb/pipes/eyedb
User Name francois
Program Name eyedboql
Client Pid 20377
EyeDB Server Pid 20378
Open Databases 'EYEDBDBM' [mode=sread/local]
'EYEDBDBM' [mode=sread/local]
'EYEDBDBM' [mode=sread/local]
'test' [mode=sread] [userauth=francois]
The EyeDB server can log its activities with a fine grain control over what is logged (client connections, transactions, index...). This logging can be done into a file or into a special file such as /dev/stderr
.
The following options of eyedbctl are used to control server logging:
--logdev=logfile
specifies output log file (can be either a plain file, or a special file like /dev/stderr
--logmask=mask
specifies log mask (see log mask values for log mask values)
--logdate=[ on | off ]
controls display of date in output log
--logtimer=[ on | off ]
controls display of time in output log
--logpid=[ on | off ]
controls display of process pid in output log
--logprog=[ on | off ]
controls display of program name in output log
Log mask is either an hexadecimal number or a combination of symbols prefixed by + (to enable the corresponding log) or - (to disable the corresponding log). The list of allowed symbols can be obtained by running eyedbctl start --logmask=help. For instance, specifying --logmask=+server+connection will log all server and connection events.
Example 2.8, “Launching EyeDB server with logging enabled” shows an example of launching EyeDB server with logging enabled, running an EyeDB command (here: eyedbadmin) and examining the log file (here /var/tmp/eyedbd.log
) with the tail.
Example 2.8. Launching EyeDB server with logging enabled
eyedbctl start --logdev=/var/tmp/eyedbd.log --logdate=on --logpid=on --logprog=on --logmask=+server+connection
Starting EyeDB Server Version V2.8.8 Compiled Feb 14 2009 00:16:45 Architecture i686-pc-linux-gnu Program Pid 7484eyedbadmin database list
...tail -f /var/tmp/eyedbd.log
Thu Mar 5 19:19:04 2009 [thread 7484#-1216465216] eyedbd : rpc_multiConnManage 0 Thu Mar 5 19:19:04 2009 [thread 7484#-1216465216] eyedbd : rpc_multiConnManage 1 Thu Mar 5 19:19:04 2009 [thread 7484#-1216465216] eyedbd : rpc_multiConnManage 2 Thu Mar 5 19:19:04 2009 [thread 7484#-1216465216] eyedbd : new connection : fd = 0, fd = 1, fd = 2 Thu Mar 5 19:19:04 2009 [thread 7522#-1216465216] eyedbd : rpc_makeThread which=0, fd=0 CONN Thu Mar 5 19:19:04 2009 [thread 7522#-1225118832] eyedbd : new thread -1225118832 [fd = 0, which=0], stack = 0xb6fa239c CONN Thu Mar 5 19:19:04 2009 [thread 7522#-1225118832] eyedbd : connected host='localhost:/home/francois/projects/eyedb/install/var/lib/eyedb/pipes/eyedbd', username='francois', progname='eyedbadmin', pid=7521 Thu Mar 5 19:19:04 2009 [thread 7522#-1216465216] eyedbd : rpc_makeThread which=1, fd=1 CONN Thu Mar 5 19:19:04 2009 [thread 7522#-1564058736] eyedbd : new thread -1564058736 [fd = 1, which=1], stack = 0xa2c6539c Thu Mar 5 19:19:04 2009 [thread 7522#-1216465216] eyedbd : rpc_makeThread which=2, fd=2 CONN Thu Mar 5 19:19:04 2009 [thread 7522#-1580647536] eyedbd : new thread -1580647536 [fd = 2, which=2], stack = 0xa1c9339c Thu Mar 5 19:19:04 2009 [thread 7522#-1564058736] eyedbd : -1564058736 thread EXIT Thu Mar 5 19:19:04 2009 [thread 7522#-1564058736] eyedbd : rpc_garbClientInfo(which = 0, fd = 1, ci = 0x9ce8100) Thu Mar 5 19:19:04 2009 [thread 7522#-1564058736] eyedbd : refcnt = 3, fd_cnt = 3 Thu Mar 5 19:19:04 2009 [thread 7522#-1564058736] eyedbd : close connection fd=1 ...