Configuration Options - Client/Server Operation
Veduta can read log files in a client/server mode. This is useful when your log files are distributed across multiple servers and you want to avoid mounting filesystems across the network. See the configurations in
examples/clientserver for a working example.
Client/Server Configuration
Configuration is largely the same as for normal operation. The Veduta
server receives input from Veduta
clients and renders the reports. Many clients can feed into one server. To configure a server, you will need
veduta.xml to specify some server characteristics and
report.xml to determine how the reports are output.
Note that when Veduta in webserver mode, it is automatically operating as a server for Veduta clients.
Configure the server information in veduta.xml
<system>
<db type="sql">
<file>db/cs_example</file>
</db>
<network>
<server>server hostname</server>
<port>1098</port>
</network>
</system>
The server has to know which port to accept incoming requests on. The clients have to know the port
and the hostname to talk to. Configure
veduta.xml with both the hostname and the port. Both the server and client processes can use the same
veduta.xml configuration to talk to each other. Note that if the server can't use the configured port (i.e. if it's in use by another process) then it will exit immediately.
To run a server, run:
> java -jar veduta-complete.jar -webserver $DIR
Veduta will start as a server, and wait for incoming information from clients. You will see something like:
Veduta 1.1 RELEASE VERSION
06-Apr-2006 12:25:44 INFO: Using new database
06-Apr-2006 12:25:44 INFO: Log db update : Hsql db (jdbc:hsqldb:file:db/cs_example) started
06-Apr-2006 12:25:44 INFO: Running as a server : rmi://localhost:1098/VedutaServer
To run a client, again configure Veduta as normal on the remote host (you will need veduta.xml and consumers.xml this time) and then run:
> java -jar veduta-complete.jar -client $DIR/veduta.xml $DIR/consumers.xml
or
> java -jar veduta-complete.jar -client -d $DIR
Veduta will start as a client and feed log information to the server. You will see something like:
Veduta 1.1 RELEASE VERSION
06-Apr-2006 12:24:44 INFO: Running as a client. Will connect to rmi://dali:1098/VedutaServer
Configuring Consumers and Reports
The server will use the name of the client's consumer to determine how to output the report information. So if you have multiple Veduta clients, you can configure each independently in
consumers.xml" and the server's
report.xml will have a configuration for each client host.
e.g.
consumers.xml on client host host1:
<consumer>
<file>
<name>System Messages on host1</name>
...
consumers.xml on client host host2:
<consumer>
<file>
<name>System Messages on host2</name>
...
And
report.xml on the server host:
<consumers>
<consumer>
<name>System Messages on host1</name>
...
</consumer>
<consumer>
<name>System Messages on host2</name>
...
So each client is configured individually and the server has to know about every client. As the number of clients increases this becomes increasing unmanageable. You can simplify the above enormously and use the same
consumers.xml on each client, and a shorter
report.xml on the server thus:
consumers.xml on each client host:
<consumer>
<file>
<name>System Messages on ${host}</name>
...
And
report.xml on the server host (note that
<pattern/> is used here):
<consumers>
<consumer>
<pattern>System Messages on .*</pattern>
...
so each client will insert the hostname using
${host}. The server will identify information coming from consumers with the hostname inserted appropriately. It will use the wildcard match
System Messages on .* and create reports for each host. e.g.
System Messages on host1
System Messages on host2
System Messages on host3
....
so you can take the
same client configuration, put it on a new host, and the server will pick this up automatically and render the reports appropriately without any further configuration.