[Lxc-users] 来自Binknight的邮件

2013-02-21 Thread Binknight
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] IPC with shared memory?

2012-12-12 Thread Binknight
hi, 
i have two processes running in two containers on the same hardware node, 
they are expected to communicate with shared memory IPC mechanism, but it 
turned out to be failed.  It seems that the shared memory created in one 
container is not visible to process in other container because different 
namespace. is there any way to address this problem?



--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using lxc on production

2012-10-23 Thread Binknight




I am trying to use lxc in product environment, but i can not limit the guest's 
network bandwidth.  I followed the list instructions, but it does take effect. 
How do you limit the guest's network bandwidth?


# tc qdisc add dev virbr0 root handle 10: htb
# tc filter add dev virbr0 parent 10: protocol ip prio 10 handle 1: cgroup
# tc class add dev virbr0 parent 10: classid 10:1 htb rate 24Mbit
# echo 0x11 > /cgroup/c/net_cls.classid





在 2012-10-24 00:38:47,"Stéphane Graber"  写道:
>On 10/23/2012 12:29 AM, Ulli Horlacher wrote:
>> On Mon 2012-10-22 (14:53), Stéphane Graber wrote:
>> 
>>> All in all, that's somewhere around 300-400 containers I'm managing
>> 
>> How do you handle a host (hardware) failure?
>
>Everything that runs in the container is in a configuration management
>system, so any container can be redeployed from scratch in just a couple
>of minutes without needing the actual rootfs.
>
>On top of that, all the containers are backed up centrally using data
>deduplication, so if I really need it, I can extract a .tar.gz of the
>rootfs of any container in minutes and then just dump that on another
>machine.
>
>Though technically all the critical services are already redundant, so
>in case of a host failure, all I'd see is an increase of load on the
>other servers while I fix the host and get the rest back online.
>
>-- 
>Stéphane Graber
>Ubuntu developer
>http://www.ubuntu.com
>
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] limit network bandwidth with tc

2012-10-22 Thread Binknight
It seems that there are two way to limit the network usage of containers. 
One is with net_cls and the other one is net_prio。The first one can be used 
with "tc" to limit bandwidth while the second one manipulate the priority of 
package sent from container. I've tried net_cls with tc by


set 
 # net classid 1:10
 lxc.cgroup.net_cls.classid = 0x10010
in lxc config file and run tc.sh to setup tc queue discipline


# cat tc.sh 
tc qdisc add dev virbr0 root handle 1: htb
tc class add dev virbr0 parent 1: classid 1:10 htb rate 1kbit ceil 2kbit


Note: The container use virbr0 created by libvirt as net interface, iptable is 
configured to make it possible to access server running inside the container 
from outside.


But in my test, network is not limited at all. What's wrong?



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] problem in start lxc container

2012-10-08 Thread Binknight
I setup a bridge by modify the scripts in /etc/sysconfig/network-scripts/ in my 
test environment,it does work but it's not a satisfied solution, since it will 
change much of the HOST. My system administrator may not be pleased if I change 
the system config of the product environment. Though changing system config is 
inevitable, I am looking for an approach that's easy to deploy and easy to 
recover. Maybe libvirt is the right way.



At 2012-10-08 18:02:34,"Fajar A. Nugraha"  wrote:
>On Mon, Oct 8, 2012 at 11:04 AM, Binknight  wrote:
>> I want to setup nginx service on the container, so the container should be
>> visible to other hosts as well as the HOST it lives. The HOST machine's ip
>> is 10.2.132.110.
>>
>> so is it possible to setup an ip for container that's visible to other hosts
>> by configuring libvirt?
>
>Yes, setup a bridge on your physical interface. It will be just like
>any other host on your network. Note that in only works for wired
>interface though, not for wireless.
>
>My wiki has examples for several types of bridge for Debian/Ubuntu,
>but for F16 you can try Google "fedora bridge howto"
>
>-- 
>Fajar
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] problem in start lxc container

2012-10-07 Thread Binknight
I want to setup nginx service on the container, so the container should be 
visible to other hosts as well as the HOST it lives. The HOST machine's ip is 
10.2.132.110.


so is it possible to setup an ip for container that's visible to other hosts by 
configuring libvirt? 



At 2012-09-22 05:30:27,"Fajar A. Nugraha"  wrote:
>On Fri, Sep 21, 2012 at 9:16 PM, Binknight  wrote:
>>
>> many thanks,
>>
>> I edit the container's /etc/rc.d/rc.sysinit and add :
>>  route add default gw 192.168.122.1 # address of virbr0
>>  echo >> /etc/resolv.conf nameserver 10.2.0.41 #name server the same as
>> that in HOST's /etc/resolv.conf
>> then i can ping google successfully .
>
>libvirt SHOULD create the bridge as well as start dnsmasq, which
>functions as DHCP and dns. So if you had to do that manually you
>either:
>- don't use dhcp on the guest, or
>- your libvirt installation is broken
>
>-- 
>Fajar
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] problem in start lxc container

2012-09-21 Thread Binknight


many thanks,


I edit the container's /etc/rc.d/rc.sysinit and add :
 route add default gw 192.168.122.1 # address of virbr0
 echo >> /etc/resolv.conf nameserver 10.2.0.41 #name server the same as 
that in HOST's /etc/resolv.conf
then i can ping google successfully .



