2 Independent MYSQL schemas for 2 independent groups of users
Dear All Freeradius Developers and Users, My server is running a Freeradius v2.2.7 with a single mysql server. I have been able to set up radius virtual servers listening on different ports. The next step is to configure 2 Independent MYSQL schemas for 2 independent groups of users AAA through their own virtual servers. This scenario is similar to 2 physically separate radius servers. In my case, I can reduce the operational cost to 1 physical server. In the era of rapid global warming, everybody should be responsible for it, right? Then, the policy will become: user group1 ==> port 1 ==> virtual server 1 ==> sql instance with schema radius1 user group2 ==> port 2 ==> virtual server 2 ==> sql instance with schema radius2 Other policy with not be altered. I have gone through many information but none of them tells which file or conf are responsible for 2 independent sql instances. Could anybody give me direction or share your experience? Thanks in advance. Yours Faithfully, Timmy
I have gone through many information but none of them tells which file or conf are responsible for 2 independent sql instances.
You use the sql.conf file in /etc/raddb - Make a copy of it, call it... sql-instance2.conf. In sql-instance2.conf, modify the "sql {" line to say "sql sqlinst2 {" Tweak it to fit your second instance. In radiusd.conf, search for the line "$INCLUDE sql.conf" (it should be uncommented). Duplicate the line, change the second one to "$INCLUDE sql-instance2.conf". In the second virtual server, instead of 'sql', use 'sqlinst2'. That should do it. :-) Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet Lumen House, Library Avenue, Harwell Oxford, Didcot, OX11 0SG jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Collections and Janet Ltd. is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under Company No. number 2881024, VAT No. GB 197 0632 86. The registered office is: Lumen House, Library Avenue, Harwell, Didcot, Oxfordshire, OX11 0SG. T 01235 822200.
Hi, this is clearly documented in the official documentation: http://wiki.freeradius.org/modules/Rlm_sql look under 'Instances' alan
I have gone through many information but none of them tells which file or conf are responsible for 2 independent sql instances. You use the sql.conf file in /etc/raddb - Make a copy of it, call it... sql-instance2.conf.
In sql-instance2.conf, modify the "sql {" line to say "sql sqlinst2 {"
Tweak it to fit your second instance.
In radiusd.conf, search for the line "$INCLUDE sql.conf" (it should be uncommented). Duplicate the line, change the second one to "$INCLUDE sql-instance2.conf".
In the second virtual server, instead of 'sql', use 'sqlinst2'.
That should do it.
:-)
Stefan Paetow
Dear Stefan, Thanks for your valuable hints. I follow your direction and I find that there are still other conf which may involve multiple sql instances. 1. In radiusd.conf, should I also duplicate each of this for a separate sql instance? $INCLUDE sql/mysql/counter.conf $INCLUDE sqlippool.conf 2. In file sql/mysql/counter.conf, there are lines sqlcounter dailycounter { sqlmod-inst = sql } So do I have to replace the sql entry with sqlinst2 etc? 3. In file sqlippool.conf, there are lines sqlippool { sql-instance-name = "sql" } So do I have to replace this with sqlinst2 etc? 4. In the sites-available/default or virtual-server file, there is an entry sqlippool How should I handle this to match a multiple mysql instances scenario? Yours Faithfully, Timmy
1. In radiusd.conf, should I also duplicate each of this for a separate sql instance? $INCLUDE sql/mysql/counter.conf $INCLUDE sqlippool.conf
Only if they are different for the two instances.
2. In file sql/mysql/counter.conf, there are lines sqlcounter dailycounter { sqlmod-inst = sql } So do I have to replace the sql entry with sqlinst2 etc?
You might need to define a second sqlcounter instance...
4. In the sites-available/default or virtual-server file, there is an entry sqlippool How should I handle this to match a multiple mysql instances scenario?
Yes, I suppose you would need to duplicate the instances, yes. Although I think in the longer run (if you end up with several, not just two, virtual servers for multiple clients), this is not workable, and you'll have to look at alternatives (like amending the schema to be able to figure out which server they're using). :-) Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet Lumen House, Library Avenue, Harwell Oxford, Didcot, OX11 0SG jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Collections and Janet Ltd. is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under Company No. number 2881024, VAT No. GB 197 0632 86. The registered office is: Lumen House, Library Avenue, Harwell, Didcot, Oxfordshire, OX11 0SG. T 01235 822200.
participants (3)
-
A.L.M.Buxey@lboro.ac.uk -
Stefan Paetow -
Timmy