User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.0.x:manuals:ex_env.5

EX_ENV

EX_ENV

NAME
DESCRIPTION
MANDATORY ENV. VARIABLES
EXAMPLE
NOTES FOR ORACLE DB
BUGS
SEE ALSO
COPYING

NAME

ex_env − Enduro/X Environment configuration

DESCRIPTION

Enduro/X use set of environment variables which is initial environment for application domain. There is set of parameters related to system, prefixes, Posix Queue mount points, various system limits. Next step to the configuration is application domain configuration by it self, in ndrxconfig.xml and debug.conf (or Common−Configuration respectively).

MANDATORY ENV. VARIABLES

NDRX_NODEID=NODE_ID

Cluster Node ID. Should be within 1..32.

NDRX_CLUSTERISED=1|0

Do we work in cluster mode or not? 1 − yes, we are in cluster. 0 − no, we are not in cluster.

NDRX_LDBAL=LOAD_BALANCE_PERCENT

if LOAD_BALANCE_PERCENT is 0 = means process all locally, if value is set to 100 = process all on remote servers (if svc available on remote server). 70% means, process 30% locally 70% remotely.

NDRX_TOUT=TIME_OUT_IN_SECONDS

Global tpcall() timeout, if not called with TPNOTIME flag. If process will not return in this time, then TPETIME error will be returned.

NDRX_ULOG=ULOG_PATH

Writable system path where to write user logs.

NDRX_QPREFIX=APP_PREFIX

Prefix used for POSIX IPC resources (shm and queue).

NDRX_SVCMAX=MAX_SERVICES

This determines the maximum number of services supported by instance. The less is number, then less shared memory is used. However for performance reason, number should be much bigger (3−4 times) than actual estimated service count. Bigger number might speed up linear hashing, i.e. it will be less likely that hash will collide.

NDRX_SRVMAX=MAX_SERVERS

Maximum number of servers that will be supported. This affects the −i flag. Server ID. The max server id will be MAX_SERVERS−1.

NDRX_CONFIG=FULL_PATH_TO_CONFIG_FILE

This shows the full path to usual ndrxconfig.xml.

NDRX_QPATH=QUEUE_MOUNT_POINT

Full path to directory where POSIX Queue is mounted.

NDRX_SHMPATH=SHARED_MEM_MOUNT_POINT

Full path to POSIX Shared memory mount point.

NDRX_CMDWAIT=NDRXD_COMMAND_WAIT_SECS

Number of second to wait for commands, after which ndrxd does other checks.

NDRX_DPID=PATH_TO_NDRXD_PID_FILE

This is full path to ndrxd PID file.

NDRX_RNDK=APP_DOMAIN_RANDOM_KEY

Random key to indentify the processes beloning to this app domain (i.e. used in ps ef).

NDRX_IPCKEY=SYS_V_SEMAPHORE_KEY

System V Semaphores key number. Used for shared memory locking. POSIX semaphores are not used here, because they are not unlocked if process dies during acquired semaphore. For System V shared memory IPCKEY+0..5 different keys may be used for shared memory. For System V semaphores IPCKEY+0..2 range is used.

NDRX_MSGMAX=MAX_MSGS_PER_QUEUE

Posix queue config attrib. Max number of messages that can be put in one queue.

NDRX_DQMAX=NDRXD_ACCESS_Q_MSG_MAX

Enduro/X ATMI daemoni ndrxd access Q size. Bigger is better.

NDRX_MSGSIZEMAX=NDRXD_ACCESS_Q_MSG_MAX

Max message size (in bytes). The value is limited to the operating system limits of the maximums size of the POSIX queues message size. For example on Linux kernel 3.13 it is possible to set message size to 10 Megabytes. Also the message size denotes the internal buffer sizes for XATMI message processing. As mostly for all operations Enduro/X uses stack allocation for the buffers, this means that there are requirements for the application stack sizes. Thus the stack size must be 30 times the size of the message. For example if message size is set to 64KB, then stack size must be at least 1920KB (~2MB). Otherwise application will not start. If message size max is set to less than 64KB, then buffer size is defaulted to 64KB. This parameter also affects the opening/creation of the message queue. As the message size is specified in mq_open() attributes.

