This section lists steps to test your installation. Included are instructions for running the Shore server, compiling and running some example programs, and mounting the Shore file system. There are also instructions for compiling a simple value-added server built with the Shore Storage Manager. Only brief explanations are provided. Pointers to relevant documents are given.
Set the environment variable SHORE to point to the directory containing the directories bin, lib, etc. containing the Shore programs and libraries. If you installed a binary release, this directory will be $SHROOT (the shell variable SHROOT is explained in the Requirements section). If you built the binaries from the source release, it will be $SRCDIR/installed.
setenv SHORE $SHROOT # or setenv SHORE $SRCDIR/installed # if you use sh, ksh, etc, do this instead SHORE=$SHROOT # or SHORE=$SRCDIR/installed export SHORE
Copy the configuration files to your home directory and modify a line in the .shoreconfig file to point to installation location. (In the sed command below, treat PUT-YOUR-INSTALLED-DIR-HERE literally. You can yank this entire command with your mouse.)
sed -e "s,PUT-YOUR-INSTALLED-DIR-HERE,$SHORE," \ $SHORE/lib/options > ~/.shoreconfig cp $SHORE/lib/shore.rc ~ # in case you want to edit them later, chmod u+w ~/.shoreconfig ~/shore.rc
Make a directory in which to run the Shore server. This directory will have subdirectories log and volumes. You must run the server while in this directory since the ~/.shoreconfig and ~/shore.rc files refer to ./log and ./volumes. The directory should be in a file system with at least 100 MB of free space (this is because the log and volume sizes in the distributed configuration files are this large).
# create a directory for running the Shore server mkdir shoreserver cd shoreserver mkdir log volumes
Now you can run the Shore server.
$SHORE/bin/shoreYou can safely ignore the warning
Warning: no database administrator -- running under userid ...
Expect the server to print a few lines like these:
Looking for run command file "~/shore.rc"... format --./volumes/miniroot-- 5000 true mkfs ./volumes/miniroot 5000 10 Done serving devices and making filesystems. root = 0 setroot 10 / is now 0.0.0.0:10.20007 See if / exists in the Shore namespace. / does exist Done putting together the namespace. Done reading ~/shore.rc. Shore Server Release 1.1.1 (0)%
Try typing the following commands to the Shore server.
# list directories, registered objects, pools in root directory ls -al help
To shut down the server try any one of these:
# at the server prompt q[uit] bye exit ctrl-D # or open another window and run this program $SHORE/bin/sshutdown
The document, Running a Shore Server, gives more information on configuring and running the Shore Server.
The first test uses one of the examples shipped in the documentation release. See pscan/README for details. For other examples, see the README in each of the examples directories.
For the following examples, you must have a server running. If you don't, start one as described above in another window, or in the background. (The server needs to be running for the make, since it invokes the SDL compiler, which needs to contact the server to register types.) The commands in the following paragraphs should be typed to a Unix shell in another window, not to the Shore VAS shell.
You must also fetch and unpack a copy of the example programs either by installing the documentation release or the examples release as described above, First copy the entire examples/pscan directory into another directory.
mkdir pscan cp $SHROOT/examples/pscan/* pscan
(The directory $SHROOT/examples is part of the documentation release).
Then build the test programs build, pscan, and destroy and try running them.
cd pscan make build 10 testpool pscan testpool destroy testpool
The output should look something like this:
% build 10 testpool Created 10 parts % pscan testpool 0, Part0 1, Part1 2, Part2 3, Part3 4, Part4 5, Part5 6, Part6 7, Part7 8, Part8 9, Part9 Found 10 parts % destroy testpool Destroyed 10parts
The document Getting Started with Shore gives information about writing Shore applications, using $SHROOT/examples/stree as an example.
The Shore Server creates and manages a name space of objects, the Shore file system, that looks like a Unix file system. The Shore file system can be mounted as an NFS remote file system, allowing you to use standard commands such as ls to navigate it.
To mount the Shore file system you must have super-user (root) privileges on your machine.
su # create a mount point (an empty Unix directory) mkdir /shoremnt $SHORE/bin/mnt localhost /shoremnt $SHORE/bin exit
To check the mount (you don't have to be super-user):
# use your system's mount command to see what's mounted mount # The mount command may not be in your path by default. For Solaris, the # command is /usr/sbin/mountYou should see something like this:
/shoremnt on localhost:/ soft/intr/port=2999/mport=2997/timeo=60/rsize=8192 /wsize=8192/mport=2997/remote on Tue Aug 5 15:40:27 1997(the exact format varies from platform to platform; it will probably all be on one line).
# at an ordinary shell prompt in one window, type cp /etc/motd /shoremnt # at the prompt from the shore server that you started earlier, type ls -l / # at the ordinary shell prompt, type ls -l /shoremnt cat /shoremnt/motd rm /shoremnt/motd ls -l /shoremnt # results should indicate the same directory contents, # although the syntax will vary # at the prompt from the shore server, type log all trace # repeat the previous sequence of commands at the shell prompt cp /etc/motd /shoremnt ls -l /shoremnt cat /shoremnt/motd rm /shoremnt/motd ls -l /shoremnt # You should see a trace of the NFS operations performed by the server # emulating a Unix file system. # To turn off the tracing, exit from the Shore server and restart it, # or type the following at the server prompt. log all errorAfter you're done, unmount the Shore file system (again, as super-user).
su $SHORE/bin/sumount /shoremnt exit ls -l /shoremnt # result should be 'total 0'For Linux, there is no special Shore version of umount.
su umount /shoremnt exitYou may ignore the message
Cannot MOUNTPROG RPC: RPC: Program not registered
The document Running a Shore Server gives more information on NFS-Mounting the Shore file system.
If you plan on writing your own value-added server (VAS) using Shore Storage Manager (SSM) you should perform the following tests on the SSM installation. This test uses the "hello world" example shipped in the documentation release. See examples/vas/hello/README for details about the program. For other VAS examples, see the file examples/vas/README.
The first thing to do is copy the program to a new directory.
mkdir hello cp $SHROOT/examples/vas/hello/* hello cd hello make
Before running the hello program, copy exampleconfig to config and replace DISKRW to the pathname of the installed shore diskrw program. If you have set the shell variable SHORE correctly, you can yank this entire command with your mouse. You will also need to make a directory for holding the log. The log directory used is set by the sm_logdir option in exampleconfig. Running hello will leave log files in ./log.hello and a storage device file called ./device.hello. These can be removed when you are done.
sed -e "s,DISKRW,$SHORE/bin/diskrw," exampleconfig > config mkdir log.hello ./hello rm -r log.hello device.hello
You should see something like this.
processing configuration options ... forking ... waiting ... Starting SSM and performing recovery ... Formatting and mounting device: ./device.hello... Creating a new volume on the device ... Creating a file for holding the hello record ... Creating the hello record ... Pinning the hello record for printing ... Hello World! Shutting down SSM ... Finished!
The document Writing Value-Added Servers with the Shore Storage Manager gives information about writing value-added servers using $SHROOT/examples/vas/grid as an example.