Difference between revisions of "OS4X Core main configuration file"

From OS4X
Jump to navigation Jump to search
Line 24: Line 24:
 
  KEY= VALUE
 
  KEY= VALUE
  
== Example ==
+
The following variables are available.
 +
==== DB_HOST ====
 +
'''Mandatory.'''
 +
 
 +
Resolvable hostname or IP address of the databse server. In case of MySQL, special rules apply: if the value "localhost" is used, the MySQL client library tries to connect via a compiled in socket connection, if no socket is configured. In this case, if you have any problems connecting to MySQL, examine your syslog output and check the socket availability. As a workaround, "127.0.0.1" can be configured for a forced TCP/IP connection to localhost.
 +
 
 +
==== DB_USER ====
 +
'''Mandatory.'''
 +
 
 +
Username for the database connection. In case of MySQL, if no username is configured (left empty), the user running the program is being used.
 +
 
 +
==== DB_PASS ====
 +
'''Mandatory.'''
 +
 
 +
Password for the database connection. Empty connection passwords are not officially supported, but may work.
 +
 
 +
==== DB_NAME ====
 +
'''Mandatory.'''
 +
 
 +
*MySQL: Name of the database.
 +
*DB2: Name of the database instance.
 +
 
 +
==== DB_SOCKET ====
 +
==== DB_PORT ====
 +
==== TABLEPREFIX ====
 +
==== MYSQLCLIENT ====
 +
==== SERVERID ====
 +
==== DBTYPE ====
 +
==== DB_PERSISTANT_CONNECTION ====
 +
 
 +
 
 +
== Examples ==
 
The following examples show various settings: locale and remote databases, socket connects, the possible database types and persistant connections.
 
The following examples show various settings: locale and remote databases, socket connects, the possible database types and persistant connections.
  
Line 36: Line 67:
 
  TABLEPREFIX=os4x_
 
  TABLEPREFIX=os4x_
 
  MYSQLCLIENT=/usr/local/mysql/bin/mysql
 
  MYSQLCLIENT=/usr/local/mysql/bin/mysql
 +
 +
=== remote DB2 ===
 +
DB_HOST=db2
 +
DB_USER=db2inst1
 +
DB_PASS=db2
 +
DB_NAME=swan_hl
 +
DB_PORT=50000
 +
TABLEPREFIX=os4x_
 +
DBTYPE=DB2
 +
 +
=== remote DB2 with persistant connections and configured server ID ===
 +
DB_HOST=db2
 +
DB_USER=db2inst1
 +
DB_PASS=db2
 +
DB_NAME=swan_hl
 +
DB_PORT=50000
 +
TABLEPREFIX=os4x_
 +
MYSQLCLIENT=/usr/local/mysql/bin/mysql
 +
DBTYPE=DB2
 +
DB_PERSISTANT_CONNECTION=1
 +
SERVERID=5

Revision as of 20:29, 10 May 2010

Main configuration file

OS4X's main configuration file defines be basic information about database connectivity and some other, really basic information which cannot reside in the database.

Position

All OS4X binaries search the configuration file at

/etc/os4x.conf

but they are all aware of searching this file at a given position. For this position information, nearly all binaries have the parameter "-C" (beware of the uppercase!). Example:

$ /opt/os4x/bin/os4xrd -C /opt/os4x/os4x.conf

This example searches the config file at the given position "/opt/os4x/os4x.conf".

In addition, all running OS4X binaries set the environment variable "OS4X_CFGFILE", which is also interpreted by all binaries. An alternative way to the above example could then be:

$ export OS4X_CFGFILE=/opt/os4x/os4x.conf
$ /opt/os4x/bin/os4xrd

Content

The configuration file contains textual information in the format "key=value", where no space must be existant between key, the character "=" and the corresponding value. Lines beginning with a hash sign ("#") are comments and will not be taken into account. Example:

# comment 
KEY=VALUE

Variables

Illegal defintions are:

KEY = VALUE
KEY =VALUE
KEY= VALUE

The following variables are available.

DB_HOST

Mandatory.

Resolvable hostname or IP address of the databse server. In case of MySQL, special rules apply: if the value "localhost" is used, the MySQL client library tries to connect via a compiled in socket connection, if no socket is configured. In this case, if you have any problems connecting to MySQL, examine your syslog output and check the socket availability. As a workaround, "127.0.0.1" can be configured for a forced TCP/IP connection to localhost.

DB_USER

Mandatory.

Username for the database connection. In case of MySQL, if no username is configured (left empty), the user running the program is being used.

DB_PASS

Mandatory.

Password for the database connection. Empty connection passwords are not officially supported, but may work.

DB_NAME

Mandatory.

  • MySQL: Name of the database.
  • DB2: Name of the database instance.

DB_SOCKET

DB_PORT

TABLEPREFIX

MYSQLCLIENT

SERVERID

DBTYPE

DB_PERSISTANT_CONNECTION

Examples

The following examples show various settings: locale and remote databases, socket connects, the possible database types and persistant connections.

local MySQL server via socket

DB_HOST=localhost
DB_USER=os4x
DB_PASS=os4x
DB_NAME=os4x
DB_SOCKET=/var/lib/mysql.sock
DB_PORT=3306
TABLEPREFIX=os4x_
MYSQLCLIENT=/usr/local/mysql/bin/mysql

remote DB2

DB_HOST=db2 DB_USER=db2inst1 DB_PASS=db2 DB_NAME=swan_hl DB_PORT=50000 TABLEPREFIX=os4x_ DBTYPE=DB2

remote DB2 with persistant connections and configured server ID

DB_HOST=db2 DB_USER=db2inst1 DB_PASS=db2 DB_NAME=swan_hl DB_PORT=50000 TABLEPREFIX=os4x_ MYSQLCLIENT=/usr/local/mysql/bin/mysql DBTYPE=DB2 DB_PERSISTANT_CONNECTION=1 SERVERID=5