在 2012-09-21 21:15:07,"Huang Qiang"  写道:
>On 2012/9/21 星期五 21:05, Binknight wrote:
>> 
>> hi Fajar,
>> 
>> thank you for your advise and wiki, that provides a lot of useful 
>> informations.
>> 
>> My test environment is FC16 and product environment is centos 6.3. So I 
>> have to set up lxc in FC or centos. I tested in centos and found that 
>> lxc-0.7.5 will work(I previously use the 0.8.0rc). Now I can ping the host 
>> from my container and vice versa, but I can not access to other networks(eg. 
>> ping www.google.com <http://www.google.com> will fail). My network configure 
>> is,
>> 
>> lxc.network.type = veth
>> lxc.network.flags = up 
>> lxc.network.link = virbr0 
>> lxc.network.name = eth0 
>> lxc.network.mtu = 1500 
>> lxc.network.ipv4 = 192.168.122.2/24
>> 
>> the bridge "virbr0" is create automatically by install libvirt.
>> 
>
>Did you set your ip route in the container?
>You need to set it the same as your host.
>
--
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] problem in start lxc container

2012-09-21 Thread Binknight

hi Fajar,


thank you for your advise and wiki, that provides a lot of useful 
informations.


My test environment is FC16 and product environment is centos 6.3. So I 
have to set up lxc in FC or centos. I tested in centos and found that lxc-0.7.5 
will work(I previously use the 0.8.0rc). Now I can ping the host from my 
container and vice versa, but I can not access to other networks(eg. ping 
www.google.com will fail). My network configure is,


lxc.network.type = veth
lxc.network.flags = up 
lxc.network.link = virbr0 
lxc.network.name = eth0 
lxc.network.mtu = 1500 
lxc.network.ipv4 = 192.168.122.2/24


the bridge "virbr0" is create automatically by install libvirt.



At 2012-09-20 11:24:15,"Fajar A. Nugraha"  wrote:
>On Thu, Sep 20, 2012 at 10:02 AM, Binknight  wrote:
>> hi all,
>>
>> After searching for a while, I found there are many different
>> introductions to install lxc container, but do not find a step by step
>> tutorial that works for general purpose.
>
>At this moment using Ubuntu 12.04 would probably be easier. It just works.
>
>https://help.ubuntu.com/12.04/serverguide/lxc.html
>
>... or see simplified instructions on my wiki:
>http://wiki.1tux.org/wiki/Lxc/Installation
>
>>
>> I have a host running fedora 16, and I want to install a lxc container
>> that I can run some apps in it. The reason i need such a container is that
>> 1) I will limit the resource usage of these apps, and 2) the apps' running
>> environment is different
>>  with the host's.
>>
>
>Those are good reasons to use lxc. However AFAIK you can't (yet?) have
>a container which uses systemd, so even when you can use F16 as host,
>you can't use it as guest container.
>
>> I tried the following steps: 1) install libcgroup, 2) install lxc, both
>> the two are downloaded from sf.net.
>>
>> By run the lxc-fedora under the lxc's templates
>> directory(/usr/local/lib/lxc/templates), it seems that the container is
>> installed successfully. It says:
>> "container is configured for lxc.network.type=veth and
>> lxc.network.link=virbr0 (which is default if you have libvirt runnig)   "
>>
>> then i checked the libvirt by : service --status-all
>>
>> libvirtd.service - LSB: daemon for libvirt virtualization API
>>   Loaded: loaded (/etc/rc.d/init.d/libvirtd)
>>   Active: active (running) since Thu, 20 Sep 2012 10:18:20 +0800;
>> 23min ago
>> but when i try to start my container by lxc-start -n test1 -f
>> test1/conf,it logout my host. After i login again, all is the same as before
>> start container. So i am confused about how i can start my container or is
>> there something i have skipped in the install process?
>
>I'm not sure about F16. I'm guessing the problem is that your
>container accesses the same tty as the host.
>
>Again, I recommend to use ubuntu for host. You can then have fedora
>(up to f14), rhel/centos, ubuntu, and other
>sysvinit-or-upstart-based-OS as guest,
>
>-- 
>Fajar
--
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] problem in start lxc container

2012-09-19 Thread Binknight
hi all,


After searching for a while, I found there are many different introductions 
to install lxc container, but do not find a step by step tutorial that works 
for general purpose.


I have a host running fedora 16, and I want to install a lxc container that 
I can run some apps in it. The reason i need such a container is that 1) I will 
limit the resource usage of these apps, and 2) the apps' running environment is 
different  
 with the host's.


I tried the following steps: 1) install libcgroup, 2) install lxc, both the 
two are downloaded from sf.net.


By run the lxc-fedora under the lxc's templates 
directory(/usr/local/lib/lxc/templates), it seems that the container is 
installed successfully. It says:
"container is configured for lxc.network.type=veth and 
lxc.network.link=virbr0 (which is default if you have libvirt runnig)   "
   
then i checked the libvirt by : service --status-all


libvirtd.service - LSB: daemon for libvirt virtualization API
  Loaded: loaded (/etc/rc.d/init.d/libvirtd)
  Active: active (running) since Thu, 20 Sep 2012 10:18:20 +0800; 23min 
ago
but when i try to start my container by lxc-start -n test1 -f test1/conf,it 
logout my host. After i login again, all is the same as before start container. 
So i am confused about how i can start my container or is there something i 
have skipped in the install process?--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users