Installing Af-Arch


On this document you will find:

Af-Arch v1.0 dependencies

Af-Arch dependencies are the following:

What pieces have to be installed (or what steps are required to be done)

To install Af-Arch you will have to accomplish several steps. Each of these steps can be done in several ways. And all steps are not required:

Installing Af-Arch from sources (posix environmnets)

First, you'll have to download latest stable Af-Arch source code from See Af-Arch download section at SourceForge at and dowload Af-Ach package.

This package includes all libraries and tools (including Vortex).

Once downloaded follows next steps to compile source code:

     bash:~$ tar tzvf af-arch-version.tar.gz
     bash:~$ cd af-arch-version
     bash:~$ ./configure
     bash:~$ make
     bash:~$ make install

Previous steps will compile Af-Arch sources and will enable you to develop Af-Arch clients and applications.

The easy way to get Af-Arch installed (perl and posix shell required)

Maybe the easy way to install latest stable Af-Arch is to use Af-Arch Installer which can be found at

This perl script helps to download Af-Arch from svn repository and assist you on installing Af-Arch.

Af-Arch-Installer will ask your building preferences, install source in you system and helps you to configure central Af-Kernel server.

The only configure process the Af-Arch-Installer doesn't do is to configure your PostGreSQL to accept conections from Af-Arch servers. You can follow the instructions from this section to know more about configuring your PostGreSQL database server.

You can follow this steps to use Af-Arch installer:

  1. First download Af-Arch-Installer using wget tool:

     [acinom@titan tmp] 
     >> wget
                => `af-arch-installer'
     Conectando con[]:80... conectado.
     Peticion HTTP enviada, esperando respuesta... 200 OK
     Longitud: 17,080 [text/plain]
     100%[====================================>] 17,080        67.17K/s             
     19:16:59 (67.07 KB/s) - `af-arch-installer' guardado [17080/17080]

  2. Then give execution permission:
     [acinom@titan tmp] 
     >> chmod +x af-arch-installer

  3. Now, execute af-arch-installer, type all command to install everything, following the instructions:
     [acinom@titan tmp] 
     >> ./af-arch-installer 
     [msg]: checking enviroment conditions
     checking for svn..ok
     checking for wget..ok
     checking for pkg-config..ok
     checking for aclocal..ok
     checking for autoheader..ok
     checking for automake..ok
     checking for autoconf..ok
     checking for libtoolize..ok
     checking for psql..ok
     checking for make..ok
     checking for flex..ok
     checking for bison..ok
     Af-arch installer v0.2.0: a simple perl script to install ar-arch
     Copyright (C) 2004 Advanced Software Production Line, S.L.
     To install Af-arch consist of serveral steps that must be taken.
     You can let this program to follow all steps until the end. But,
     if something goes wrong you can relaunch all steps or relaunch 
     each step manually in order to get more control over the
     During the process there will apper some questions to guide the
     installation. This questions have defaults answers inside
     [brackets] that you may choose by simply pressing Enter.
     There are also questions like: (Y/n). Here capital letter is the
     default options also selected by pressing Enter.
     If you have any problem, questions or suggestions mail us now at:
     Press Enter to show the help any time you want.
     Press Enter to continue the process.
       all    - Install af-arch taking all steps (recommended).
                Select this option if you want to install Af-arch, 
                install sql schema, configure af-kernel parameters and
                create an initial Af-arch root user.
       source - only install af-arch source code. No sql install,
                no af-kernel configure and no root user creation takes
                place. This is useful if you have Af-arch already
                installed and working and you only want to upgrade the
                source code with out modifiying config and sql.
                This can also be used if you already have a server 
                installation and you need the af-arch client side libraries.
       config - only launch the configure process, the sql install and
                the initial root user creation
       uninst - uninstall af-kernel sql.
       quit   - exit from the installer (same as Control-C)
       log    - enable/disable console log. By default console log is 
                disable. If you want to know what's really happening 
                use this.
     --> all

Setting your PostGreSQL installation

Af-Arch server nodes needs a PostGreSQL installation to store its data. The PostGreSQL installation doesn't need to be installed on the same machine as Af-Arch server nodes.

Assuming you already have installed PostGreSQL on your system (check for more information), you only need to ensure Af-Arch servers are allowed to perform operations against the SQL database.

