Virtual Server with Multiple Databases
Hi, I am currently using version 2.1.3-1. I was trying to create virtual servers accessing to different mysql databases. From some of the historical threads, I understood that the followings steps are needed: 1. Create an entry in /etc/raddb/dictionary. I had the line as: ATTRIBUTE My-DB 3000 String 2. I edit the sql.conf with the following: radius_db = %{control:My-DB} 3. In the virtual server section, I added the following at the top of the authorize and preacct sections: update control { My-DB = "my_radiusdb_name" } With the above 3 changes, I run radiusd -X and I get the below errors. Can anyone help to identify what went wrong? rad_recv: Access-Request packet from host 192.168.188.1 port 57018, id=206, length=138 NAS-IP-Address = 208.75.51.88 NAS-Identifier = "vpn.skywalk.net" User-Name = "kelvincrypt" User-Password = "test" Service-Type = Login-User NAS-Port-Type = Ethernet NAS-Port = 3 Framed-IP-Address = 192.168.188.200 Called-Station-Id = "00:0d:48:36:2f:ff" Calling-Station-Id = "00:17:08:3e:a2:21" server radius_test { +- entering group authorize {...} ++[control] returns notfound ++[preprocess] returns ok [auth_log] expand: /var/log/radius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d -> /var/log/radius/radacct/192.168.188.1/auth-detail-20090122 [auth_log] /var/log/radius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d expands to /var/log/radius/radacct/192.168.188.1/auth-detail-20090122 [auth_log] expand: %t -> Thu Jan 22 14:05:35 2009 ++[auth_log] returns ok ++[chap] returns noop [suffix] No '@' in User-Name = "kelvincrypt", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] returns noop [eap] No EAP-Message, not doing EAP ++[eap] returns noop [radius_test_sql] expand: %{User-Name} -> kelvincrypt [radius_test_sql] sql_set_user escaped user --> 'kelvincrypt' rlm_sql (radius_test_sql): Ignoring unconnected handle 4.. rlm_sql (radius_test_sql): Ignoring unconnected handle 3.. rlm_sql (radius_test_sql): Ignoring unconnected handle 2.. rlm_sql (radius_test_sql): Ignoring unconnected handle 1.. rlm_sql (radius_test_sql): Ignoring unconnected handle 0.. rlm_sql (radius_test_sql): There are no DB handles to use! skipped 5, tried to connect 0 ++[radius_test_sql] returns fail } # server radius_test Using Post-Auth-Type Reject +- entering group Reject {...} ++[reply] returns noop Delaying reject of request 0 for 1 seconds Going to the next request Waking up in 0.9 seconds. Sending delayed reject for request 0 Sending Access-Reject of id 206 to 192.168.188.1 port 57018 Reply-Message = "Authentication failed." Waking up in 4.9 seconds. _________________________________________________________________ See all the ways you can stay connected to friends and family http://www.microsoft.com/windows/windowslive/default.aspx
Kelvin Chiang wrote: ...
rlm_sql (radius_test_sql): Ignoring unconnected handle 4.. rlm_sql (radius_test_sql): Ignoring unconnected handle 3.. rlm_sql (radius_test_sql): Ignoring unconnected handle 2..
Your SQL database is down. This has nothing to do with the configuration changes you made. Alan DeKok.
Hi Alan, It seems that the issue is not the MySQL database. If I defined radius_db = "my_radiusdb_name" in the sql instance, everything works fine. However, if I used authorize and preacct to define the database name on the fly, the errors occurred. Regards, Kelvin
Date: Thu, 22 Jan 2009 11:12:14 +0100 From: aland@deployingradius.com To: freeradius-users@lists.freeradius.org Subject: Re: Virtual Server with Multiple Databases
Kelvin Chiang wrote: ...
rlm_sql (radius_test_sql): Ignoring unconnected handle 4.. rlm_sql (radius_test_sql): Ignoring unconnected handle 3.. rlm_sql (radius_test_sql): Ignoring unconnected handle 2..
Your SQL database is down. This has nothing to do with the configuration changes you made.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
_________________________________________________________________ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/
Kelvin Chiang wrote:
It seems that the issue is not the MySQL database. If I defined radius_db = "my_radiusdb_name" in the sql instance, everything works fine. However, if I used authorize and preacct to define the database name on the fly, the errors occurred.
Ah. That isn't supported. It is a limitation of the SQL client API's of most SQL DB's. The SQL module keeps socket connections open for a long time to help performance. This means connecting to a specific database. You will need to define multiple SQL modules to get the same effect. Alan DeKok.
Hi Alan, Ok, glad to know it wasn't me :) Regards, Kelvin
Date: Thu, 22 Jan 2009 14:21:26 +0100 From: aland@deployingradius.com To: freeradius-users@lists.freeradius.org Subject: Re: Virtual Server with Multiple Databases
Kelvin Chiang wrote:
It seems that the issue is not the MySQL database. If I defined radius_db = "my_radiusdb_name" in the sql instance, everything works fine. However, if I used authorize and preacct to define the database name on the fly, the errors occurred.
Ah. That isn't supported. It is a limitation of the SQL client API's of most SQL DB's.
The SQL module keeps socket connections open for a long time to help performance. This means connecting to a specific database.
You will need to define multiple SQL modules to get the same effect.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
_________________________________________________________________ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/
I am currently using version 2.1.3-1. I was trying to create virtual servers accessing to different mysql databases.
Create multiple sql instances in sql.conf: sql sql1 { .. } sql sql2 { .. } etc. Use the name of the instance you want in the virtual server instead of "sql". Ivan Kalik Kalik Informatika ISP
Hi Ivan, I tried that before, it worked fine. The reason why I explored the possibility of using CONTROL is avoid similar sections that called to different sql instance in the configuration file counter.conf, which will require the server section to call noresetcounter1, noresetcounter2 and ..... Or may be I am wrong, that there is an easier way to manage the counter even if I define multiple sql instances? Regards, Kelvin
To: freeradius-users@lists.freeradius.org Subject: Re: Virtual Server with Multiple Databases Date: Thu, 22 Jan 2009 11:15:35 +0100 From: tnt@kalik.net
I am currently using version 2.1.3-1. I was trying to create virtual servers accessing to different mysql databases.
Create multiple sql instances in sql.conf:
sql sql1 { .. } sql sql2 { .. } etc.
Use the name of the instance you want in the virtual server instead of "sql".
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
_________________________________________________________________ NEW! Get Windows Live FREE. http://www.get.live.com/wl/all
I tried that before, it worked fine. The reason why I explored the possibility of using CONTROL is avoid similar sections that called to different sql instance in the configuration file counter.conf, which will require the server section to call noresetcounter1, noresetcounter2 and .....
sqlcounters are instatiated at server startup because they require custom attributes written into the dictionary. It makes sense to do this only once (when server starts) and not every time someone tries to connect. Same thing is with sql instances. They are instatiated at startup and create persistant connections to the database. It would be a big performance hit to open database connections every time someone tries to connect. Ivan Kalik Kalik Informatika ISP
participants (3)
-
Alan DeKok -
Kelvin Chiang -
tnt@kalik.net