NDRX_APPHOME=FULL_PATH_TO_APPDOMAIN_INSTANCE_DIR

This is full path to application (not an Enduro/X directory it self) root directory.

NDRX_HOME=FULL_PATH_TO_ENDUROX_ROOT_DIRECTORY

Full path to Enduro/X installaction directory.

NDRX_DEBUG_CONF=FULL_PATH_TO_DEBUG_CONFIG_FILE

This sets full path to debug configuration file.

NDRX_UBFMAXFLDS=MAX_NUMBER_OF_UBFFIELDS

Max number of UBF fields. Used for hashing. Bigger number is better. The max number is number is 33554432 (25 bit).

NDRX_DMNLOG=FULL_PATH_TO_NDRX_DMNLOG

The full path to ndrxd log file. Used by shell scripts.

NDRX_DMNLEV=LOG_LEVEL_OF_NDRXD

Log level of ndrxd. From 1..5. 5 is max. Used by shell scripts.

NDRX_LOG=FULL_PATH_TO_XADMIN_LOG_FILE

Full path to xadmin log file. Used by shell scripts.

NDRX_LEV=LOG_LEVEL_OF_XADMIN

Log level of xadmin. From 1..5. 5 is max. Used by shell scripts.

NDRX_XA_RES_ID=XA_RESOURCE_ID

XA API two phase commit resource id. Must be set if using distributed transactions. Valid value is in range of 1..255.

NDRX_XA_OPEN_STR=XA_OPEN_STRING

This is open string for two phase commit XA driver. Must be set if using distributed transactions.

NDRX_XA_CLOSE_STR=XA_CLOSE_STRING

This is close string for two phase commit XA driver. This is optional, NDRX_XA_OPEN_STR will be used if not set.

NDRX_XA_DRIVERLIB=ENDUROX_XA_DRIVER_LIB

This is full path to Enduro/X shared library which loads the XA api.

NDRX_XA_RMLIB=RESOURCE_MANAGER_SPECIFIC_DRIVER

This is full path to resource manager’s specific driver (shared library). Must be set if using distributed transactions.

NDRX_XA_LAZY_INIT=LAZY_INIT_FLAG

Set to 1 if XA sub−system should be initialized on first transactions. If not set, then defaulted to 0, meaning initialize XA sub−system on executable startup.

NDRX_XA_FLAGS=XADMIN_XA_FLAGS

Special for XA sub−system. It is semicolon separated tags with values. currently tag RECON is defined. RECON tag defines the number of attempts of xa_close()/xa_open() and doing xa_start() again in case if original xa_start() failed (the ATMI call tpbegin()) − for example firewall have been closed the connection. The format for the tag is: RECON:<comma separated list of error codes e.g. 4,−8,* − any err>:<number of attempts>:<sleep between attempts milli−sec> example: RECON:*:3:100, meaning reconnect on any xa_start error, do the 3x attempts, sleep 100 milliseconds between attempts.

NDRX_NRSEMS=NDRX_NRSEMS

Number of semaphores used for protecting shared memory, when Enduro/X running in poll() mode. The minimum is recommended something about 7. Every service name in shared memory is hashed and semaphore protecting the service is calculated by modulus of NRSEMS. This affects NDRX_IPCKEY semaphore, by giving the more occurrences in array. The first array entry is used by normal Enduro/X operations, and the others 2..1+NRSEMS is used by poll() mode service protection. Default value is 30.

NDRX_MAXSVCSRVS=NDRX_MAXSVCSRVS

Max number of servers can advertise same service. This is used only in poll() and SystemV mode. The number affects the size of shared memory used for services. Bigger number causes more memory to be used for service registry. If the number of servers goes over this number for one service, the service entry will be ignored. Default is 30.

PATH=PATH

This is not Enduro/X specific env variable. But Enduro/X distribution bin directory should be included in system PATH env. variable.

FLDTBLDIR=FULL_OR_RELATIVE_PATH_OF_UBF_FIELD_DIRS

