rlm_sql_db2 sql server configuration

abdurrm at ub.ac.id abdurrm at ub.ac.id
Mon Mar 14 10:37:01 CET 2016


Thanks for fast respon, now I am focusing to Build FR v3.0.4 (our 
production version) with DB2 V10.5

/*
  * Modification of rlm_sql_db2 to handle IBM DB2 UDB V7
  * by Joerg Wendland <wendland at scan-plus.de>
  */
my problem is, I cant find DB2 V7.1 as Joerg Mention. so I do a bit 
modify at "configure" file line 1846 and 2815
#diff output:
1846c1846
<               smart_try_dir="$ibmdb2_lib_dir /usr/local/db2/lib 
/opt/ibm/db2/V10.5/lib32"
---
>               smart_try_dir="$ibmdb2_lib_dir /usr/local/db2/lib 
> /usr/IBMdb2/V7.1/lib"
2815c2815
<               smart_try_dir="$ibmdb2_include_dir 
/usr/local/db2/include /opt/ibm/db2/V10.5/include"
---
>               smart_try_dir="$ibmdb2_include_dir /usr/local/db2/include 
> /usr/IBMdb2/V7.1/include"


And I wish code will run with my DB2 V10.5, then I do configure
# ./configure --with-experimental-modules 
--prefix=/home/user/freeradius3 --exec-prefix=/home/user/freeradius3
# make install
Everything is working fine..

I do config as you said on freeradius3/sbin/etc/raddb/mods-enable/sql :
    driver = "rlm_sql_db2"
    dialect = "db2"
    server = "x.x.x.x"'
    port = 50000
    login = "db2inst1"
    password = "mypassword"
    radius_db = "DB2ADMIN

then I run my build
freeradius3/sbin#radiusd -X -d ../etc/raddb
this is my error message :

rlm_sql (sql): Driver rlm_sql_db2 (module rlm_sql_db2) loaded and linked
rlm_sql (sql): Attempting to connect to database "DB2ADMIN"
rlm_sql (sql): Initialising connection pool
    pool {
         start = 5
         min = 4
         max = 32
         spare = 3
         uses = 0
         lifetime = 0
         cleanup_interval = 30
         idle_timeout = 60
         retry_delay = 1
         spread = no
    }
rlm_sql (sql): Opening additional connection (0)
could not connect to DB2 server x.x.x.x
rlm_sql_db2: Socket destructor called, closing socket
rlm_sql (sql): Opening connection failed (0)
rlm_sql (sql): Removing connection pool
../etc/raddb/mods-enabled/sql[20]: Instantiation failed for module "sql"

http://wiki.freeradius.org/modules/Rlm_sql
http://wiki.freeradius.org/create/rlm_sql_db2
There is no SQL Documentation for DB2 yet.. :(

Is FR rlm_sql_db2 really not support DB2 V10.5?
or maybe anyone has a db2ec-v7.1 installer?

BR,
abdurrm


On 2016-03-12 21:48, Alan DeKok wrote:

> On Mar 12, 2016, at 7:53 AM, abdurrm at ub.ac.idwrote:
> 
>> I forced configure to compile rlm_sql_db2 using libdb2 V10.5 instead 
>> of IBM DB2 UDB V7 as mention in rlm_sl_db2.c I have read IBM cli 
>> SQLConnect() documentation, about what argument should been sent. 
>> (because SQLConnect() using DSN/Data Source instead of Server's IP 
>> Address. and my V10.5-libdb2 is works with my php-pecl-db2 module) is 
>> there any special configuration in etc/raddb/mods-enabled/sql for db2? 
>> notably "server" and "radius-db"?
> 
> There should be no special configuration.
> 
>> I've beed compile both stable 3.0.4 and last master-branch 3.1.x and 
>> keep give me error "rlm_sql_db2 - could not connect to DB2 server 
>> [idontknowwhatshouldisethere"
> 
> Is that really the error message?
> 
> If it can't connect to the SQL server, read the SQL server 
> documentation for what connection parameters are used.
> 
>> Here is my sql configuration : dialect = "db2" server = "my.db.2.serv" 
>> #server = 
>> "(DATABASE=db2admin;HOSTNAME=x.x.x.x;PORT=50000;PROTOCOL=TCPIP;UID=db2inst1;PWD=xxx)" # i have tried to use PHP-PECL-DB2 DSN based, it also wont work.
> 
> That shouldn't be hard to figure out. You have a database, hostname, 
> port, etc. in that connection string. And you have similar options in 
> the SQL module configuration. How about using the parameters from 
> PHP-PECL-DB2 in the FreeRADIUS configuration?
> 
> radius_db = db2admin
> server = x.x.x.
> port = 50000
> login = db2inst1
> password = xxx
> 
> Alan DeKok.
> 
> -
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/users.html [1]



Links:
------
[1] http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list