[Lxc-users] Running Fedora12 container on Ubuntu

Daniel Lezcano daniel.lezcano at free.fr
Thu Jul 22 14:51:14 UTC 2010


On 07/21/2010 02:39 PM, Nikola Simidzievski wrote:
> Hi,
> Actually Daniel you are right, something was wrong with my rootfs. When I
> reconfigured it, and applied your changes it booted with every service.
> Thanks.
> I have just another question, actually I need an explanation.... I am
> developing an application that should be distributed along several machines.
> My application is connected to database. So my question is, if I run several
> container on the same rootfs, and I run several instances of the same
> application (one for every container), what will happen with the database
> entries (because there is actually one database installed on the rootfs)?
> Should I make different rootfs for every machine or is fine right now?
>    

 From the point of view of containers, sharing the same filesystem 
should be ok if the multiple instances of your application does not 
overlap with some files. Concerning the database in the shared fs, I 
don't know, that depends on what does your application. If I understand 
correctly, your application should be distributed along several machines 
and they are connected to the same database. You can keep your database 
on your host and let the multiple instances of your application to 
connect to the database via the virtualized network on your host, that 
will be similar.

> Thank you very much,
> Nikola
>
> On Tue, Jul 20, 2010 at 11:24 PM, Nirmal Guhan<vavatutu at gmail.com>  wrote:
>
>    
>> I think the services are getting started but fail during the process.
>> Do you have the /var/lock/subsys directory in your container?
>>
>> --Nirmal
>>
>> On Tue, Jul 20, 2010 at 5:29 AM, Nikola Simidzievski
>> <nikola.simidzievski at gmail.com>  wrote:
>>      
>>> Hi,
>>> This change boots the system, but none of the services is started. Here
>>>        
>> is
>>      
>>> an output:
>>> ===========================================
>>> ....
>>> touch: cannot touch `/var/lock/subsys/rsyslogd': No such file or
>>>        
>> directory
>>      
>>> Starting sshd:                                       [touch: cannot touch
>>> `/var/lock/subsys/sshd': No such file or directory
>>> MySQL Daemon failed to start.
>>> Starting MySQL:                                      [FAILED]
>>> touch: cannot touch `/var/lock/subsys/httpd': No such file or directory
>>> touch: cannot touch `/var/lock/subsys/local': No such file or directory
>>> .....................
>>> ============================================
>>>
>>> On Tue, Jul 20, 2010 at 2:06 PM, Daniel Lezcano<dlezcano at fr.ibm.com>
>>>        
>> wrote:
>>      
>>>> On 07/20/2010 01:58 PM, Nikola Simidzievski wrote:
>>>>          
>>>>> Hi,
>>>>> I am trying to get Fedora 12 container on Ubuntu 10.4, but I have
>>>>>            
>> several
>>      
>>>>> problems. I installed new  rootfs using febootstrap , and configured
>>>>>            
>> it,
>>      
>>>>> and
>>>>> created new fstab (guided form
>>>>> http://blog.bodhizazen.net/linux/lxc-configure-fedora-containers ) :
>>>>>
>>>>>
>>>>>            
>> -----------------------------------------------------------------------------------------------
>>      
>>>>> none /lxc/rootfs.fedora/dev/pts devpts defaults 0 0
>>>>> none /lxc/rootfs.fedora/proc proc defaults 0 0
>>>>> none /lxc/rootfs.fedora/sys sysfs defaults 0 0
>>>>> #none /lxc/rootfs.fedora/var/lock tmpfs defaults 0 0
>>>>> #none /lxc/rootfs.fedora/var/run tmpfs defaults 0 0
>>>>> /etc/resolv.conf /lxc/rootfs.fedora/etc/resolv.conf none bind 0 0
>>>>> ----------------------------------------------------------------------
>>>>> My lxc conf. file look like this :
>>>>>
>>>>>
>>>>>            
>> ----------------------------------------------------------------------------------------------------
>>      
>>>>> lxc.utsname = fedora
>>>>> lxc.tty = 4
>>>>> lxc.network.type = veth
>>>>> lxc.network.flags = up
>>>>> lxc.network.link = br-node0
>>>>> lxc.network.name = eth0
>>>>> lxc.network.mtu = 1500
>>>>> lxc.network.ipv4 = 10.0.0.1/24
>>>>> lxc.rootfs = /lxc/rootfs.fedora
>>>>> lxc.mount = /lxc/fstab.fedora
>>>>> lxc.cgroup.devices.deny = a
>>>>> # /dev/null and zero
>>>>> lxc.cgroup.devices.allow = c 1:3 rwm
>>>>> lxc.cgroup.devices.allow = c 1:5 rwm
>>>>> # consoles
>>>>> lxc.cgroup.devices.allow = c 5:1 rwm
>>>>> lxc.cgroup.devices.allow = c 5:0 rwm
>>>>> lxc.cgroup.devices.allow = c 4:0 rwm
>>>>> lxc.cgroup.devices.allow = c 4:1 rwm
>>>>> # /dev/{,u}random
>>>>> lxc.cgroup.devices.allow = c 1:9 rwm
>>>>> lxc.cgroup.devices.allow = c 1:8 rwm
>>>>> # /dev/pts/* - pts namespaces are "coming soon"
>>>>> lxc.cgroup.devices.allow = c 136:* rwm
>>>>> lxc.cgroup.devices.allow = c 5:2 rwm
>>>>> # rtc
>>>>> lxc.cgroup.devices.allow = c 254:0 rwm
>>>>>
>>>>>
>>>>>            
>> ---------------------------------------------------------------------------------------------------------------
>>      
>>>>> When I start the machine with this setup I get this error:
>>>>> ==================================================
>>>>> lxc-start: Device or resource busy – failed to mount ‘none’ on
>>>>> ‘/lxc/rootfs.fedora/dev/pts’
>>>>> lxc-start: failed to setup the mounts for ‘fedora′
>>>>> lxc-start: failed to setup the container
>>>>> ====================================================
>>>>> So I remove the lxc.mount part from the conf. file and it starts
>>>>>            
>> normally
>>      
>>>>> but a get  error when I make ssh connection (PTY allocation request
>>>>> failed
>>>>> on channel 0) so I assume that has something to do with wrong mount on
>>>>> /dev/pts. I tried to mount it manually via chroot but then the booting
>>>>> slows
>>>>> down and services like mysqld and httpd can't be started. So any
>>>>> suggestions
>>>>> how to solve this?
>>>>>            
>>>> Can you check by removing the "none /lxc/rootfs.fedora/dev/pts devpts
>>>> defaults 0 0" line in the fstab and add lxc.pts=1 in the configuration
>>>>          
>> file
>>      
>>>> ?
>>>>          
>>>
>>>
>>>        
>> ------------------------------------------------------------------------------
>>      
>>> This SF.net email is sponsored by Sprint
>>> What will you do first with EVO, the first 4G phone?
>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>> _______________________________________________
>>> Lxc-users mailing list
>>> Lxc-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/lxc-users
>>>
>>>
>>>        
>>      
>    
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>
>
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>    





More information about the lxc-users mailing list