Back to home page

Enduro/X

 
 

    


0001 Building Enduro/X On FreeBSD Platform
0002 =====================================
0003 :doctype: book
0004 
0005 About manual
0006 ------------
0007 This manual describes how to build 'Enduro/X' FreeBSD platform. Document is based
0008 on FreeBSD 10.3 on amd64 machine. Default FreeBSD C/C++ compiler is used.
0009 
0010 == Overview
0011 
0012 This manual includes basic installation of Enduro/X which does not include building of
0013 documentation.
0014 
0015 == Operating System Configuration
0016 
0017 For OS configuration settings 
0018 see ex_adminman(guides)(Enduro/X Administration Manual, Setup System chapter).
0019 This step is mandatory be executed, before continuing.
0020 
0021 == Installation process
0022 
0023 For getting Enduro/X to work basically we need following packages:
0024 
0025 . git
0026 
0027 . cmake
0028 
0029 . flex
0030 
0031 . bison
0032 
0033 . libxml2
0034 
0035 . gcc/g++
0036 
0037 . bash
0038 
0039 === Packages to be installed
0040 
0041 The following operations will be done from root user. This will download
0042 and install open source packages to local machine:
0043 
0044 ---------------------------------------------------------------------
0045 # pkg install cmake flex bison libxml2 git bash
0046 ---------------------------------------------------------------------
0047 
0048 === Getting the source code
0049 For test purposes we will parepare new user for which Enduro/X will built.
0050 
0051 ---------------------------------------------------------------------
0052 # adduser 
0053 Username: user1
0054 Full name: Test user
0055 Uid (Leave empty for default): 
0056 Login group [user1]: 
0057 Login group is user1. Invite user1 into other groups? []: 
0058 Login class [default]: 
0059 Shell (sh csh tcsh git-shell nologin) [sh]: 
0060 Home directory [/home/user1]: 
0061 Home directory permissions (Leave empty for default): 
0062 Use password-based authentication? [yes]: 
0063 Use an empty password? (yes/no) [no]: 
0064 Use a random password? (yes/no) [no]: 
0065 Enter password: 
0066 Enter password again: 
0067 Lock out the account after creation? [no]: 
0068 Username   : user1
0069 Password   : *****
0070 Full Name  : Test user
0071 Uid        : 1002
0072 Class      : 
0073 Groups     : user1 
0074 Home       : /home/user1
0075 Home Mode  : 
0076 Shell      : /bin/sh
0077 Locked     : no
0078 OK? (yes/no): yes
0079 adduser: INFO: Successfully added (user1) to the user database.
0080 Add another user? (yes/no): no
0081 Goodbye!
0082 
0083 -- Set bash as shell
0084 # chsh -s /usr/local/bin/bash root
0085 # su - user1
0086 $ bash
0087 $ git clone https://github.com/endurox-dev/endurox
0088 $ cd endurox
0089 ---------------------------------------------------------------------
0090 
0091 === Enduro/X basic Environment configuration for HOME directory
0092 This code bellow creates 'ndrx_home' executable file which loads basic environment, 
0093 so that you can use sample configuration provided by Enduro/X in 'sampleconfig' directory. 
0094 This also assumes that you are going to install to '$HOME/endurox/dist' folder.
0095 The file bellow will override the sample configuration.
0096 
0097 ---------------------------------------------------------------------
0098 $ cat << EOF > $HOME/ndrx_home
0099 #!/bin/bash
0100 
0101 echo "Loading ndrx_home..."
0102 # Where app domain lives
0103 export NDRX_APPHOME=\$HOME/endurox
0104 # Where NDRX runtime lives
0105 export NDRX_HOME=\$HOME/endurox/dist
0106 # Debug config too
0107 export NDRX_DEBUG_CONF=\$HOME/endurox/sampleconfig/debug.conf
0108 # NDRX config too.
0109 export NDRX_CONFIG=\$HOME/endurox/sampleconfig/ndrxconfig.xml
0110 
0111 export PATH=\$PATH:\$HOME/projects/endurox/dist/bin
0112 
0113 export FLDTBLDIR=\$HOME/endurox/ubftest/ubftab
0114 
0115 export PATH=\$PATH:/opt/csw/bin:$HOME/endurox/dist/bin
0116 export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$HOME/endurox/dist/lib
0117 
0118 # Where the queues live:
0119 export NDRX_QPATH=/mnt/mqueue
0120 
0121 ################################################################################
0122 # In case if building with Postgresql DB database testing support
0123 # or building endurox-java with Oracle DB tests (03_xapostgres), then
0124 # configure bellow setting (demo values provided):
0125 # If so - uncomment bellow
0126 ################################################################################
0127 #export EX_PG_HOST=localhost
0128 #export EX_PG_USER=exdbtest
0129 #export EX_PG_PASS=exdbtest1
0130 # currently uses default port
0131 #export EX_PG_PORT=5432
0132 #export EX_PG_DB=xe
0133 
0134 EOF
0135 
0136 $ chmod +x $HOME/ndrx_home
0137 ---------------------------------------------------------------------
0138 
0139 === Configuring PostgreSQL
0140 
0141 If Enduro/X PostgreSQL driver is needed to be build for FreeBSD, the PostgreSQL
0142 needs to be installed for build and test purposes. To install database on this
0143 system, use following commands:
0144 
0145 --------------------------------------------------------------------------------
0146 
0147 $ sudo pkg install postgresql96-server postgresql96-client postgresql96-contrib
0148 
0149 -- Add postgres to startup:
0150 $ sudo sysrc postgresql_enable=yes
0151 
0152 --------------------------------------------------------------------------------
0153 
0154 Once PostgreSQL is installed, update the configuration and create the database.
0155 Create database first and start the server:
0156 
0157 --------------------------------------------------------------------------------
0158 
0159 $ sudo service postgresql initdb
0160 $ sudo service postgresql start
0161 
0162 --------------------------------------------------------------------------------
0163 
0164 Now create the database for Enduro/X tests:
0165 
0166 --------------------------------------------------------------------------------
0167 $ sudo -s
0168 
0169 $ su - postgres
0170 
0171 $ createuser exdbtest
0172 
0173 $ createdb xe
0174 
0175 $ psql -d template1
0176 
0177 > alter user exdbtest with encrypted password 'exdbtest1';
0178 > grant all privileges on database xe to exdbtest;
0179 > \q
0180 
0181 --------------------------------------------------------------------------------
0182 
0183 Configuration files needs to be updated for authentication and distributed
0184 transactions must be enabled too.
0185 
0186 Edit */var/db/postgres/data96/postgresql.conf*, set "max_prepared_transactions"
0187 to 1000.
0188 
0189 --------------------------------------------------------------------------------
0190 
0191 max_prepared_transactions = 1000                # zero disables the feature
0192 
0193 --------------------------------------------------------------------------------
0194 
0195 For access permissions and network configuration, update 
0196 */var/db/postgres/data96/pg_hba.conf*, so that it contains following:
0197 
0198 --------------------------------------------------------------------------------
0199 
0200 local   all             all                                     peer
0201 host    all             all             127.0.0.1/32            md5
0202 host    all             all             ::1/128                 md5
0203 
0204 --------------------------------------------------------------------------------
0205 
0206 Restart PostgreSQL:
0207 
0208 --------------------------------------------------------------------------------
0209 
0210 $ sudo service postgresql restart
0211 
0212 --------------------------------------------------------------------------------
0213 
0214 
0215 === Building the code
0216 
0217 ---------------------------------------------------------------------
0218 $ cd /home/user1/endurox
0219 $ cmake -DDEFINE_DISABLEDOC=ON -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/dist .
0220 $ make 
0221 $ make install
0222 ---------------------------------------------------------------------
0223 
0224 == Unit Testing
0225 
0226 Enduro/X basically consists of two parts:
0227 . XATMI runtime;
0228 . UBF/FML buffer processing. 
0229 Each of these two sub-systems have own units tests.
0230 
0231 === UBF/FML Unit testing
0232 
0233 ---------------------------------------------------------------------
0234 $ cd /home/user1/endurox/sampleconfig
0235 $ source setndrx
0236 $ cd /home/user1/endurox/ubftest
0237 $ ./ubfunit1 2>/dev/null
0238 Running "main" (76 tests)...
0239 Completed "ubf_basic_tests": 198 passes, 0 failures, 0 exceptions.
0240 Completed "ubf_Badd_tests": 225 passes, 0 failures, 0 exceptions.
0241 Completed "ubf_genbuf_tests": 334 passes, 0 failures, 0 exceptions.
0242 Completed "ubf_cfchg_tests": 2058 passes, 0 failures, 0 exceptions.
0243 Completed "ubf_cfget_tests": 2232 passes, 0 failures, 0 exceptions.
0244 Completed "ubf_fdel_tests": 2303 passes, 0 failures, 0 exceptions.
0245 Completed "ubf_expr_tests": 3106 passes, 0 failures, 0 exceptions.
0246 Completed "ubf_fnext_tests": 3184 passes, 0 failures, 0 exceptions.
0247 Completed "ubf_fproj_tests": 3548 passes, 0 failures, 0 exceptions.
0248 Completed "ubf_mem_tests": 4438 passes, 0 failures, 0 exceptions.
0249 Completed "ubf_fupdate_tests": 4613 passes, 0 failures, 0 exceptions.
0250 Completed "ubf_fconcat_tests": 4768 passes, 0 failures, 0 exceptions.
0251 Completed "ubf_find_tests": 5020 passes, 0 failures, 0 exceptions.
0252 Completed "ubf_get_tests": 5247 passes, 0 failures, 0 exceptions.
0253 Completed "ubf_print_tests": 5655 passes, 0 failures, 0 exceptions.
0254 Completed "ubf_macro_tests": 5666 passes, 0 failures, 0 exceptions.
0255 Completed "ubf_readwrite_tests": 5764 passes, 0 failures, 0 exceptions.
0256 Completed "ubf_mkfldhdr_tests": 5770 passes, 0 failures, 0 exceptions.
0257 Completed "main": 5770 passes, 0 failures, 0 exceptions.
0258 
0259 ---------------------------------------------------------------------
0260 
0261 === XATMI Unit testing
0262 ATMI testing might take some time. Also ensure that you have few Gigabytes of free 
0263 disk space, as logging requires some space (about ~10 GB).
0264 
0265 ---------------------------------------------------------------------
0266 $ cd /home/user1/endurox/atmitest
0267 $ nohup ./run.sh &
0268 $ tail -f /home/user1/endurox/atmitest/test.out
0269 ...
0270 ************ FINISHED TEST: [test028_tmq/run.sh] with 0 ************
0271 Completed "atmi_test_all": 28 passes, 0 failures, 0 exceptions.
0272 Completed "main": 28 passes, 0 failures, 0 exceptions.
0273 ---------------------------------------------------------------------
0274 
0275 == Conclusions
0276 At finish you have a configured system which is read to process the transactions
0277 by Enduro/X runtime. It is possible to copy the binary version ('dist') folder
0278 to other same architecture machines and run it there without need of building.
0279 
0280 :numbered!:
0281 
0282 [bibliography]
0283 Additional documentation 
0284 ------------------------
0285 This section lists additional related documents.
0286 
0287 [bibliography]
0288 .Resources
0289 - [[[BINARY_INSTALL]]] See Enduro/X 'binary_install' manual.
0290 
0291 
0292 ////////////////////////////////////////////////////////////////
0293 The index is normally left completely empty, it's contents being
0294 generated automatically by the DocBook toolchain.
0295 ////////////////////////////////////////////////////////////////