This is colon separated list of directories where .fd files are located. I.e. UBF field definitions.

FIELDTBLS=COMMA_SEPERATED_LIST_OF_FIELD_FILES

This is comma separated list of field files found in FLDTBLDIR.

NDRX_CCONFIG=NDRX_COMMON_CONFIG_FILE

If this is set then, all above configuration is read from specified ini file in NDRX_COMMON_CONFIG_FILE in [@global] section. The Enduro/X config driving unit is able to merge configuration from multiple config files, and you can set higher priority files by in NDRX_CCONFIG1, NDRX_CCONFIG2NDRX_CCONFIG3, NDRX_CCONFIG4, NDRX_CCONFIG5. Basically NDRX_CCONFIG is lowest priority and NDRX_CCONFIG5 is highest priority. The specified configuration file can be directory, in that case Enduro/X will search for files with mask *.ini, *.cfg, *.conf, *.config files. All will be loaded in alphabetical order.

NDRX_CCTAG=NDRX_COMMON_CONFIG_TAG

This is basically subsection used for Enduro/X configuration sections [@global], [@debug], [@queue]. If the variable is set, then Enduro/X will lookup at process startup for sections like [@global/YOUR_TAG], etc. CC tag can contain multiple sections, for example server1/RM2. Enduro/X will lookup the variables in each section [@global/server1] and [@global/RM2] for setting up the system.

NDRX_XADMIN_CONFIG=XADMIN_CONFIG_FILE

This variable is used by xadmin read the specific configuration file with xadmin’s settings. Variable is optional.

HOME=UNIX_USER_HOME_DIR

This variable is used by xadmin to search for per user configuration file when xadmin is started. In home directory search for configuration is done by $HOME/.xadmin.config. This file is used in case if NDRX_XADMIN_CONFIG is missing. Variable is optional.

VIEWDIR=NDRX_VIEW_DIR

This is colon separated list of directories where to search VIEW compiled object files. The access to these directories are done only once operations with views are performed.

VIEWFILES=NDRX_VIEW_FILES

Comma separated list of VIEW object files (typically with extension .V). Object files are produced by view compiler viewc(8).

NDRX_PLUGINS=NDRX_PLUGINS

This is semicolon separated string which denotes the list Enduro/X plugins which needs to be loaded at any XATMI program startup. Following plugins are provided with Enduro/X: libcryptohost.so − cryptography key by hostname.

NDRX_SILENT=SILENT_SETTING

If environment variable is present (and set to Y), the xadmin tool will not print banner header at startup.

NDRX_XADMINTOUT=XADMIN_TOUT

This override of NDRX_TOUT configuration for xadmin queue operations. This timeout is used for certain calls to ndrxd (for example startup, shutdown, service listing, etc). Also it is used for communication with XATMI servers like cpmsrv and tmsrv. This is number of seconds, the value must be greater than 0. If parameter is set, then this will enable timeout control for communication with ndrxd daemon, if parameter is not set, the code will work in legacy mode, meaning that list calls to ndrxd will never get timeout.

NDRX_SVPROCNAME=SERVER_PROC_NAME

Server process name exported by ndrxd at XATMI server process boot time. The name is either server name extracted by "<server>" or extracted by sub tag "<cmdline>".

NDRX_SVCLOPT=SERVER_COMMAND_LINE

Server process command line. Generated and exported at the moment of XATMI server boot. If no command line options are passed to XATMI server, then libatmisrv tries to extract the parameter from this environment variable before failing, due to missing command line arguments.

NDRX_SVPPID=SERVER_PARENT_PID

Parent process PID of server process. This process basically is the one which is booted by ndrxd. In case if server definition contains some wrapper processes (or scripts), then this basically is different than value of the real XATMI server. This variable is used by XATMI server library to report both PIDs to the ndrxd, the parent PID and the real process PID.

NDRX_SVSRVID=SERVER_PROCESS_ID

This is XATMI server id set in <srvid> tag. The variable can be used for example is wrapper scripts to modify some resources used by process. For example if booting something like Tomcat app server, the admin TCP ports can be adjusted by this environment variable in order to avoid conflicts for booting multiple instances.

