Greetings, I've a need to run 2 instances on one box. I've spent the better part of 2 days looking for docs and howto's and reading the FM. However, I think I'm making too much out of it, thinking that there is more to it than there really is. the first instance is to serve the users, the second instance is for the backup system. I'm running fedora core 2 with samba 3.0.8pre2 (the first instance is a member server in a win2k3 domain and its working well.) I have a test box set up to experiment on. is there someone that can give me a quick run down as to the process of setting this up? or just a link to a doc would be fine... I haven't really found that much on the web though. Thanks Fred
Greg Folkert
2004-Dec-08 21:35 UTC
[Samba] configure dual samba 3.0.8 instances-one fedora box
On Wed, 2004-12-08 at 10:19 -0600, Fred wrote:> Greetings, > > I've a need to run 2 instances on one box. I've spent the better part > of 2 days looking for docs and howto's and reading the FM. However, I > think I'm making too much out of it, thinking that there is more to it > than there really is. > > the first instance is to serve the users, the second instance is for > the backup system. > > I'm running fedora core 2 with samba 3.0.8pre2 (the first instance is a > member server in a win2k3 domain and its working well.) > > I have a test box set up to experiment on. > > > is there someone that can give me a quick run down as to the process of > setting this up? or just a link to a doc would be fine... I haven't > really found that much on the web though.You are missing an additional IP Address. Just assign an additional IP Addr to the existing interface and then have the "working" one only listen to the original interface (eth0 maybe), and the new one listen on the added interface (eth0.1 or what ever you name it) Both instances have to have different configs and "storage areas" for things like the tdbs and WINS/cached information, print$ and profiles. Though you can still have the same shares defined. And the printers should just work as well especially if you use CUPS. -- greg, greg@gregfolkert.net The technology that is Stronger, better, faster: Linux -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.samba.org/archive/samba/attachments/20041208/057a9bf4/attachment.bin
I did this yesterday, and don't have time for testing it yet, so I'll let you do the testing :-) This is for Fedora Core 3, running samba 3.0.9-2 from the yum develop repository. Other builds may have stuff in other places. First of all you will need a new IP address. This can be done on the existing network interface. On redhat/fedora you can use redhat-config-network or system-config-network as a gui for this. If you currently use eth0, set up a new address on eth0:1. Then we have to make sure you existing domain leaves this IP address alone. And you have to decide which samba instance gets to own the loopback interface. I think I saw a note somewhere that swat cannot be used unless you bind to loopback, so only one domain may be able to use swat. In /etc/samba/smb.conf (your existing instance), add interfaces = lo <IP of eth0>/24 bind interfaces only = yes Remove lo if this instance is not the one that should own loopback. I guess you should restart this samba instance here and see that it only responds to the expected IP address(es) afterwards. Then we start with the next instance. Lets start in /etc/init.d copy smb to smb-dom2 In smb-dom2: change all references to /var/run/samba, /etc/samba, /etc/sysconfig/samba (change samba to samba-dom2) change all references to /var/lock/subsys/smb (change smb to smb-dom2) add argument to all 'daemon' lines so they look like this: daemon --check=samba-dom2/smbd smbd $SMBDOPTIONS daemon --check=samba-dom2/nmbd nmbd $NMBDOPTIONS change all killproc lines by prepending samba-dom2/ to the first argument. e.g. killproc samba-dom2/smbd similarly change all status lines If you need winbind on the domain, do something similar to the winbind startup file. Now, copy /etc/sysconfig/samba to /etc/sysconfig/samba-dom2 Edit the file and add -s /etc/samba-dom2/smb.conf -l /var/log/samba-dom2 to all 3 variables. You may want to create the various directories at this point. /var/run/samba-dom2, /var/cache/samba-dom2 and /var/log/samba-dom2. Now, set up /etc/samba-dom2/smb.conf Change or add the following settings: log file = /var/log/samba-dom2/%m.log include = /etc/samba-dom2/smb.conf.%m interfaces = <IP if eth0:1>/24 bind interfaces only = yes pid directory = /var/run/samba-dom2 private dir = /etc/samba-dom2 lock directory = /var/cache/samba-dom2 Any other references to files or directories must also be reviewed. E.g. if you use a username map, change it to username map = /etc/samba-dom2/smbusers You should then be able to use chkconfig and service commands to turn on and off the smb and smb-dom2 services. Check thoroughly that they stop and start the correct instances! In my setup, only the fist smb service has a winbind running, so I have not looked into setting up winbind for additional instances. There could be pitfalls! Any feedback is appreciated. I really want to know how this works for you. -- birger