Table of Contents

Server Installation

Installation from the RPM (Red Hat/Fedora)

Installation from the RPM (Ubuntu/Debian Systems)

Installation from the tar.gz

Client Installation

Python client

Java Client

Jena Client

Session Port Setup

Server Installation

There are two methods of installation for the AllegroGraph server, one for administrators and one for non-administrators. Administrators can install the RPM and non-administrators can extract the files from the .tar.gz and install in a location of their choosing.

Installation from the RPM (Red Hat/Fedora)

To execute the commands in this section, you must run the commands as "root".

Obtain agraph-4.0-1.x86_64.rpm from Franz customer support.

Install the RPM:

# rpm -i agraph-4.0-1.x86_64.rpm 

then run the configuration script:

# /usr/bin/configure-agraph 

You can take the defaults for all questions and tune the configuration later.

To uninstall AllegroGraph:

# rpm --erase agraph 

Note that the uninstallation does not remove other directories created by AllegroGraph, which may contain configuration files, catalogs or log files. Those live in /var/lib/agraph, /var/log/agraph, /var/run/agraph and /etc/agraph. Be careful when removing these directories.

Installation from the RPM (Ubuntu/Debian Systems)

Installation on a Ubuntu/Debian system requires a different set of commands. These instructions are for the Ubuntu 8.10 base installation, using the "alien" package to install RPMs:

user@ubuntu:~$ apt-get install alien 

Installation:

user@ubuntu:~$ sudo alien -i agraph-4.0-1.x86_64.rpm 

To start manually:

user@ubuntu:~$ sudo /usr/etc/init.d/agraph start 

To stop manually:

user@ubuntu:~$ sudo /usr/etc/init.d/agraph stop 

To start at boot time:

user@ubuntu:~$ sudo ln -s /usr/etc/init.d/agraph /etc/rc2.d/S99agraph 

Installation from the tar.gz

The commands in this section do not require "root" access.

Obtain agraph-4.0-linuxamd64.64.tar.gz from Franz customer support. Place it in a directory of your choosing. Then extract the installation files:

$ tar zxf agraph-4.0-linuxamd64.64.tar.gz 

This creates the "agraph-4.0" subdirectory, where the installation script resides. The installation script is "install-agraph". You must provide the path to a writable directory where you want to install AllegroGraph.

$ agraph-4.0/install-agraph /home/joe/tmp/ag40  
 
Installation complete.  
Now running configure-agraph... 

The installation script automatically launches a configuration script. This script asks several questions. The default answers are usually adequate, and can be reconfigured later if necessary.

Welcome to the AllegroGraph configuration program.  This script will  
help you establish a baseline AllegroGraph configuration.  
 
You will be prompted for a few settings.  In most cases, you can hit return  
to accept the default value.  
 
Location of configuration file to create:  
[/home/joe/tmp/ag40/lib/agraph.cfg]:  
Directory to store data and settings:  
[/home/joe/tmp/ag40/data]:  
Directory to store log files:  
[/home/joe/tmp/ag40/log]:  
Location of file to write server process id:  
[/home/joe/tmp/ag40/data/agraph.pid]: 

The configuration script will ask for a user name and password to be your AllegroGraph superuser. This account is internal to AllegroGraph, and is not your server logon account. The example below shows the user "test" with password "xyzzy". This is the account expected by the tutorial examples, so it is convenient to create that account now. User account management is easy to perform through the WebView interface, so this initial user/password combination is easily changed later.

Now you must set up an initial user account for AllegroGraph.  This  
account will have "super user" privileges within AllegroGraph.  
 
SuperUser account name:  
[super]: test  
SuperUser account password:  
xyzzy 

The script writes out the agraph.cfg file in the "lib" subdirectory.

/home/joe/tmp/ag40/lib/agraph.cfg has been created.   
 
If desired, you may modify the configuration.  

The script concludes with a display of start and stop commands customized to your installation.

You can start AllegroGraph by running:  
/home/joe/tmp/ag40/bin/agraph-control --config /home/joe/tmp/ag40/lib/agraph.cfg start  
 
You can stop AllegroGraph by running:  
/home/joe/tmp/ag40/bin/agraph-control --config /home/joe/tmp/ag40/lib/agraph.cfg stop 

Now, the server can be started exactly as shown above:

$ /home/joe/tmp/ag40/bin/agraph-control --config /home/joe/tmp/ag40/lib/agraph.cfg start  
AllegroGraph 4.0 server  
Daemonizing... 

The "AllegroGraph 4.0 server" message confirms that AllegroGraph is running. Look for the "Agraph Service Daemon" and "Agraph Hub" in your list of running processes.

$ ps x  
  PID TTY      STAT   TIME COMMAND  
23369 pts/0    Ss     0:00 -csh  
23994 ?        S      0:00 Agraph Service Daemon                                
23995 ?        S      0:00 Agraph Hub                                           
23996 pts/0    R+     0:00 ps x 

To verify that AllegroGraph is running correctly, open a browser and direct it to the WebView URL:

http://localhost:10035 

You may substitute your server's IP address for "localhost." The port number is the AllegroGraph port, which defaults to 10035. You will need to provide the "test" username and "xyzzy" password to log in. This opens the AllegroGraph WebView interface, which lets you manage users and interactively examine the data in your repositories.

Client Installation

Python client

The tutorial examples can be run on a Linux system, running AllegroGraph and Python on the same computer ("localhost"). The tutorial assumes that AllegroGraph and Python 2.5 have been installed and configured using the following procedure.

If Python is not pre-installed on your Linux system, you'll have to download and install it. AllegroGraph also requires the Python cjson and pycurl libraries. To determine if these packages are installed on your system, try:

rpm -q python python-cjson python-pycurl 

For most Linux systems, the installation command is:

sudo yum install python python-cjson python-pycurl 

For Ubuntu systems, try:

sudo apt-get install python python-cjson python-pycurl 

These installations will require administrator privileges.

If your distribution does not offer these libraries then installation from source is recommended.

The AllegroGraph Python client files are in

agraph-4.0-client-python.tar.gz 

which you may obtain from Franz customer support. Place it in a directory of your choosing. Then extract the Python Client files:

$ tar zxf agraph-4.0-client-python.tar.gz 

This creates the agraph-4.0-client-python subdirectory.

Edit your agraph.cfg configuration file (agraph.cfg). You'll find it in the AllegroGraph installation "lib" subdirectory. Make a note of the port number, which defaults to 10035.

Port 10035 

In this file you'll see an entry describing the RootCatalog. It will be similar to this:

<RootCatalog>  
  Main /yourInstallDirectory/data/rootcatalog  
</RootCatalog> 

The Python tutorial examples require this RootCatalog plus an additional catalog subdirectory that you must add to the config file. The tutorial example code expects to find a catalog called "python-catalog" so please don't change the name. You can specify any writable directory as the location of the repository data.

<Catalog python-catalog>  
  Main /yourInstallDirectory/data/python-catalog  
</Catalog> 

You'll have to stop and restart the AllegroGraph Server to force it to load the edited configuration file. See the section "Installation from the tar.gz" for the start/stop commands.

You'll need to set a PYTHONPATH environment variable. From a 'bash' prompt:

export PYTHONPATH=/yourPathway/agraph-4.0-client-python/src2 

Navigate to the "agraph-4.0-client-python/tutorial" directory. If you are using non-default values for the port number, user name or password, you will have to edit tutorial_examples_40.py to enter these values. Be sure that the AG_PORT variable is set to your AllegroGraph port number, and that the AG_USER and AG_PASSWORD variables reflect the name and password of your AllegroGraph super user account. Save the file.

To test the installation, run the tutorial examples:

$ python tutorial_examples_40.py all 

The command window will fill with output from the example functions. The examples run for about 2.5 minutes and touch most of AllegroGraph's features. To run a specific example, enter its number after the file name, that is:

$ python tutorial_examples_40.py 13 

The explanation of these tutorial examples is in agraph-4.0-client-python/tutorial/python-tutorial-40.html.

Java Client

The tutorial examples can be run on a Linux system, running AllegroGraph and running the Java Client as an Eclipse project on the same computer ("localhost").

The AllegroGraph Java client files are in

agraph-4.0-client-java.tar.gz 

which you may obtain from Franz customer support. Place it in a directory of your choosing.

Open your Eclipse development environment, and import the Java Client as an Eclipse project. You may import the project directly from the tar.gz file. There is no need to unpack the file. The new project will be called "AllegroGraph 4.0 Java Client."

Edit your agraph.cfg configuration file (agraph.cfg). You'll find it in the AllegroGraph installation "lib" subdirectory. Make a note of the Port number, which defaults to 10035.

Port 10035 

In this file you'll see an entry describing the rootcatalog. It will be similar to this:

<RootCatalog>  
  Main /yourInstallDirectory/data/rootcatalog  
</RootCatalog> 

The Java tutorial examples require this RootCatalog plus an additional catalog subdirectory that you must add to the config file. The tutorial example code expects to find a catalog called "java-catalog" so please don't change the name. You can specify any writable directory as the location of the repository data.

<Catalog java-catalog>  
  Main /yourInstallDirectory/data/java-catalog  
</Catalog> 

You'll have to stop and restart the AllegroGraph Server to force it to load the edited configuration file. See the section "Installation from the tar.gz" for the start/stop commands.

Navigate to the AllegroGraph 4.0 Java Client/src/tutorial/ directory. If you are using non-default values for the port number, user name, or password, you will have to edit TutorialExamples.java. Be sure that the SERVER_URL variable is set to the URL and port number of your AllegroGraph server, and that the USERNAME and PASSWORD variables reflect the name and password of your AllegroGraph super user account (created by the installation script). Save the file.

To test the Java Client, run the TutorialExamples.java file (within Eclipse). Run the file using a single argument of "all". The console will fill with output from over twenty tutorial examples. The examples run for about 2.5 minutes and touch most AllegroGraph features. To run a specific example, enter its number instead of "all".

The explanation of these examples is in AllegroGraph 4.0 Java Client/doc/java-tutorial-40.html.

Jena Client

The Jena client is a variant of the Java client. Simply follow the Java client setup (above). When you have imported the project into Eclipse, run the JenaTutorialExamples.java file instead of the TutorialExamples.java file.

The explanation of these examples is in AllegroGraph 4.0 Java Client/doc/jena-tutorial-40.html.

Session Port Setup

If you connect to AllegroGraph on a remote server using a virtual private network (VPN), it is possible that you will see a connection error when you reach the sixth tutorial example. The solution is to add a SessionPorts entry in agraph.cfg, specifying a range of ports for AllegroGraph to use, as in:

Port 10035  
SessionPorts 9091-9100 

Any range of unused ports will do. Ten ports are sufficient for initial installation and testing. Don't forget to restart AllegroGraph after editing the config file.

Then you must configure your VPN to map the same range of ports from your local computer to the remote server. Local port 9091 must map to remote port 9091, etc. This should clear up the connection issue.

If the problem persists, it is possible that a firewall is obstructing the required ports.

If you are running AllegroGraph and the client on the same "localhost" computer, the allocation of session ports is handled automatically and transparently.