NDRX_SVQREADERSMAX=MAX_SIMULTANEOUS_READERS

This configuration parameter set the maximum parallel readers for System V to Posix queues mapping tables. The number is used for read−write locks, thus the number sets the simultaneous readers, but during that time the write thread needs to wait for all readers to finish up the mapping when the writer will step in and all readers will wait. If the number is bigger read will be performed better when many processes are used, but that could lead to write starvation, and writes (opening queues) may become slow. System V queues acquires one more semaphore resource from the NDRX_IPCKEY+1. Thus this semaphore is used read/write mode to protect the SystemV−to−Posix and Posix−to−SystemV mapping tables. The default value for this parameter is 50.

NDRX_MSGQUEUESMAX=MAX_IPC_QUEUES

Max number of queues that can be mapped to System V sub−system. This parameter defines size for two shared memory chunks which names are <NDRX_QPREFIX>,shm,p2s and <NDRX_QPREFIX>,shm,s2p. The number defines number of queue entries in the table. The bigger the number, the better hashing is got and lookup is quicker, but more memory is used. The minimum number shall be equal to the number of queues that will be used on the system, but recommended number is something as twice it. Each queue entry requires about 168 bytes. The default value for this parameter is 20000.

NDRX_CLTTAG=CLIENT_PROCESS_TAG

This is client process tag exported to cpmsrv(8) controlled processes. This value can be used also in ndrxconfig.xml(5) when formatting client process command line and log file names.

NDRX_CLTSUBSECT=CLIENT_PROCESS_TAG

This is client process tag’s sub−section exported to cpmsrv(8) controlled processes. This value can be used also in ndrxconfig.xml(5) when formatting client process command line and log file names.

NDRX_LIBEXT=SHARED_LIB_EXTENSION

This is shared library platform specific extension. For example Linux/AIX and Solaris would use "so". For MacOS it would be "dylib". Env variable is generated by provision script and it set in global variables.

NDRX_NORMWAITMAX=NORM_WAIT_ATTEMPTS

This configures number of attempts for xadmin(8) (and tpadmsv(8)) commands to wait in case if command requires normal ndrxd(8) context, but process is in other context, for example starting or stopping. The default is 60. Between each attempt 1 second sleep is done.

EXAMPLE

Sample configuration:

export FIELDTBLS=Exfields,fieldtab1.fd,fieldtab2.fd
export FLDTBLDIR=/enduro/tst1/tuxfbuf
export VIEWDIR=/enduro/tst1/views
export VIEWFILES=customer.V,card.V
export NDRX_DMNLEV=5
export NDRX_DMNLOG=/enduro/tst1/tmp/NDRXD
export NDRX_APPHOME=/enduro/tst1
export NDRX_CLUSTERISED=0
export NDRX_CMDWAIT=1
export NDRX_CONFIG=/enduro/tst1/conf/ndrxconfig.xml
export NDRX_DEBUG_CONF=/enduro/tst1/conf/ndrxdebug.conf
export NDRX_DPID=/enduro/tst1/tmp/ndrxd.pid
export NDRX_DQMAX=3000
export NDRX_HOME=/opt/endurox
export NDRX_IPCKEY=442000
export NDRX_LDBAL=0
export NDRX_LEV=5
export NDRX_LOG=/enduro/tst1/tmp/XADMIN
export NDRX_MSGMAX=100
export NDRX_MSGSIZEMAX=32000
export NDRX_NODEID=1
export NDRX_QPATH=/dev/mqueue
export NDRX_QPREFIX=/tst1
export NDRX_RNDK=jaUZwOlTqglSc
export NDRX_SHMPATH=/dev/shm
export NDRX_SRVMAX=10000
export NDRX_SVCMAX=600
export NDRX_TOUT=60
export NDRX_UBFMAXFLDS=16000
export NDRX_ULOG=/enduro/tst1/logs

