The 64bit port of Recital requires these libraries to allow access to 32bit Xbase and C-ISAM data files which are 32bit.
If you do not have these libraries installed you will either get a "can't find db.exe" or an "error loading shared libraries" when trying to run or license Recital.
Installing the ia32 shared libraries
Redhat EL 5 / Centos 5 / Fedora 10
-
Insert the Red Hat Enterprise Linux 5 Supplementary CD, which contains the ia32el package.
-
After the system has mounted the CD, change to the directory containing the Supplementary packages. For example:
cd /media/cdrom/Supplementary/
-
Install the ia32el package:
rpm -Uvh ia32el-<version>.ia64.rpm
yum install ia32el
Ubuntu / Debian
sudo apt-get install ia32-libs
The Compatibility Dialog settings are written to the compat.db file in <path>/conf - please ensure that the user setting the compatibility settings has write access to this file and directory. Once these settings are written, the dialog will not be displayed unless SET COMPATIBLE is issued.
alias pwd "? default()" alias cp "copy file " alias mv "rename " alias rm "erase " alias ls "run('ls $0')" alias ps "run('ps $0')" alias grep "run('grep $0')" alias cd "set default to $1" alias cls "clear screen"These commands can now be used inside the Recital command window just as you would use them at the linux prompt, including the ability to pipe commands together.
ls -l | grep .prg ps -elf | grep db.exeThe run() function that is used to run the shell command as specified in the alias command will capture output and display it in a text viewer. If you want to run the command and display the contents full screen, then specify true as the third parameter to the run().
run("command", true, true)
Argument | Description |
---|---|
1 | the command line to run |
2 | True if output should be displayed in a text area (default True) |
3 | True if the output should be displayed full screen (default False) |
Macro | Description |
---|---|
$0 | the command line following the command name |
$1..$n | the arguments given to the command |
sernet.de maintain the latest Samba releases in a yum repository, allowing for an easy and painless install or upgrade of Samba on your yum based Linux distribution.
To install the latest available Samba execute the following commands at the shell:
# cd /etc/yum.repos.d # wget http://ftp.sernet.de/pub/samba/experimental/centos/5/sernet-samba.repo # yum install samba
To upgrade an existing Samba install:
# cd /etc/yum.repos.d # wget http://ftp.sernet.de/pub/samba/experimental/centos/5/sernet-samba.repo ## Note: edit sernet-samba.repo and add the line "gpgcheck=false" otherwise ## it will not install as it is not signed
# yum update samba
Note: These steps will install the very latest build available at sernet.de.
If you require a less bleeding edge version of Samba, use the "tested" repo. This can be found at the following URL: http://ftp.sernet.de/pub/samba/tested/rhel/5
Recital provides a wide variety of connectivity solutions to external data sources. This article provides an overview.
DRBD:
DRBD (Distributed Replicated Block Device) forms the storage redundancy portition of a HA cluster setup. Explained in basic terms DRBD provides a means of achieving RAID 1 behavoir over a network, where whole block devices are mirrored accross the network.
To start off you will need 2 indentically sized raw drives or partitions. Many how-to's on the internet assume the use of whole drives, of course this will be better performance, but if you are simply getting familar with the technology you can repartition existing drives to allow for two eqaully sized raw partitions, one on each of the systems you will be using.
There are 3 DRBD replication modes:
• Protocol A: Write I/O is reported as completed as soon as it reached local disk and local TCP send buffer
• Protocol B: Write I/O is reported as completed as soon as it reached local disk and remote TCP buffer cache
• Protocol C: Write I/O is reported as completed as soon as it reached both local and remote disks.
If we were installing the HA cluster on a slow LAN or if the geogrphical seperation of the systems involved was great, then I recommend you opt for asyncronous mirroring (Protocol A) where the notifcation of a completed write operation occurs as soon as the local disk write is performed. This will greatly improve performance.
As we are setting up our HA cluster connected via a fast LAN, we will be using DRBD in fully syncronous mode, protocol C.
Protocol C involves the file system on the active node only being notified that the write operation was finished when the block is written to both disks of the cluster. Protocol C is the most commonly used mode of DRBD.
/etc/drbd.conf
global { usage-count yes; }
common { syncer { rate 10M; } }
resource r0 {
protocol C;
net {
max-buffers 2048;
ko-count 4;
}
on bailey {
device /dev/drbd0;
disk /dev/sda4;
address 192.168.1.125:7789;
meta-disk internal;
}
on giskard {
device /dev/drbd0;
disk /dev/sda3;
address 192.168.1.127:7789;
meta-disk internal;
}
}
drbd.conf explained:
Global section, usage-count. The DRBD project keeps statistics about the usage of DRBD versions. They do this by contacting a HTTP server each time a new DRBD version is installed on a system. This can be disabled by setting usage-count no;.
The common seciton contains configurations inhereted by all resources defined.
Setting the syncronisation rate, this is accoimplished by going to the syncer section and then assigning a value to the rate setting. The syncronisation rate refers to rate in which the data is being mirrored in the background. The best setting for the syncronsation rate is related to the speed of the network with which the DRBD systems are communicating on. 100Mbps ethernet supports around 12MBps, Giggabit ethernet somewhere around 125MBps.
in the configuration above, we have a resource defined as r0, the nodes are configured in the "on" host subsections.
"Device" configures the path of the logical block device that will be created by DRBD
"Disk" configures the block device that will be used to store the data.
"Address" configures the IP address and port number of the host that will hold this DRBD device.
"Meta-disk" configures the location where the metadata about the DRBD device will be stored.
You can set this to internal and DRBD will use the physical block device to store the information, by recording the metadata within the last sections of the disk.
Once you have created your configuration file, you must conduct the following steps on both the nodes.
Create device metadata.
$ drbdadm create-md r0
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.
success
Attach the backing device.
$ drbdadm attach r0
Set the syncronisation parameters.
$ drbdadm syncer r0
Connect it to the peer.
$ drbdadm connect r0
Run the service.
$ service drbd start
Heartbeat:
Heartbeat provides the IP redundancy and the service HA functionailty.
On the failure of the primary node the VIP is assigned to the secondary node and the services configured to be HA are started on the secondary node.
Heartbeat configuration:
/etc/ha/ha.conf
## /etc/ha.d/ha.cf on node1
## This configuration is to be the same on both machines
## This example is made for version 2, comment out crm if using version 1
// replace the node variables with the names of your nodes.
crm no
keepalive 1
deadtime 5
warntime 3
initdead 20
bcast eth0
auto_failback yes
node bailey
node giskard
/etc/ha.d/authkeys
// The configuration below set authentication off, and encryption off for the authentication of nodes and their packets.
//Note make sure the authkeys file has the correct permisisions chmod 600
## /etc/ha.d/authkeys
auth 1
1 crc
/etc/ha.d/haresources
//192.168.1.40 is the VIP (Virtual IP) assigned to the cluster.
//the "smb" in the configuration line represents the service we wish to make HA
// /devdrbd0 represents the resource name you configured in the drbd.conf
## /etc/ha.d/haresources
## This configuration is to be the same on both nodes
bailey 192.168.1.40 drbddisk Filesystem::/dev/drbd0::/drbdData::ext3 smb
echo "Hello world\n"
In this article Chris Mavin, explains and details how to use the Recital Database Server with the Open Source Servlet Container Apache Tomcat.
Overview
PHP has exploded on the Internet, but its not the only way to create web applications and dynamic websites. Using Java Servlets, JavaServer Pages and Apache Tomcat you can develop web applications in a more powerful full featured Object Oriented Language, that is easier to debug, maintain, and improve.
Tomcat Installation
There are a number of popular Java application servers such as IBM Web Sphere and BEA WebLogic but today we will be talking about the use of Apache Tomcat 5, the Open Source implementation of the Java Servlet and JavaServer Pages technologies developed at the Apache Software Foundation. The Tomcat Servlet engine is the official reference implementation for both the Servlet and JSP specifications, which are developed by Sun under the Java Community Process. What this means is that the Tomcat Server implements the Servlet and JSP specifications as well or better than most commercial application servers.
Apache Tomcat is available for free but offers many of the same features that commercially available Web application containers boast.
Tomcat 5 supports the latest Servlet and JSP specifications, Servlet 2.4, and JSP 2.0, along with features such as:
-
Tomcat can run as a standalone webserver or a Servlet/JSP engine for other Web Servers.
-
Multiple connectors - for enabling multiple protocol handlers to access the same Servlet engine.
-
JNDI - The Java Naming and Domain Interface is supported.
-
Realms - Databases of usernames and passwords that identify valid users of a web application.
-
Virtual hosts - a single server can host applications for multiple domain names. You need to edit server.xml to configure virtual hosts.
-
Valve chains.
-
JDBC - Tomcat can be configured to use any JDBC driver.
-
DBCP - Tomcat can use the Apache commons DBCP for connection pooling.
-
Servlet reloading (Tomcat monitors any changes to the classes deployed within that web server.)
-
HTTP functionality - Tomcat functions as a fully featured Web Server.
-
JMX, JSP and Struts-based administration.
Tomcat Installation
In this next two sections we will walk through the install and setup of Tomcat for use with the Recital database server.
To download Tomcat visit the Apache Tomcat web site is at http://jakarta.apache.org/tomcat.
Follow the download links to the binary for the hardware and operating system you require.
For Tomcat to function fully you need a full Java Development Kit (JDK). If you intend to simply run pre compiled JavaServer pages you can do so using just the Java Runtime Environment(JRE).
The JDK 1.5 is the preferred Java install to work with Tomcat 5, although it is possible to run Tomcat 5 with JDK 1.4 but you will have to download and install the compat archive available from the Tomcat website.
For the purpose of this article we will be downloading and using Tomcat 5 for Linux and JDK 5.0,
you can download the JDK at http://java.sun.com/javase/downloads/index.jsp.
Now we have the JDK, if the JAVA_HOME environment variable isn't set we need to set it to refer to the base JDK install directory.
Linux/Unix:
$ JAVA_HOME= /usr/lib/j2se/1.4/ $ EXPORT $JAVA_HOME
Windows NT/2000/XP:
Follow the following steps:
1. Open Control Panel.
2. Click the System icon.
3. Go to the Advanced tab.
4. Click the Environment Variables button.
5. Add the JAVA_HOME variable into the system environment variables.
The directory structure of a Tomcat installation comprises of the following:
/bin - Contains startup, shutdown and other scripts. /common - Common classes that the container and web applications can use. /conf - Contains Tomcat XML configuration files XML files. /logs - Serlvet container and application logs. /server - Classes used only by the Container. /shared - Classes shared by all web application. /webapps - Directory containing the web applications. /work - Temporary directory for files and directories.
The important files that you should know about are the following:
-
server.xml
The Tomcat Server main configuration file is the [tomcat install path]\conf\server.xml file. This file is mostly setup correctly for general use. It is within this file where you specify the port you wish to be running the server on. Later in this article I show you how to change the default port used from 8080 to port 80.
-
web.xml
The web.xml file provides the configuration for your web applications. There are two locations where the web.xml file is used,
web-inf\web.xml provides individual web application configurations and [tomcat install path]conf\web.xml contains the server wide configuration.
Setting up Tomcat for use
We'll start by changing the port that Tomcat will be listening on to 80.
To do this we need to edit [tomcat install path]/conf/server.xml and change the port attribute of the connector element from 8080 to 80.
After you have made the alteration the entry should read as:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="80" maxHttpHeaderSize="8192"
Next we want to turn on Servlet reloading, this will cause the web application to be recompiled each time it is accessed, allowing us to make changes to the files without having to worry about if the page is being recompiled or not.
To enable this you need to edit [tomcat install path]/conf/context.xml and change <Context> element to <Context reloadable="true">.
After you have made the alteration the entry should read as:
<Context reloadable="true"> <WatchedResource>WEB-INF/web.xml</WatchedResource> </Context>
Next we want to enable the invoker Servlet.
The "invoker" Servlet executes anonymous Servlet classes that have not been defined in a web.xml file. Traditionally, this Servlet is mapped to the URL pattern "/servlet/*", but you can map it to other patterns as well. The extra path info portion of such a request must be the fully qualified class name of a Java class that implements Servlet, or the Servlet name of an existing Servlet definition.
To enable the invoker Servlet you need to edit the to [tomcat install path]/conf/web.xml and uncomment the Servlet and Servlet-mapping elements that map the invoker /servlet/*.
After you have made the alteration the entry should read as:
<servlet> <servlet-name>invoker</servlet-name> <servlet-class>org.apache.catalina.servlets.InvokerServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>invoker</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping>
If you are you not interested in setting up your own install of Tomcat there are prebuilt versions Tomcat that has all of the above changes already made, and has the test HTML, JSP, and Servlet files already bundled. Just unzip the file, set your JAVA_HOME
Next we will give Tomcat and your web applications access to the Recital JDBC driver.
For the purposes of this article we are going to install the Recital JDBC driver in the /[tomcat install path]/common/lib/ this gives Tomcat and your web applications access to the Recital JDBC driver. The driver can be installed in a number of places in the Tomcat tree, giving access to the driver to specific application or just to the web application and not the container. For more information refer to the Tomcat documentation.
Copy the recitalJDBC.jar which is located at /[recital install path]/drivers/recitalJDBC.jar to the /[tomcat install path]/common/lib/ directory.
Linux:
$cp /[recital install path]/drivers/recitalJDBC.jar /[tomcat install path]/common/lib/
Once you have completed all the steps detailed above, fire up the server using the script used by your platform's Tomcat installation.
Linux/Unix:
[tomcat install path]/bin/startup.sh
Windows:
[tomcat install path]/bin/startup
If you are having problems configuring your Tomcat Installation or would like more detail visit the online documentation a the Apache Tomcat site.
Example and Links
Now we have setup our Tomcat installation, lets get down to it with a JSP example which uses the Recital JDBC driver to access the demonstration database (southwind) shipped with the Recital Database Server.
The example provided below is a basic JDBC web application, where the user simply selects a supplier from the listbox and requests the products supplied by that supplier.
To run the example download and extract the tar archive or simple save each of the two jsp pages individually into /[tomcat install path]/webapps/ROOT/ on your server.
By enabling the invoker Servlet earlier we have removed the need to set the example up as a web application in the Tomcat configuration files.
You can now access the example web application at http://[Server Name]/supplier.jsp if the page doesn't display, check you have followed all the Tomcat installation steps detailed earlier in this article and then make sure both Tomcat and a licensed Recital UAS are running.
Downloads:
Archive: jspExample.tar
Right click and save as individual files and rename as .jsp files:
supplier.txt details.txt
Further Reading on JSP and JDBC can be found at http://www-128.ibm.com/developerworks/java/library/j-webdata/
Final Thoughts
Recital and Apache tomcat are a powerful combination, using Java Servlet technology you can separate application logic and the presentation extremely well. Tomcat, JSP, Java Servlets and the Recital database server form a robust platform independent, easily maintained and administered solution with which to unlock the power of your Recital, Foxpro, Foxbase, Clipper, RMS and C-SAM data.