Was this page helpful?

PostgreSQL + FileSystem

    This option is very similar to the one described in the standard PostgreSQL installation but stores all the data (XML and binary) in the file system.

    Files are stored with the following structure: the first node is defined when installing the system and contains all the FireSignal's acquistion node folders. Each of these contains a different folder for each hardware controlled by the acquistion node. Acquired data is then divided in directories which are hashed using the date of the acquisition. Finally the acquired channels and configuration XMLs are stored inside these directories and are uniquely identified by their universal id plus the start time of the acquisition. Knowning the unique identifiers of the channels and the absolute start time (which are stored on the database), the system automatically reconstructs the full path to the file. Moreover, for longer acquisition cycles the same channel can be saved in different blocks, each identified by a unique start time.

    SQLFS.png

    Setting Up The Database

    In order to install the Firesignal database, you will first need to install a PostgreSQL server on your machine. This, and other PostgreSQL related software can be found at their main site, here.
    As user root, after starting the server, change to user postgres.

    su postgres

    Create the user owner of this database and the database. For example, if the user is genericdbadmin and the database is genericdb

    createuser -A -D genericdbadmin -P
    createdb -O genericdbadmin genericdb 

    Although not required, is advisable to allow connections to the database only from the localhost, since the database controller will be installed in the same machine. This is done by editing the file /var/lib/pgsql/data/pg_hba.conf. Change the last lines in the file to:

    # "local" is for Unix domain socket connections only
    local   all         all                               ident sameuser
    # IPv4 local connections:
    host    all         all         127.0.0.1          255.255.255.255 password
    # IPv6 local connections:
    host    all         all         ::1/128               ident sameuser
    

    Save the file and restart the PostgreSQL server. You should now be able to connect to the database:

    psql -h localhost genericdb -U genericdbadmin -W

    Creating The Database

    Input the following commands in the PostgreSQL prompt:

    CREATE TABLE events (id bigint, eventid text, tevent timestamp, tevent_np int4, CONSTRAINT events_pk PRIMARY KEY (id, eventid));
    CREATE TABLE hardware_description (nodeuniqueid text, hardwareuniqueid text, hardwarexml bytea, CONSTRAINT hw_desc_pk PRIMARY KEY (nodeuniqueid, hardwareuniqueid));
    CREATE TABLE hardware_template (parameteruniqueid text, tstart timestamp, tstart_np int4, tend timestamp, tend_np int4, eventid bigint[], eventnameid text[], CONSTRAINT hw_template_pk PRIMARY KEY (parameteruniqueid,tstart,tstart_np));
    CREATE TABLE institution(name text, address text, phone text, fax text, webpage text, CONSTRAINT inst_pk PRIMARY KEY (name));
    CREATE TABLE user_informations(username text, name text, email text, phone1 text, phone2 text, fax text, country text, prof int2, institute_name text, picture bytea, CONSTRAINT users_info_pk PRIMARY KEY (username));
    CREATE TABLE users(username text, password int4, operator bool, administrator bool, ipaddresses text, hostname text, groupids text, CONSTRAINT users_pk PRIMARY KEY (username));
    CREATE TABLE names(node_unique_id text, hw_unique_id text, parameter_unique_id text, lastchange timestamp, name text, description text, CONSTRAINT names_pk PRIMARY KEY (hw_unique_id, parameter_unique_id, lastchange));
    CREATE TABLE comments (username text, time timestamp, comment text, CONSTRAINT comment_pk PRIMARY KEY (username, time));
    

    First User

    You should also add an “administrator” to the system:

    INSERT INTO users VALUES('admin', 0, 'f', 't', '','','');
    

    This user, it doesn’t have to have the login “admin”, will have no password. Login to FireSignal and update the password immediately. Even better, create another administrator with a different login and remove the “admin” user.

    Configure your system to start the server at boot and the database should be ready to use.

    Was this page helpful?
    Tag page (Edit tags)
    • No tags

    Files 1

    FileSizeDateAttached by 
     SQLFS.png
    FireSignal DB controller: SQL plus Filesystem
    68.77 kB18:11, 10 Feb 2011AdminActions
    You must login to post a comment.
    Powered by MindTouch Core