# XA 2PC SECTION, ORACLE DB
export ORACLE_SID=ROCKY
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:ORACLE_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export NDRX_XA_RES_ID=1
export NDRX_XA_OPEN_STR="ORACLE_XA+SqlNet=ROCKY+ACC=P/endurotest/endurotest1+SesTM=180+LogDir=/tmp/xa+nolocal=f+Threads=true"
export NDRX_XA_CLOSE_STR=$NDRX_XA_OPEN_STR

# XA Static registration driver
export NDRX_XA_DRIVERLIB=$NDRX_HOME/lib/libndrxxaoras.so

# XA Dynamic registration driver
#export NDRX_XA_DRIVERLIB=$NDRX_HOME/lib/libndrxxaorad.so

export NDRX_XA_RMLIB=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1
export NDRX_XA_LAZY_INIT=1
# XA SECTION, END

Common−config ini file sample configuration, assuming following settings in env:

export NDRX_CCONFIG=/enduro/tst1/conf/app.ini
export NDRX_CCTAG=server1/RM2

The configuration file might look like:

#
# Common variables, inherited for CCTAGs
#
[@global]
FIELDTBLS=Exfields,fieldtab1.fd,fieldtab2.fd
FLDTBLDIR=/enduro/tst1/tuxfbuf
VIEWDIR=/enduro/tst1/views
VIEWFILES=customer.V,card.V
NDRX_DMNLEV=5
NDRX_DMNLOG=/enduro/tst1/tmp/NDRXD
NDRX_APPHOME=/enduro/tst1
NDRX_CLUSTERISED=0
NDRX_CMDWAIT=1
NDRX_DPID=/enduro/tst1/tmp/ndrxd.pid
NDRX_DQMAX=3000
NDRX_HOME=/opt/endurox
NDRX_IPCKEY=442000
NDRX_LDBAL=0
NDRX_LEV=5
NDRX_LOG=/enduro/tst1/tmp/XADMIN
NDRX_MSGMAX=100
NDRX_MSGSIZEMAX=32000
NDRX_NODEID=1
NDRX_QPATH=/dev/mqueue
NDRX_QPREFIX=/tst1
NDRX_RNDK=jaUZwOlTqglSc
NDRX_SHMPATH=/dev/shm
NDRX_SRVMAX=10000
NDRX_SVCMAX=600
NDRX_TOUT=60
NDRX_UBFMAXFLDS=16000
NDRX_ULOG=/enduro/tst1/logs

#
# CCTAG section server1
#
[@global/server1]
NDRX_CONFIG=/enduro/tst1/conf/ndrxconfig.xml

#
# CCTAG section RM2
#
[@global/RM2]
# XA 2PC SECTION, ORACLE DB
ORACLE_SID=ROCKY
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
PATH=$PATH:ORACLE_HOME/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
NDRX_XA_RES_ID=1
NDRX_XA_OPEN_STR="ORACLE_XA+SqlNet=ROCKY+ACC=P/endurotest/endurotest1+SesTM=180+LogDir=/tmp/xa+nolocal=f+Threads=true"
NDRX_XA_CLOSE_STR=$NDRX_XA_OPEN_STR
# XA Static registration driver
NDRX_XA_DRIVERLIB=$NDRX_HOME/lib/libndrxxaoras.so
# XA Dynamic registration driver
#NDRX_XA_DRIVERLIB=$NDRX_HOME/lib/libndrxxaorad.so
NDRX_XA_RMLIB=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1
NDRX_XA_LAZY_INIT=1
# XA SECTION, END

#
# Debug section (no need for NDRX_DEBUG_CONF in CConfig case)
#
[@debug]
*= ndrx=0 ubf=0

[@debug/server1]
*= ndrx=5 ubf=0

NOTES FOR ORACLE DB

Note that tmsrv run with multiple threads. Flag +Threads=true MUST be set in NDRX_XA_OPEN_STR. Otherwise unexpected core dumps can be received from tmsrv.

BUGS

Report bugs to support@mavimax.com

SEE ALSO

xadmin(8), ndrxd(8), ndrxconfig.xml(5), ndrxdebug.conf(5) viewc(8) tpadmsv(8)

COPYING

© Mavimax, Ltd.