This is done by configuring the file found at: /etc/postgresql/pg_hba.conf. You will have to allow md5 connections from Af-Arch server nodes. Here is a sample:

 # TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
 local   all         postgres                                        ident sameuser
 local   all         all                                             md5
 local   all         all                                             ident sameuser

 # supposing you have Af-Arch server nodes running at the same
 # computer as the postgresql server you will have to set something
 # similar to.

 host    all         all   md5

 # supposing you have Af-Arch server nodes outside the computer
 # actually running postgresql but both inside the net,
 # you will have to set something similar to.

 host    all         all     md5
 host    all         all   ident sameuser
 host    all         all    reject

Once configured your PostGreSQL installation you have to restart it to take effect changes done.

PostGreSQL admin users

You will need a PostGreSQL administrator to install new SQL schemas for Af-Arch servers.

To create an PostGreSQL admin user use:

 postgres@barrakuda:~$ createuser admin -P
 Enter password for user "admin": 
 Enter it again: 
 Shall the new user be allowed to create databases? (y/n) y
 Shall the new user be allowed to create more new users? (y/n) y

To do this operation it is usual to only allow it from postgres user. To logon as postgres user you can try:

 acinom@barrakuda:~$ su - postgres

Setting up Af-Arch central server: Af-Kernel

Once you have installed Af-Arch sources, you will find a file called /etc/af-arch/af-kernel.cfg.example.

You have to rename it to /etc/af-arch/af-kernel.cfg and setup with your preferences. Here is the content:

# --  af_gen_do_not_touch_this_file --
# Do not remove previous line because af-gen may overwrite this
# file without them.
# Af-kernel central server config file 
# Lines starting with # are comments. 

# Tcp server configuration. The following lines controls the
# hostname to bind and the tcp port to use.
listening port = 55000
listening hostname = any

# Database configuration. The following information is used
# to configure a gda tcp based connection to the postgres
# server. The port is optional, unless you have an especific
# postgres configuration leave it as is.
database server = localhost
database port = 
database name = af_kernel
database user = af_kernel
database password = changeme

# Logging to file configuration
log file = /tmp/af-kernel.log
log active = yes

# Session configuration section. The following section allows you
# to tweak the af-arch native session which will affect the behaviour
# of your client. If you set session to no, the session mechanism will
# be disabled and the rest of parameters will be ingnored.
sessions = no
session expiration = 7200
afkey expiration = 3600

# Host location. The following allows you to activate the host
# location checking done by the af-kernel. This host location checking
# allows you have an allways updated af-kernel registry with the location
# for each server. If host location fails for a given server it is removed
# from the kernel registry.
host location check = no

# Controls how signals are handler by af-arch servers.
# This allows to implement several politics allowing to debug, exit slowly
# or to print backtrace.
# Allowed values are:
#  stop      - stops the running server until it is killed by the user
#  backtrace - gets actual backtrace and prints it to the console
#              and the exit.
#  none      - do nothing, just exit.
#  NOTE: "stop" value can be used for long running bugs allowing you to
#  run gdb using attach command to debug the function which have received
#  the signal, usually a SIGSEGV.
on signal received = stop

# Controls how is handled the server registration.
# Every af-arch server needs to be registered against the central server: af-kernel
# This operation is done using the --update-services command line argument provided
# on every af-arch server. Obviously, this can be somekind tedious for some people
# who doesn't mind about controling when services are changing. 
# This parameter doesn't applies to af-kernel central server because its especial
# behaviour, the af-kernel will just install itself.
automatic register = yes

# The file must end with a new line

Default configuration will do. Keep in mind that database user [string] value have to be the same than the one installed the the install.sql script found at af-arch/af-kernel/data/.

You can also check configuration settings for Af-Arch servers.

Installing Af-Kernel SQL schema

Once done previous steps, described at this section, to install Af-Kernel SQL you have to execute script inside the af-arch/af-kernel/data directory as follows:

   bash: ~$ cd af-arch/af-kernel/data
   bash: ~$$ ./ 
   -- Database installer for af_kernel -- 
   Where is the server running the database? [localhost] barbol
   Postgres user ? [acinom] 
   Running postgres port ? [5432] 
   Creating database for af_kernel ...
   Installing sql schema for af_kernel...

The Af-Arch root user

Now you have installed all stuff, you need to create an initial Af-Arch user. In fact, this initial user will be the root user. This user will have permissions to modify groups, permissions, server registration and to create new users.

To create this user do:

  bash: ~$ af-kernel --add-superuser aspl 

  The following procedure will create an af-arch super user:

    This user have some especial capabilities such as creating other users,
    and groups, given them permissions or manipulate servers registration.
    Passwords can not be empty or a simply enter.
    (Remember you can cancel de process by typing Control-D).
    Enter password for the new superuser: 
    Retype the password, please: 
  User aspl created successfully. Exiting..