Yacoubi Mohamed
2023-02-13T14:54:31+01:00
Yacoubi Mohamed
urn:md5:eacabd43d1ec1439188ee60076d41b1e
Dotclear
Export i386 rrd statistic to x86_64 arch
urn:md5:58bb6866f00687573dd3a59737f381f6
2016-09-02T16:37:00+01:00
2016-09-03T20:29:54+01:00
Mohamed YACOUBI
Divers
cacti
centos
gentoo
linux
munin
rrd
<p>I have recently begun to migrate my old Gentoo i386 to a Centos-7 x86_64. (This explains the change design blog)</p>
<p>You must export the munin rrd to a xml format :</p>
<pre>
cd /var/lib/munin/blog.yacoubi.fr/
for i in `ls *.rrd`; do rrdtool dump $i > $i.xml; done
</pre>
<p>To the new server, you just have to import and convert xml file to rrd file :</p>
<pre>
cd /var/lib/munin/blog.yacoubi.fr/
for i in `ls *.xml`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done
rm -v *.xml
</pre>
<p>Of course these commands are valid for all rrd file. (cacti for example)</p>
Le Datacenter virtuel par Hegerys (vCloud powered)
urn:md5:97d62e38434569fd77e5dd49567d128d
2012-04-25T21:14:00+02:00
2012-04-25T20:45:32+02:00
Mohamed YACOUBI
vmware
baie
cluster
datacenter
datacenter virtuel
euro-web
hegerys
housing
housing baie
housing baie datacenter
infogérance
location baie equinix
location serveur dédié
location serveur dédié infogéré
sd-france
sdfrance
vcenter
vcloud
vcloud director
virtualisation
vmware
vshield
vshield manager
vsphere
<p><img src="https://blog.yacoubi.fr/public/Logo/.vmware-vcloud-connector_s.jpg" alt="vmware_vcloud" style="display:block; margin:0 auto;" title="vmware_vcloud, avr. 2012" />
<br /></p>
<h3><q><strong>Sous le giron du groupe <a href="http://www.magic.fr/" hreflang="fr" title="Magic Online">Magic OnLine</a>, <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a> vous propose un datacenter virtuel gratuit pour une durée de 1 mois.</strong></q></h3>
<p><br />
<br /></p>
<h4><ins><strong>De quoi s'agit-il ?</strong></ins></h4>
<p><br /></p>
<ul>
<li>Un pool de ressources (RAM, CPU, stockage, VPN, adresses IP publiques / privées...) que vous pouvez répartir sur autant de serveurs que vous le souhaitez,</li>
<li>Une infrastructure en haute disponibilité redondée et répliquée,</li>
<li>Une interface Web permettant de lancer, dupliquer, arrêter et administrer ses serveurs,</li>
<li>Un catalogue de vApps préconfigurées (Windows Server, Linux Ubuntu...) permettant de démarrer de nouveaux serveurs en quelques clics,</li>
<li>Une migration (P2V) simplifiée au maximum en utilisant les standards du marché,</li>
<li>La gestion dynamique des ressources allouées aux serveurs,</li>
<li>Le déploiement d'architectures complexes (multi-tiers) en quelques clics,</li>
<li>Pas d'engagement de durée.</li>
</ul>
<p><br />
<br />
Avec l'offre Datacenter Virtuel <a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">VMware vCloud Director</a>, <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a> va plus loin dans sa proposition de valeur aux entreprises et s'appuie sur le leader mondial de la virtualisation pour offrir une solution qui permet toute la flexibilité et la marge de manoeuvre d'un véritable Datacenter.
<br />
Vous disposez d'un pool de ressources extensibles selon les besoins (processeur, RAM, stockage, etc.) et de services (Firewall dédié, VPN, NAT, DHCP, etc.) provisionnés automatiquement et en temps réel, administrables très simplement via une interface Web sécurisée.
<br />
Cette solution est particulièrement avantageuse pour toute entreprise qui souhaite migrer tout ou partie de son IT vers un espace Cloud sécurisé.
<br />
<br /></p>
<h4><ins><strong>FONCTIONNALITÉS ET AVANTAGES DE <a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">VCLOUD DIRECTOR</a> 1.5 :</strong></ins></h4>
<p><br />
<a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">VMware vCloud Director</a> 1.5 fournit un nombre important de fonctionnalités avancées aux clients Hegerys.
<br />
Quelques unes de ces fonctionnalités notables incluent:</p>
<ul>
<li>Interface Utilisateur (UI) - Le portail web <a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">vCloud Director</a> fournit un contrôle en « self-service » sur les ressources de vos Datacenters Virtuels.</li>
<li>Firewall dédié - Les firewalls de <a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">vCloud Director</a>, utilisant la technologie VMware vShield®, permettent une granularité fine en terme de règle de firewall, complément important des firewalls physiques <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a> en amont de vos Datacenters Virtuels.</li>
<li>Self-Service VPN - <a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">vCloud Director</a> 1.5 offre la possibilité de configurer des tunnels VPN IPSEC à la demande, et ce de façon très simple depuis l'interface utilisateur <a href="http://www.vmware.com/products/vcloud-director/overview.html" hreflang="en">vCloud Director</a>.</li>
<li>vCloud API 1.5 - L'API RESTful vCloud vous permet d'automatiser tout ou partie de votre provisionning, cycle de vie de vos Machines Virtuelles, règles de sécurités, etc. Cette API est accessible depuis une variété de « toolkits » de programmation (notamment Powershell, PHP, Java, .NET ou encore l'orchestrateur <a href="http://www.vmware.com/products/vcenter-orchestrator/overview.html" hreflang="en">VMware vCenter Orchestrator vCloud</a> 1.5), automatisant ainsi vos Datacenters Virtuels.</li>
</ul>
<p><br />
<ins>Liens utiles :</ins>
<br />
- <a href="http://www.hegerys.com/solutions-hebergement/plateforme-cloud/datacenter-virtuel-vmware-vcloud" hreflang="fr">Datacenter virtuel hegerys</a></p>
Xen vif-route and private lan
urn:md5:21bd1e6a9e86cbdbd99534189366cb0e
2012-01-04T20:55:00+01:00
2012-01-05T15:36:55+01:00
Mohamed YACOUBI
Xen
bridge
dom0
domU
Gentoo
infogérance
linux
vif-route
virtualisation
xen
<p><img src="https://blog.yacoubi.fr/public/Logo/.Xen_logo_s.jpg" alt="Xen_logo.png" style="display:block; margin:0 auto;" title="Xen_logo.png, fév. 2010" />
<br />
J'utilisais depuis quelques années un lan privé entre mes <strong><a href="http://wiki.xen.org/xenwiki/DomU" hreflang="en">DomU</a></strong> et le <strong><a href="http://wiki.xen.org/xenwiki/Dom0" hreflang="en">Dom0</a></strong> (le <strong><a href="http://wiki.xen.org/xenwiki/Dom0" hreflang="en">Dom0</a></strong> génère les graphs Munin) qui fonctionnait sans problème en <a href="https://blog.yacoubi.fr/index.php?post/2009/04/11/Xen-creation-reseau-prive-via-un-bridge">bridge</a> mais suite à <a href="https://blog.yacoubi.fr/index.php?post/2010/06/26/Xen-utilisation-de-l-IPv6-vif-route">l'allocation de ma plage IPv6 routé</a>, j'ai du modifier ma configuration <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> en mode routé (<strong><a href="http://wiki.xen.org/xenwiki/vif-route" hreflang="en" title="vif-route">vif-route</a></strong>).
<br />
<br />
En mode routé je devais exécuter des commandes manuellement sur le <strong><a href="http://wiki.xen.org/xenwiki/Dom0" hreflang="en">Dom0</a></strong> afin de modifier le routage de l'interface eth1.</p>
<pre class="bash">ip route del <span style="color: #000000;">10.41</span><span style="color: #000000;">.233</span>.XXX dev blog<span style="color: #000000;">.1</span> scope <span style="color: #c20cb9; font-weight: bold;">link</span> src <span style="color: #000000;">78.41</span><span style="color: #000000;">.233</span>.XXX
ip route add <span style="color: #000000;">10.41</span><span style="color: #000000;">.233</span>.XXX dev blog<span style="color: #000000;">.1</span> scope <span style="color: #c20cb9; font-weight: bold;">link</span> src <span style="color: #000000;">10.41</span><span style="color: #000000;">.233</span>.XXX</pre>
<p>Ce fonctionnement me permettait des communications <strong><a href="http://wiki.xen.org/xenwiki/DomU" hreflang="en">DomU</a></strong> <=> <strong><a href="http://wiki.xen.org/xenwiki/Dom0" hreflang="en">Dom0</a></strong> mais pas <strong><a href="http://wiki.xen.org/xenwiki/DomU" hreflang="en">DomU</a></strong> <=> <strong><a href="http://wiki.xen.org/xenwiki/DomU" hreflang="en">DomU</a></strong> (perte de paquet aléatoire).
<br />
<br />
Suite à la réinstallation de mon hyperviseur <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> en <strong><a href="http://en.wikipedia.org/wiki/64-bit" hreflang="en" title="64Bits">64Bits</a></strong> (ca m'aura pris du temps pour trouver la motivation), je me suis décidé à tout remettre au propre. (je traine des patchs homemade depuis Xen-3.2.1)
<br />
<br />
Voici donc ma nouvelle configuration permettant l'utilisation du <strong><a href="http://wiki.xen.org/xenwiki/vif-route" hreflang="en" title="vif-route">vif-route</a></strong> et du <strong><a href="http://wiki.xen.org/xenwiki/vif-bridge" hreflang="en" title="vif-bridge">vif-bridge</a></strong> simultanément, pour éviter d'éventuel bug j'ai préféré créer une interface dummy plutôt que d'ajouter un alias à l'interface loopback.</p>
<ul>
<li>/etc/conf.d/net</li>
</ul>
<pre class="bash"><span style="color: #007800;">config_dummy0=</span><span style="color: #7a0874; font-weight: bold;">(</span> <span style="color: #ff0000;">"10.41.233.1/24"</span> <span style="color: #7a0874; font-weight: bold;">)</span></pre>
<ul>
<li>/etc/xen/scripts/network-custom</li>
</ul>
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">dir=</span>$<span style="color: #7a0874; font-weight: bold;">(</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">"$0"</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #ff0000;">"$dir/network-route"</span> <span style="color: #ff0000;">"$@"</span> <span style="color: #007800;">netdev=</span>eth0
<span style="color: #ff0000;">"$dir/network-bridge"</span> <span style="color: #ff0000;">"$@"</span> <span style="color: #007800;">netdev=</span>dummy0 <span style="color: #007800;">bridge=</span>private</pre>
<ul>
<li>/etc/xen/scripts/vif-custom</li>
</ul>
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">dir=</span>$<span style="color: #7a0874; font-weight: bold;">(</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">"$0"</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #007800;">IFNUM=</span>$<span style="color: #7a0874; font-weight: bold;">(</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>vif<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> -d. -f2<span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">[</span> <span style="color: #ff0000;">"$IFNUM"</span> = <span style="color: #ff0000;">"0"</span> <span style="color: #7a0874; font-weight: bold;">]</span> ; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #808080; font-style: italic;"># Interface 0 = public lan</span>
<span style="color: #ff0000;">"$dir/vif-route"</span> <span style="color: #ff0000;">"$@"</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #808080; font-style: italic;"># Sinon private lan</span>
<span style="color: #ff0000;">"$dir/vif-bridge"</span> <span style="color: #ff0000;">"$@"</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre>
<ul>
<li>/etc/xen/xend-config.sxp</li>
</ul>
<p><em><strong>On commente l'ensemble des autres scripts réseaux (bridge, route, nat)</strong></em></p>
<pre class="bash"><span style="color: #7a0874; font-weight: bold;">(</span>network-script network-custom<span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #7a0874; font-weight: bold;">(</span>vif-script vif-custom<span style="color: #7a0874; font-weight: bold;">)</span></pre>
<p>On relance xend</p>
<pre class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>xend restart</pre>
<p>A ce stade vous devriez avoir une interface nommée private disposant de l'IP privée assignée.</p>
<pre class="bash"><span style="color: #000000;">15</span>: private: <span style="color: #000000; font-weight: bold;"><</span>BROADCAST,MULTICAST,UP,LOWER_UP<span style="color: #000000; font-weight: bold;">></span> mtu <span style="color: #000000;">1500</span> qdisc noqueue state UNKNOWN
<span style="color: #c20cb9; font-weight: bold;">link</span><span style="color: #000000; font-weight: bold;">/</span>ether <span style="color: #000000;">16</span>:c7:<span style="color: #000000;">56</span>:f6:4d:3c brd ff:ff:ff:ff:ff:ff
inet <span style="color: #000000;">10.41</span><span style="color: #000000;">.233</span><span style="color: #000000;">.1</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> brd <span style="color: #000000;">10.41</span><span style="color: #000000;">.233</span><span style="color: #000000;">.255</span> scope global private
inet6 fe80::14c7:56ff:fef6:4d3c<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">64</span> scope <span style="color: #c20cb9; font-weight: bold;">link</span>
valid_lft forever preferred_lft forever</pre>
<p>Il vous suffit à présent d'adopter cette configuration sur vos <strong><a href="http://wiki.xen.org/xenwiki/DomU" hreflang="en">DomU</a></strong>.</p>
<pre class="bash">vif = <span style="color: #7a0874; font-weight: bold;">[</span> <span style="color: #ff0000;">'mac=XX:XX:XX:XX:XX:XX, ip=78.41.233.XXX'</span>, <span style="color: #ff0000;">'mac=XX:XX:XX:XX:XX:XX, ip=10.41.233.XXX, bridge=private'</span> <span style="color: #7a0874; font-weight: bold;">]</span></pre>
<p><br />
<ins>Liens utiles :</ins>
<br />
- <a href="http://wiki.xensource.com/xenwiki/XenNetworkingExamples" hreflang="en">Xen Networking Examples</a></p>
Système de fichier distribué Glusterfs - volume en striping
urn:md5:94ad073509d38f57ac0b7cfdf6e301f8
2011-12-01T12:00:00+01:00
2011-12-01T12:00:00+01:00
Mohamed YACOUBI
Glusterfs
cluster
emerge
Gentoo
gluster
glusterfs
infogérance
linux
<p><img src="https://blog.yacoubi.fr/public/Logo/Gluster.png" alt="gluster_logo" style="display:block; margin:0 auto;" title="gluster_logo, avr. 2011" />
<br />
<br />
La suite des tests gluster, nous attaquons la mise en place d'un volume en striping.
<br />
Les serveurs de fichiers dispose d'une partition de 10Go qui sera exporté.</p>
<pre class="bash">filer<span style="color: #000000;">-1</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #808080; font-style: italic;"># df -h</span>
Filesystem Size Used Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000;">9</span>.9G <span style="color: #000000;">1</span>.4G <span style="color: #000000;">8</span>.0G <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>
udev 10M 116K <span style="color: #000000;">9</span>.9M <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev
shm 249M <span style="color: #000000;">0</span> 249M <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm</pre>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># df -h</span>
Filesystem Size Used Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000;">9</span>.9G <span style="color: #000000;">1</span>.4G <span style="color: #000000;">8</span>.0G <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>
udev 10M 116K <span style="color: #000000;">9</span>.9M <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev
shm 249M <span style="color: #000000;">0</span> 249M <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm</pre>
<p><br /></p>
<h3><ins> Configuration de base : </ins></h3>
<p><br />
Il faut dans un premier temps le pool de confiance si ce dernier n'existe pas.
<br />
La procédure est décrite dans l'article <a href="https://blog.yacoubi.fr/index.php?post/2011/06/29/Systeme-de-fichier-replique-Glusterfs-replication-distribue">volume répliqué et distribué</a></p>
<p><br /></p>
<h3><ins> Configuration d'un volume en striping : </ins></h3>
<p><br />
Nous allons créer le volume stripé sur 2 serveurs de stockage, le but étant d' aggreger l'espace de stockage (Raid-0).</p>
<ul>
<li>La création du volume est extrêmement simple :</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># gluster volume create test-volume stripe 2 transport tcp filer-1:/mnt filer-2:/mnt</span>
Creation of volume test-volume has been successful. Please start the volume to access data.</pre>
<ul>
<li>On vérifie le volume</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># gluster volume info</span>
Volume Name: test-volume
Type: Stripe
Status: Created
Number of Bricks: <span style="color: #000000;">2</span>
Transport-<span style="color: #7a0874; font-weight: bold;">type</span>: tcp
Bricks:
Brick1: filer<span style="color: #000000;">-1</span>:<span style="color: #000000; font-weight: bold;">/</span>mnt
Brick2: filer<span style="color: #000000;">-2</span>:<span style="color: #000000; font-weight: bold;">/</span>mnt</pre>
<ul>
<li>A présent on démarre le volume</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># gluster volume start test-volume</span></pre>
<ul>
<li>On monte le volume depuis les clients</li>
</ul>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># mount -t glusterfs filer-1:7997:/test-volume /glusterfs</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># df -h</span>
Filesystem Size Used Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000;">7</span>.9G <span style="color: #000000;">1</span>.6G <span style="color: #000000;">6</span>.0G <span style="color: #000000;">22</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>
udev 10M 112K <span style="color: #000000;">9</span>.9M <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev
shm 249M <span style="color: #000000;">0</span> 249M <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm
filer<span style="color: #000000;">-1</span>:<span style="color: #000000; font-weight: bold;">/</span>test-volume 20G <span style="color: #000000;">2</span>.8G 16G <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>glusterfs</pre>
<p>Nous disposons bien d'un volume strippé.</p>
<h3><ins> Test divers : </ins></h3>
<ul>
<li>Test en ecriture.</li>
</ul>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># for i in `seq 0 2`; do dd if=/dev/zero of=/glusterfs/wap$i.img bs=300M count=1; done</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># du -h /glusterfs/*</span>
301M <span style="color: #000000; font-weight: bold;">/</span>glusterfs<span style="color: #000000; font-weight: bold;">/</span>wap0.img
301M <span style="color: #000000; font-weight: bold;">/</span>glusterfs<span style="color: #000000; font-weight: bold;">/</span>wap1.img
301M <span style="color: #000000; font-weight: bold;">/</span>glusterfs<span style="color: #000000; font-weight: bold;">/</span>wap2.img</pre>
<pre class="bash">filer<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># du -h /mnt/*</span>
151M <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>wap0.img
151M <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>wap1.img
151M <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>wap2.img</pre>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># du -h /mnt/* </span>
151M <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>wap0.img
151M <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>wap1.img
151M <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>wap2.img</pre>
<ul>
<li>Voyons comment réagi le volume en cas de panne sur l'un des filer.</li>
</ul>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># echo 'abcdefghij' > /glusterfs/test</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs</span>
total <span style="color: #000000;">8</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">11</span> Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">38</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre>
<pre class="bash">filer<span style="color: #000000;">-1</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #808080; font-style: italic;"># ls -l /mnt/</span>
total <span style="color: #000000;">8</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">11</span> Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">38</span> <span style="color: #7a0874; font-weight: bold;">test</span>
filer<span style="color: #000000;">-1</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #808080; font-style: italic;"># cat /mnt/test </span>
abcdefghij
filer<span style="color: #000000;">-1</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #808080; font-style: italic;">#</span></pre>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /mnt/</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">38</span> <span style="color: #7a0874; font-weight: bold;">test</span>
filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># cat /mnt/test </span>
filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;">#</span></pre>
<ul>
<li>Simulation de panne sur filer-2</li>
</ul>
<p>On désactive le filer-2</p>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># halt</span>
Broadcast message from root <span style="color: #7a0874; font-weight: bold;">(</span>pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>Sat Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">40</span>:<span style="color: #000000;">50</span> <span style="color: #000000;">2011</span><span style="color: #7a0874; font-weight: bold;">)</span>:
The system is going down <span style="color: #000000; font-weight: bold;">for</span> system halt NOW<span style="color: #000000; font-weight: bold;">!</span></pre>
<p>On écrit sur le point de montage depuis le client</p>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># rm /glusterfs/test </span>
<span style="color: #c20cb9; font-weight: bold;">rm</span>: cannot remove `<span style="color: #000000; font-weight: bold;">/</span>glusterfs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #ff0000;">': Transport endpoint is not connected
client-1 ~ # cat /glusterfs/test
cat: /glusterfs/test: Transport endpoint is not connected
client-1 ~ # touch /glusterfs/test2
touch: cannot touch `/glusterfs/test2'</span>: Input<span style="color: #000000; font-weight: bold;">/</span>output error</pre>
<p>On réactive filer-2 et on vérifie que tout est ok.</p>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /mnt/</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">38</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre>
<p>On écrit sur le point de montage depuis le client</p>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># touch /glusterfs/test3</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs</span>
total <span style="color: #000000;">12</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">11</span> Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">38</span> <span style="color: #7a0874; font-weight: bold;">test</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">44</span> test3</pre>
<ul>
<li>Simulation de panne sur filer-1</li>
</ul>
<p>On eteint filer-1</p>
<pre class="bash">filer<span style="color: #000000;">-1</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #808080; font-style: italic;"># halt</span>
Broadcast message from root <span style="color: #7a0874; font-weight: bold;">(</span>pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>Sat Nov <span style="color: #000000;">12</span> <span style="color: #000000;">00</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">43</span> <span style="color: #000000;">2011</span><span style="color: #7a0874; font-weight: bold;">)</span>:
The system is going down <span style="color: #000000; font-weight: bold;">for</span> system halt NOW<span style="color: #000000; font-weight: bold;">!</span></pre>
<p>On effectue un accès depuis client-1</p>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs/</span>
<span style="color: #c20cb9; font-weight: bold;">ls</span>: cannot access <span style="color: #000000; font-weight: bold;">/</span>glusterfs<span style="color: #000000; font-weight: bold;">/</span>: Transport endpoint is not connected</pre>
<p><br /></p>
<p>Les fichiers sont stockés à 50% sur chacun des filers et les en cas de panne les conséquences sont catastrophique.
<br />
Le benchmark devrait être intéressant :)</p>
Euro-Web devient Hegerys
urn:md5:8fb66b1498cdf2db742b110b9e0572ff
2011-11-30T18:04:00+01:00
2012-04-25T20:21:50+02:00
Mohamed YACOUBI
Divers
baie
cluster
datacenter
euro-web
hegerys
housing
housing baie
housing baie datacenter
infogérance
location baie equinix
location serveur dédié
location serveur dédié infogéré
sd-france
sdfrance
<p><q><strong>Sous le giron du groupe <a href="http://www.magic.fr/" hreflang="fr" title="Magic Online">Magic OnLine</a>, <a href="http://fr.euro-web.com/" title="Euro-Web">Euro-Web</a> devient <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a>.</strong></q>
<br />
<ins>Communiqué de presse du 30 Novembre 2011 :</ins>
<br />
<br />
Bonjour,
<br />
<br />
Le 4 juillet 2011 dernier, nous vous annoncions la fusion d'<a href="http://fr.euro-web.com/" title="Euro-Web">Euro-Web</a> avec l'activité hébergement de <a href="http://www.magic.fr/" hreflang="fr" title="Magic Online">Magic OnLine</a>, avec pour principal objectif d'accroître notre R&D afin de vous proposer de nouveaux services, tout en continuant à vous apporter des réponses rationnelles et économiques à vos besoins.
<br />
<br />
Quatre mois plus tard, nous avons le plaisir de vous annoncer la naissance de <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a> : une nouvelle entité qui regroupe les deux activités d'hébergement du groupe <a href="http://www.magic.fr/" hreflang="fr" title="Magic Online">Magic OnLine</a>.
<br />
<br />
Cette nouvelle marque positionnera <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a> comme un « pure player » de l'hébergement à valeur ajoutée opérant près de 4000 serveurs dans 5 datacenters et un réseau IP de 10 Gb/s.
<br />
<br />
<ins>Sur le plan opérationnel :</ins>
<br />
<br />
<a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a> est dirigé par les fondateurs d'<a href="http://fr.euro-web.com/" title="Euro-Web">Euro-Web</a> et vos interlocuteurs techniques habituels restent bien évidemment les mêmes.
<br />
Le site internet d'<a href="http://fr.euro-web.com/" title="Euro-Web">Euro-Web</a> sera transféré dans les jours qui viennent sur <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">http://www.hegerys.com</a>.
<br />
Votre espace client et vos identifiants clients sont inchangés : <a href="http://www.hegerys.com/clients/login.php5" hreflang="fr" title="Hegerys">http://www.hegerys.com/clients/login.php5</a>
<br />
Notre numéro de téléphone reste identique et vous pouvez continuer à nous contacter au 01.75.43.75.75.
<br />
Nos adresses emails restent identiques et seront transférées progressivement sur <a href="http://www.hegerys.com" hreflang="fr" title="hegerys.com">hegerys.com</a>.
<br />
Comme vous le verrez à la visite du site <a href="http://www.hegerys.com" hreflang="fr" title="http://www.hegerys.com">http://www.hegerys.com</a>, des nouveaux services viennent de voir le jour :
<br />
<br />
Cloud Hyper-V
<br />
Cloud VMWare
<br />
Cloud privé
<br />
Services Saas
<br />
Sécurité et Firewall
<br />
<br />
Toutes nos équipes se tiennent à votre disposition pour tout renseignement complémentaire.
<br />
<br />
Cordialement,
<br />
L'équipe <a href="http://www.hegerys.com" hreflang="fr" title="Hegerys">Hegerys</a>.</p>
Système de fichier distribué Glusterfs - Benchmark replication distribuée
urn:md5:3a1718661b20f7ed477f0ee2fb9186d5
2011-11-11T22:26:00+01:00
2012-01-02T16:54:23+01:00
Mohamed YACOUBI
Glusterfs
cluster
emerge
Gentoo
gluster
glusterfs
infogérance
linux
<p><img src="https://blog.yacoubi.fr/public/Logo/Gluster.png" alt="gluster_logo" style="display:block; margin:0 auto;" title="gluster_logo, avr. 2011" />
<br />
<br />
Après la publication de <a href="https://blog.yacoubi.fr/index.php?post/2011/06/29/Systeme-de-fichier-replique-Glusterfs-replication-distribue">la réplication distribuée</a>, voici les premiers benchmarks.
<br />
<br />
<ins>Le protocole de test est le suivant :</ins></p>
<ul>
<li>Serveurs : Intel Core2 Quad Q9550 - 512Mo de RAM</li>
<li>Outil : <a href="http://www.iozone.org/" hreflang="en" title="fileop">fileop</a></li>
<li>Pas d'optimisation particulère</li>
<li>Création d'une arborescence de fichier de 4K (création de 20 répertoires contenant 20 répertoires contenant un fichier de 4K)</li>
<li>Création d'une arborescence de fichier de 40M (création de 6 répertoires contenant 6 répertoires contenant un fichier de 40M)</li>
<li>Comparatif : Écriture en local, via gluster puis NFS</li>
</ul>
<p><br /></p>
<h3><ins>1) Génération de l'arborescence 4K: </ins></h3>
<h4><ins> Test en local : </ins></h4>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># time ./fileop -d /glusterfs_local/ -f 20 -s 4k -e</span>
. <span style="color: #c20cb9; font-weight: bold;">mkdir</span> chdir <span style="color: #c20cb9; font-weight: bold;">rmdir</span> create open <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">write</span> close <span style="color: #c20cb9; font-weight: bold;">stat</span> access <span style="color: #c20cb9; font-weight: bold;">chmod</span> readdir <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">unlink</span> delete Total_files
A <span style="color: #000000;">20</span> <span style="color: #000000;">23960</span> <span style="color: #000000;">381779</span> <span style="color: #000000;">98668</span> <span style="color: #000000;">16779</span> <span style="color: #000000;">442536</span> <span style="color: #000000;">63848</span> <span style="color: #000000;">63694</span> <span style="color: #000000;">389805</span> <span style="color: #000000;">555721</span> <span style="color: #000000;">490175</span> <span style="color: #000000;">369310</span> <span style="color: #000000;">70380</span> <span style="color: #000000;">178352</span> <span style="color: #000000;">241133</span> <span style="color: #000000;">94628</span> <span style="color: #000000;">8000</span>
real 0m54.757s
user 0m0.203s
sys 0m0.520s</pre>
<h4><ins> Test via le protocole NFS : </ins></h4>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># mount | grep /glusterfs_nfs</span>
<span style="color: #000000;">78.41</span>.XXX.XXX:<span style="color: #000000; font-weight: bold;">/</span>nfs on <span style="color: #000000; font-weight: bold;">/</span>glusterfs_nfs <span style="color: #7a0874; font-weight: bold;">type</span> nfs <span style="color: #7a0874; font-weight: bold;">(</span>rw,noatime,<span style="color: #007800;">addr=</span><span style="color: #000000;">78.41</span>.XXX.XXX<span style="color: #7a0874; font-weight: bold;">)</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># time ./fileop -d /glusterfs_nfs/ -f 20 -s 4k -e</span>
. <span style="color: #c20cb9; font-weight: bold;">mkdir</span> chdir <span style="color: #c20cb9; font-weight: bold;">rmdir</span> create open <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">write</span> close <span style="color: #c20cb9; font-weight: bold;">stat</span> access <span style="color: #c20cb9; font-weight: bold;">chmod</span> readdir <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">unlink</span> delete Total_files
A <span style="color: #000000;">20</span> <span style="color: #000000;">190</span> <span style="color: #000000;">25031</span> <span style="color: #000000;">273</span> <span style="color: #000000;">154</span> <span style="color: #000000;">6418</span> <span style="color: #000000;">62354</span> <span style="color: #000000;">163237</span> <span style="color: #000000;">266426</span> <span style="color: #000000;">12863</span> <span style="color: #000000;">394146</span> <span style="color: #000000;">4618</span> <span style="color: #000000;">6265</span> <span style="color: #000000;">1347</span> <span style="color: #000000;">313</span> <span style="color: #000000;">302</span> <span style="color: #000000;">8000</span>
real 4m33.915s
user 0m0.030s
sys 0m0.080s</pre>
<h4><ins> Test via le protocole Gluster : </ins></h4>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># mount | grep '/glusterfs'</span>
filer<span style="color: #000000;">-1</span>:<span style="color: #000000; font-weight: bold;">/</span>test-volume on <span style="color: #000000; font-weight: bold;">/</span>glusterfs <span style="color: #7a0874; font-weight: bold;">type</span> fuse.glusterfs <span style="color: #7a0874; font-weight: bold;">(</span>rw,allow_other,default_permissions,<span style="color: #007800;">max_read=</span><span style="color: #000000;">131072</span><span style="color: #7a0874; font-weight: bold;">)</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># time ./fileop -d /glusterfs/ -f 20 -s 4k -e</span>
. <span style="color: #c20cb9; font-weight: bold;">mkdir</span> chdir <span style="color: #c20cb9; font-weight: bold;">rmdir</span> create open <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">write</span> close <span style="color: #c20cb9; font-weight: bold;">stat</span> access <span style="color: #c20cb9; font-weight: bold;">chmod</span> readdir <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">unlink</span> delete Total_files
A <span style="color: #000000;">20</span> <span style="color: #000000;">1362</span> <span style="color: #000000;">3371</span> <span style="color: #000000;">2398</span> <span style="color: #000000;">835</span> <span style="color: #000000;">2462</span> <span style="color: #000000;">3411</span> <span style="color: #000000;">16958</span> <span style="color: #000000;">6960</span> <span style="color: #000000;">2785</span> <span style="color: #000000;">4124</span> <span style="color: #000000;">1545</span> <span style="color: #000000;">2840</span> <span style="color: #000000;">945</span> <span style="color: #000000;">1232</span> <span style="color: #000000;">1188</span> <span style="color: #000000;">8000</span>
real 1m59.461s
user 0m0.023s
sys 0m0.523s</pre>
<p><br />
<br /></p>
<h3><ins>2) Génération de l'arborescence 40M : </ins></h3>
<h4><ins> Test local : </ins></h4>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># time ./fileop -d /mnt/ -f 6 -s 40M -e</span>
. <span style="color: #c20cb9; font-weight: bold;">mkdir</span> chdir <span style="color: #c20cb9; font-weight: bold;">rmdir</span> create open <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">write</span> close <span style="color: #c20cb9; font-weight: bold;">stat</span> access <span style="color: #c20cb9; font-weight: bold;">chmod</span> readdir <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">unlink</span> delete Total_files
A <span style="color: #000000;">6</span> <span style="color: #000000;">71305</span> <span style="color: #000000;">403178</span> <span style="color: #000000;">105082</span> <span style="color: #000000;">15906</span> <span style="color: #000000;">113915</span> <span style="color: #000000;">1</span> <span style="color: #000000;">14</span> <span style="color: #000000;">104410</span> <span style="color: #000000;">520373</span> <span style="color: #000000;">510405</span> <span style="color: #000000;">367981</span> <span style="color: #000000;">169848</span> <span style="color: #000000;">202678</span> <span style="color: #000000;">295200</span> <span style="color: #000000;">875</span> <span style="color: #000000;">216</span>
real 7m44.478s
user 0m27.758s
sys 0m15.576s</pre>
<h4><ins> Test via le protocole NFS : </ins></h4>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># mount | grep /glusterfs_nfs</span>
<span style="color: #000000;">78.41</span>.XXX.XXX:<span style="color: #000000; font-weight: bold;">/</span>nfs on <span style="color: #000000; font-weight: bold;">/</span>glusterfs_nfs <span style="color: #7a0874; font-weight: bold;">type</span> nfs <span style="color: #7a0874; font-weight: bold;">(</span>rw,noatime,<span style="color: #007800;">addr=</span><span style="color: #000000;">78.41</span>.XXX.XXX<span style="color: #7a0874; font-weight: bold;">)</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># time ./fileop -d /glusterfs_nfs/ -f 6 -s 40M -e</span>
. <span style="color: #c20cb9; font-weight: bold;">mkdir</span> chdir <span style="color: #c20cb9; font-weight: bold;">rmdir</span> create open <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">write</span> close <span style="color: #c20cb9; font-weight: bold;">stat</span> access <span style="color: #c20cb9; font-weight: bold;">chmod</span> readdir <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">unlink</span> delete Total_files
A <span style="color: #000000;">6</span> <span style="color: #000000;">306</span> <span style="color: #000000;">153298</span> <span style="color: #000000;">642</span> <span style="color: #000000;">45</span> <span style="color: #000000;">3070</span> <span style="color: #000000;">1</span> <span style="color: #000000;">26</span> <span style="color: #000000;">90751</span> <span style="color: #000000;">11435</span> <span style="color: #000000;">13304</span> <span style="color: #000000;">2221</span> <span style="color: #000000;">8485</span> <span style="color: #000000;">5251</span> <span style="color: #000000;">3831</span> <span style="color: #000000;">639</span> <span style="color: #000000;">216</span>
real 7m23.497s
user 0m28.012s
sys 0m16.809s</pre>
<h4><ins> Test via le protocole Gluster : </ins></h4>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># mount | grep '/glusterfs'</span>
filer<span style="color: #000000;">-1</span>:<span style="color: #000000; font-weight: bold;">/</span>test-volume on <span style="color: #000000; font-weight: bold;">/</span>glusterfs <span style="color: #7a0874; font-weight: bold;">type</span> fuse.glusterfs <span style="color: #7a0874; font-weight: bold;">(</span>rw,allow_other,default_permissions,<span style="color: #007800;">max_read=</span><span style="color: #000000;">131072</span><span style="color: #7a0874; font-weight: bold;">)</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># time ./fileop -d /glusterfs -f 6 -s 40M -e</span>
. <span style="color: #c20cb9; font-weight: bold;">mkdir</span> chdir <span style="color: #c20cb9; font-weight: bold;">rmdir</span> create open <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">write</span> close <span style="color: #c20cb9; font-weight: bold;">stat</span> access <span style="color: #c20cb9; font-weight: bold;">chmod</span> readdir <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">unlink</span> delete Total_files
A <span style="color: #000000;">6</span> <span style="color: #000000;">1528</span> <span style="color: #000000;">357139</span> <span style="color: #000000;">2713</span> <span style="color: #000000;">26</span> <span style="color: #000000;">806</span> <span style="color: #000000;">1</span> <span style="color: #000000;">2</span> <span style="color: #000000;">2558</span> <span style="color: #000000;">4536</span> <span style="color: #000000;">3942</span> <span style="color: #000000;">2533</span> <span style="color: #000000;">4365</span> <span style="color: #000000;">1259</span> <span style="color: #000000;">1870</span> <span style="color: #000000;">424</span> <span style="color: #000000;">216</span>
real 17m1.170s
user 0m27.895s
sys 0m8.719s</pre>
Système de fichier distribué Glusterfs - volume répliqué et distribué
urn:md5:b25e1a8d7709817e5c36a4647686b49c
2011-06-29T19:19:00+02:00
2011-11-11T23:55:38+01:00
Mohamed YACOUBI
Glusterfs
cluster
emerge
Gentoo
gluster
glusterfs
infogérance
linux
<p><img src="https://blog.yacoubi.fr/public/Logo/Gluster.png" alt="gluster_logo" style="display:block; margin:0 auto;" title="gluster_logo, avr. 2011" />
<br />
<br />
Après quelques temps d'absence je reprend les différents tests gluster, nous attaquons par la mise en place d'un volume répliqué distribué.
Je passerais volontairement la mise en place du volume répliqué simple car ne présentant aucun intérêt pour mes besoins.
<br /></p>
<h3><ins> Configuration de base : </ins></h3>
<p><br />
Nous allons créer dans un premier temps le pool de confiance.
Lorsque vous démarrez le premier serveur, le pool de confiance se compose de ce serveur seul, il vous suffira alors d'ajouter depuis ce serveur le 2nd serveur de stockage puis depuis des serveurs déjà présent dans le pool d'ajouter les serveurs suivants afin de les autoriser à interagir entre eux.</p>
<pre class="bash">filer<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># gluster peer probe filer-2</span>
Probe successful
filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># gluster peer probe filer-1</span>
Probe successful</pre>
<p><br /></p>
<h3><ins> Configuration d'un volume répliqué et distribué : </ins></h3>
<p><br />
Nous allons commencer par le plus simple à savoir un volume répliqué et distribué sur 2 serveurs de stockage, le but étant d'avoir du master/master (Raid-1).</p>
<ul>
<li>La création du volume est extrêmement simple :</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># gluster volume create test-volume replica 2 transport tcp filer-1:/mnt filer-2:/mnt</span>
Creation of volume test-volume has been successful. Please start the volume to access data.</pre>
<ul>
<li>On vérifie le volume</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># gluster volume info</span>
Volume Name: test-volume
Type: Replicate
Status: Created
Number of Bricks: <span style="color: #000000;">2</span>
Transport-<span style="color: #7a0874; font-weight: bold;">type</span>: tcp
Bricks:
Brick1: filer<span style="color: #000000;">-1</span>:<span style="color: #000000; font-weight: bold;">/</span>mnt
Brick2: filer<span style="color: #000000;">-2</span>:<span style="color: #000000; font-weight: bold;">/</span>mnt</pre>
<ul>
<li>A présent on démarre le volume</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># gluster volume start test-volume</span></pre>
<ul>
<li>On monte le volume depuis les clients</li>
</ul>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># mount -t glusterfs filer-1:7997:/test-volume /glusterfs</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># df -h</span>
Filesystem Size Used Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000;">7</span>.9G <span style="color: #000000;">1</span>.3G <span style="color: #000000;">6</span>.3G <span style="color: #000000;">17</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>
udev 10M 112K <span style="color: #000000;">9</span>.9M <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev
shm 249M <span style="color: #000000;">0</span> 249M <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm
filer<span style="color: #000000;">-1</span>:<span style="color: #000000; font-weight: bold;">/</span>test-volume <span style="color: #000000;">9</span>.9G <span style="color: #000000;">1</span>.4G <span style="color: #000000;">8</span>.1G <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>glusterfs</pre>
<h3><ins> Test divers : </ins></h3>
<ul>
<li>On vérifie que le volume est bien redondant</li>
</ul>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># touch /glusterfs/test</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs/</span>
total <span style="color: #000000;">0</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">8</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">39</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre>
<pre class="bash">filer<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /mnt/</span>
total <span style="color: #000000;">0</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">8</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">39</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /mnt/</span>
total <span style="color: #000000;">0</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">8</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">39</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre>
<ul>
<li>Simulation de panne sur filer-2</li>
</ul>
<p>On désactive le filer-2</p>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># halt</span>
Broadcast message from root <span style="color: #7a0874; font-weight: bold;">(</span>pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>Tue Mar <span style="color: #000000;">8</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">57</span>:<span style="color: #000000;">52</span> <span style="color: #000000;">2011</span><span style="color: #7a0874; font-weight: bold;">)</span>:
The system is going down <span style="color: #000000; font-weight: bold;">for</span> system halt NOW<span style="color: #000000; font-weight: bold;">!</span></pre>
<p>On écrit sur le point de montage depuis le client</p>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># rm /glusterfs/test </span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># touch /glusterfs/test_2</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs/</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">8</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">43</span> test_2</pre>
<p>On verifie que tout est ok sur le filer-1</p>
<pre class="bash">filer<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls /mnt/ -l</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">8</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">43</span> test_2</pre>
<p>On réactive filer-2 et on vérifie que tout est ok, malheureusement, tant qu'aucun accès n'aura été fait depuis le client, la reconstruction du volume ne sera pas effectué.</p>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /mnt/</span>
total <span style="color: #000000;">0</span></pre>
<p>On effectue un accès depuis le client via un simple <q>ls</q> et on revérifie.</p>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># ls /mnt/ -l</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">8</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">43</span> test_2</pre>
<ul>
<li>Simulation de panne sur filer-1</li>
</ul>
<p>On eteint filer-1</p>
<p>On écrit sur le point de montage depuis le client</p>
<pre class="bash">client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># rm /glusterfs/test_2</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># touch /glusterfs/test_3</span>
client<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs/</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">9</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">17</span> test_3</pre>
<p>On effectue un accès depuis client-1 et on vérifie filer-1</p>
<pre class="bash">filer<span style="color: #000000;">-1</span> ~ <span style="color: #808080; font-style: italic;"># ls -l /glusterfs/</span>
total <span style="color: #000000;">4</span>
-rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">0</span> Mar <span style="color: #000000;">9</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">17</span> test_3</pre>
<p><br />
On constate que le fait de monter filer-1 ne pose aucun problème en cas de panne de ce dernier, il serait donc plus juste de dire que nous avons monté le pool de confiance. :)</p>
<p>La prochaine étape un benchmark des performances ...</p>
World IPv6 Day, on y est !
urn:md5:392015ed1deec951bfc870e5df0b5cee
2011-06-08T12:00:00+02:00
2011-06-08T14:43:36+02:00
Mohamed YACOUBI
Divers
ipv6
migration
<p><img src="https://blog.yacoubi.fr/public/Logo/isoc_logo.gif" alt="Internet_Society" style="margin: 0 auto; display: block;" title="Internet_Society, janv. 2011" />
<br />
<br />
Suite à mon précédent billet <a href="https://blog.yacoubi.fr/index.php?post/2011/01/18/World-IPv6-Day-le-8-Juin-2011">World IPv6 Day le 8 Juin 2011</a>, j'ai le plaisir de vous informer que mon blog est disponible en IPv6 depuis le début du mois. (2001:758:1106::1)</p>
<ins>Pour rappel (de nouveau) et je cite </ins><a style="text-decoration: underline;" href="http://isoc.org/wp/worldipv6day/" hreflang="en">Internet Society</a><ins>: </ins>
<p><br />
« Le 8 Juin 2011, <a href="http://www.google.com" hreflang="en">Google</a>, <a href="http://www.facebook.com" hreflang="en">Facebook</a>, <a href="http://www.yahoo.com" hreflang="en">Yahoo!</a>, <a href="http://www.akamai.com" hreflang="en">Akamai</a>, <a href="http://www.limelightnetworks.com" hreflang="en">Limelight Networks</a> feront partie des principales organisations qui offriront leur contenu sur <a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a> pour un test de 24 heures. L'objectif de cette journée est de motiver les organisations de toute l'industrie, les fournisseurs de services Internet, les fabricants de matériel, les fournisseurs de systèmes d'exploitation et les entreprises du web, à préparer leurs services pour <a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a> afin d’assurer une transition réussie, alors que les adresses <a href="http://fr.wikipedia.org/wiki/IPv4" hreflang="fr">IPv4</a> s'épuisent. »
<br />
<br />
<ins>Liens :</ins></p>
<ul>
<li><a href="http://isoc.org/wp/worldipv6day/" hreflang="en">Internet Society</a></li>
<li><a href="http://www.pcinpact.com/actu/news/61424-ipv6-world-day-test-connexion-facebook-google-yahoo.htm" hreflang="fr">World IPv6 Day : un immense test grandeur nature le 8 juin</a></li>
</ul>
<br /><br />
Bon IPv6 Day à tous.<br />
Système de fichier distribué Glusterfs - accès client
urn:md5:41e2c80d0e537075ac978824e57df3e4
2011-04-14T20:54:00+02:00
2011-11-12T00:00:30+01:00
Mohamed YACOUBI
Glusterfs
cluster
emerge
Gentoo
gluster
glusterfs
infogérance
linux
<p><img src="https://blog.yacoubi.fr/public/Logo/Gluster.png" alt="gluster_logo" style="display:block; margin:0 auto;" title="gluster_logo, avr. 2011" />
<br />
<br />
Nous continuons notre série d'article <a href="https://blog.yacoubi.fr/index.php?post/2011/04/01/Systeme-de-fichier-distribue-Glusterfs">Gluster</a> en abordant les différentes possibilités d'accès client.
Exceptionnellement, aucun article supplémentaire sur Gluster n'est à prévoir pour le mois à venir.
<br />
<br />
Nous disposons de 2 possibilités pour accéder au système de fichier :</p>
<ul>
<li>Gluster Native Client :</li>
</ul>
<p><a href="https://blog.yacoubi.fr/public/gluster/gluster_client.jpg" title="gluster_client"><img src="https://blog.yacoubi.fr/public/gluster/.gluster_client_m.jpg" alt="gluster_client" style="display:block; margin:0 auto;" title="gluster_client, mar. 2011" /></a></p>
<p>Cette méthode est la plus recommandée, son utilisation permet des accès parallèles, le standard POSIX est alors utilisé. Il offre également les meilleures performances.</p>
<ul>
<li>Utilisation d'un protocole NFS ou CIFS :</li>
</ul>
<p><a href="https://blog.yacoubi.fr/public/gluster/gluster_others.jpg" title="gluster_other"><img src="https://blog.yacoubi.fr/public/gluster/.gluster_others_m.jpg" alt="gluster_other" style="display:block; margin:0 auto;" title="gluster_other, mar. 2011" /></a></p>
<p>1. Le client effectue la demande d'accès à un serveur jouant le rôle de répartiteur.
<br />
2. Le répartiteur va alors interroger l'un des noeud (nous l'appellerons noeud master dans l'exemple) du cluster.
<br />
3. Si l'information n'est pas contenu dans le noeud master, ce dernier va interroger le noeud disposant de la bonne information.
<br />
4. L'information est alors transmise au noeud master.
<br />
5. Le noeud master va alors transmettre l'information directement au client, attention si l'information est fragmenté sur plusieurs noeuds, le noeud master transmettra chaque bride d'informations au client qui s'occupera de les réagréger.</p>
Système de fichier distribué Glusterfs - Base
urn:md5:0c6a6416b879004f2db21882367c79ed
2011-04-06T23:05:00+02:00
2011-04-06T22:08:31+02:00
Mohamed YACOUBI
Glusterfs
cluster
emerge
Gentoo
gluster
glusterfs
infogérance
linux
<p><img src="https://blog.yacoubi.fr/public/Logo/Gluster.png" alt="gluster_logo" style="display:block; margin:0 auto;" title="gluster_logo, avr. 2011" />
<br />
<br />
Suite à mon article <a href="https://blog.yacoubi.fr/index.php?post/2011/04/01/Systeme-de-fichier-distribue-Glusterfs">précédent</a>, nous allons débuter par l'installation de <a href="http://www.gluster.org/" hreflang="en" title="Gluster">Gluster</a> sur <a href="http://www.gentoo.org" hreflang="en" title="gentoo">Gentoo</a>.
<br />
<br /></p>
<h3><ins> Pré-requis kernel : </ins></h3>
<pre class="bash">File systems ---<span style="color: #000000; font-weight: bold;">></span>
<span style="color: #7a0874; font-weight: bold;">[</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">]</span> FUSE <span style="color: #7a0874; font-weight: bold;">(</span>Filesystem <span style="color: #000000; font-weight: bold;">in</span> Userspace<span style="color: #7a0874; font-weight: bold;">)</span> support</pre>
<h3><ins> Préparation : </ins></h3>
<p><br /></p>
<ul>
<li>On s'assure que tout les /etc/hosts soient renseignés.</li>
</ul>
<p><br /></p>
<ul>
<li>On s'assure qu'aucune perte réseau n'existe entre chaque noeud <ins>et</ins> entre chaque client et noeud.</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># ping -c 10000 -f filer-1 2>&1 | grep '% packet loss'</span>
<span style="color: #000000;">10000</span> packets transmitted, <span style="color: #000000;">10000</span> received, <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> packet loss, <span style="color: #000000; font-weight: bold;">time</span> 869ms</pre>
<p><br /></p>
<h3><ins> Installation : </ins></h3>
<p><br /></p>
<ul>
<li>On installe glusterfs sur tout les noeuds et sur les clients.</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># USE="extras fuse" emerge -av glusterfs</span>
Calculating dependencies... <span style="color: #000000; font-weight: bold;">done</span><span style="color: #000000; font-weight: bold;">!</span>
<span style="color: #7a0874; font-weight: bold;">[</span>ebuild N <span style="color: #7a0874; font-weight: bold;">]</span> sys-fs<span style="color: #000000; font-weight: bold;">/</span>fuse<span style="color: #000000;">-2.8</span><span style="color: #000000;">.5</span> <span style="color: #000000;">492</span> kB
<span style="color: #7a0874; font-weight: bold;">[</span>ebuild N <span style="color: #7a0874; font-weight: bold;">]</span> sys-cluster<span style="color: #000000; font-weight: bold;">/</span>glusterfs<span style="color: #000000;">-3.1</span><span style="color: #000000;">.1</span> <span style="color: #007800;">USE=</span><span style="color: #ff0000;">"extras fuse -emacs (-infiniband) -static-libs -vim-syntax"</span> <span style="color: #000000;">2</span>,<span style="color: #000000;">024</span> kB</pre>
<ul>
<li>On lance glusterfs sur les différents noeuds et on l'ajoute au rc.</li>
</ul>
<pre class="bash">filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># /etc/init.d/glusterd start</span>
filer<span style="color: #000000;">-2</span> ~ <span style="color: #808080; font-style: italic;"># rc-update -a glusterd default</span></pre>
<p>Voila pour cette partie qui était la plus facile, les articles suivants seront plus intéressant et aborderons les différentes configurations possible.</p>
Système de fichier distribué Glusterfs
urn:md5:07da0759b472f52d95c2136a8fa8037d
2011-03-30T21:06:00+02:00
2011-04-14T19:44:02+02:00
Mohamed YACOUBI
Glusterfs
cluster
emerge
Gentoo
gluster
glusterfs
infogérance
linux
<p><img src="https://blog.yacoubi.fr/public/Logo/Gluster.png" alt="gluster_logo" style="display:block; margin:0 auto;" title="gluster_logo, avr. 2011" />
<br />
<br />
Je vais débuter une série d'article qui seront publiées chaque semaine sur la mise en place de <a href="http://www.gluster.org/" hreflang="en" title="Gluster">Gluster</a>.
<br />
<br />
<a href="http://www.gluster.org/" hreflang="en" title="Gluster">Gluster</a> est un logiciel libre de système de fichiers distribué en parallèle (scale-out), capable de monter jusqu'à plusieurs <a href="http://fr.wikipedia.org/wiki/Octet" hreflang="fr" title="pétaoctets">pétaoctets</a> et de gérer plusieurs milliers de clients.
<br />
<br />
<a href="http://www.gluster.org/" hreflang="en" title="Gluster">Gluster</a> est un système de fichiers de cluster/réseaux. <a href="http://www.gluster.org/" hreflang="en" title="Gluster">Gluster</a> est livré avec deux éléments, un serveur et un client.
<br />
<br />
Le serveur de stockage (ou chaque serveur d'un cluster) fait tourner <q>glusterfsd</q> et les clients utilisent la commande <q>mount</q> ou <q>glusterfs client</q> pour monter les systèmes de fichiers servis, en utilisant <a href="http://fuse.sourceforge.net/" hreflang="en" title="FUSE">FUSE</a>.
Les Serveurs sont déployés comme des <q>briques de stockage</q>, chaque serveur exécutant un daemon glusterfsd qui exporte un système de fichier local comme un «volume».
<br />
Le processus client glusterfs, se connecte aux serveurs avec un protocole spécifique (implémenté au-dessus de TCP/IP, InfiniBand ou SDP) et regroupe les volumes distants en un unique volume.
<br />
<br />
<a href="https://blog.yacoubi.fr/public/gluster/GlusterFS-New1.jpg" title="gluster"><img src="https://blog.yacoubi.fr/public/gluster/.GlusterFS-New1_m.jpg" alt="gluster" style="display:block; margin:0 auto;" title="gluster, avr. 2011" /></a>
<br /></p>
<h4>* Évolutivité et performance :</h4>
<p><br />
L'architecture scale-out permet d'agréger des ressources en fonction des besoins de capacité et de performance sans interruption.
<a href="http://www.gluster.org/" hreflang="en" title="Gluster">Gluster</a> permet également un rééquilibrer de la charge après ajout ou suppression des serveurs de données.
La fonction Gluster Elastic Hash supprime la nécessité d'un serveur de métadonnées et élimine donc un goulot d'étranglement au travers d'une réelle <q>parallélisation</q> des accès aux données. (équilibrage de charge)
<br /></p>
<h4>* Haute Disponibilité :</h4>
<p><br />
Les serveurs peuvent être géré en miroir de type RAID-1.
Après une panne matérielle, glusterfs reconstruira automatiquement en tache de fond le volume défaillant.
Glusterfs n'utilise pas un format propriétaire pour stocker des fichiers sur le disque des serveurs de données.
<br /></p>
<h4>* Gluster Elastic Hash :</h4>
<p><br />
Plutôt que d'utiliser un serveur de métadonnées, Glusterfs utilise un algorithme de hachage afin de localiser les données dans le pool de stockage. Tous les systèmes de stockage du pool ont donc la possibilité de connaître précisément l'emplacement de n'importe quelle données sans avoir besoin d'interroger un autre serveur du pool.
<br /></p>
<h4>* Gluster Manager Console :</h4>
<p><br />
<a href="http://europe.gluster.org/community/documentation/index.php/Gluster_3.1:_Exploring_the_Management_Console" hreflang="en" title="Gluster">Gluster</a> offre une interface web (Python, Ruby, PHP) avancée afin de permettre la gestion et l'automatisation des différents serveurs de données.</p>
Dell carte raid Perc H200/H700 et sas2ircu
urn:md5:1c577ecafe352dc04dda9fe7dbf324d2
2011-02-28T20:51:00+01:00
2011-02-28T21:22:41+01:00
Mohamed YACOUBI
Gentoo
emerge
Gentoo
infogérance
linux
location serveur dédié
location serveur dédié infogéré
portage
<p>Si vous louez et/ou possédez un serveur <a href="http://www.dell.com/" hreflang="en" title="Dell">Dell</a> R210/R310/R410 munie d'une <a href="http://fr.wikipedia.org/wiki/RAID_(informatique)" hreflang="fr" title="carte raid">carte raid</a> <a href="http://www.dell.com/" hreflang="en" title="Dell">Dell</a> Perc H200/H700, voici un petit <a href="http://devmanual.gentoo.org/ebuild-writing/" hreflang="en" title="ebuild">ebuild</a> (vous pouvez également télécharger manuellement le binaire) pour <a href="http://www.gentoo.org/" hreflang="en" title="Gentoo">Gentoo</a> afin de gérer la <a href="http://fr.wikipedia.org/wiki/RAID_(informatique)" hreflang="fr" title="carte raid">carte raid</a> depuis <a href="http://en.wikipedia.org/wiki/Linux" hreflang="en" title="linux">linux</a> (sas2ircu).
<br />
<br />
L'utilisation de cet <a href="http://devmanual.gentoo.org/ebuild-writing/" hreflang="en" title="ebuild">ebuild</a> ne nécessite pas le chargement de module dans le <a href="http://en.wikipedia.org/wiki/Linux_kernel" hreflang="en" title="kernel">kernel</a> contrairement aux autres utilitaires testés.
<br />
<br /></p>
<pre>
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-block/sas2ircu/sas2ircu-4.00.00.00.ebuild,v 0.1 2011/02/07 11:47:29 mohamed Exp $
DESCRIPTION="Dell SAS+SATA RAID controller Command Line Interface tool"
HOMEPAGE="http://www-947.ibm.com/support/entry/portal/docdisplay?brandind=5000008&lndocid=MIGR-5084955"
LICENSE="unknow"
SLOT="0"
KEYWORDS="-* amd64 x86 ~x86-fbsd"
IUSE=""
RESTRICT="strip"
DEPEND=""
RDEPEND=""
SRC_URI="http://blog.yacoubi.fr/public/portage/${PN}-${PV}.tar.bz2"
LICENSE_URL="http://www-947.ibm.com/support/entry/portal/docdisplay?brandind=5000008&lndocid=MIGR-5084955"
S="${WORKDIR}"
src_unpack() {
unpack ${PN}-${PV}.tar.bz2
}
supportedcards() {
elog "This binary supports should support ALL cards, including, but not"
elog "limited to the following series:"
elog ""
elog "DELL System Perk H200, H700"
elog "IBM System x3200 M2 (4367, 4368)"
elog "IBM System x3200 M3 (7327, 7328)"
elog "IBM System x3250 M2 (4190, 4191, 4194)"
elog "IBM System x3250 M3 (4251, 4252, 4261)"
elog "IBM System x3350 (4192, 4193)"
elog "IBM System x3400 (7973, 7974, 7975, 7976)"
elog "IBM System x3400 M2 (7836, 7837)"
elog "IBM System x3455 (7940, 7941)"
elog "IBM System x3500 (7977)"
elog "IBM System x3500 M2 (7839)"
elog "IBM System x3550 (7978, 1913)"
elog "IBM System x3550 M2 (7946, 4198)"
elog "IBM System x3650 (7979, 1914)"
elog "IBM System x3650 M2 (7947, 4199)"
elog "IBM System x3650 NAS (7979)"
elog "IBM System x3655 (7985, 7943)"
elog "IBM System x3755 (8877, 7163)"
elog "IBM System x3850 M2 (7141, 7144, 7233, 7234)"
elog "IBM System x3850 X5 (7145, 7146)"
elog "IBM System x3950 M2 (7141, 7233, 7234)"
elog "IBM System x3950 X5 (7145)"
}
src_install() {
into /usr/
dobin sas2ircu
}
</pre>
<p><br />
<br />
<ins>Patch :</ins> <a href="https://blog.yacoubi.fr/public/portage/sas2ircu-4.00.00.00.ebuild">sas2ircu-4.00.00.00.ebuild</a>
<br />
<ins>Binaire :</ins> <a href="https://blog.yacoubi.fr/public/portage/sas2ircu-4.00.00.00.tar.bz2">sas2ircu-4.00.00.00.tar.bz2</a></p>
World IPv6 Day le 8 Juin 2011
urn:md5:50eb04d7c2d3ec6bd31568dbd9a433c6
2011-01-18T19:09:00+01:00
2011-01-24T11:26:32+01:00
Mohamed YACOUBI
Divers
ipv6
migration
<p><img src="https://blog.yacoubi.fr/public/Logo/isoc_logo.gif" alt="Internet_Society" style="margin: 0 auto; display: block;" title="Internet_Society, janv. 2011" />
<br />
<br />
A l'occasion du World IPv6 Day qui se déroulera le 8 Juin 2011 et afin d'apporter ma très modeste contribution (je ne vais pas me comparer au géant <a href="http://www.google.com" hreflang="en">Google</a>, <a href="http://www.facebook.com" hreflang="en">Facebook</a>, <a href="http://www.yahoo.com" hreflang="en">Yahoo!</a>, <a href="http://www.akamai.com" hreflang="en">Akamai</a>, <a href="http://www.limelightnetworks.com" hreflang="en">Limelight Networks</a>) :
</p>
<h3><strong><center>Je m'engage à ce que ce blog soit accessible en <a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a> à la date prévue pour 24h au minimum<br /></center></strong></h3>
<p><br />
<ins>Pour rappel et je cite </ins><a style="text-decoration: underline;" href="http://isoc.org/wp/worldipv6day/" hreflang="en">Internet Society</a><ins>: </ins></p>
<p><br />
« Le 8 Juin 2011, <a href="http://www.google.com" hreflang="en">Google</a>, <a href="http://www.facebook.com" hreflang="en">Facebook</a>, <a href="http://www.yahoo.com" hreflang="en">Yahoo!</a>, <a href="http://www.akamai.com" hreflang="en">Akamai</a>, <a href="http://www.limelightnetworks.com" hreflang="en">Limelight Networks</a> feront partie des principales organisations qui offriront leur contenu sur <a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a> pour un test de 24 heures. L'objectif de cette journée est de motiver les organisations de toute l'industrie, les fournisseurs de services Internet, les fabricants de matériel, les fournisseurs de systèmes d'exploitation et les entreprises du web, à préparer leurs services pour <a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a> afin d’assurer une transition réussie, alors que les adresses <a href="http://fr.wikipedia.org/wiki/IPv4" hreflang="fr">IPv4</a> s'épuisent. »
<br />
<br />
<ins>Liens :</ins></p>
<ul>
<li><a href="http://isoc.org/wp/worldipv6day/" hreflang="en">Internet Society</a></li>
<li><a href="http://www.pcinpact.com/actu/news/61424-ipv6-world-day-test-connexion-facebook-google-yahoo.htm" hreflang="fr">World IPv6 Day : un immense test grandeur nature le 8 juin</a></li>
</ul>
Migration vers Prestashop et référencement
urn:md5:66e47e9a5a099b63bad74e75376fff4c
2011-01-08T10:55:00+01:00
2011-01-24T11:26:12+01:00
Mohamed YACOUBI
Prestashop
migration
prestashop
Redirection
referencement
<h2><img title="prestashop_logo, janv. 2011" style="margin: 0 auto; display: block;" alt="prestashop_logo" src="https://blog.yacoubi.fr/public/Logo/.logo_prestashop_s.jpg" /></h2>
<h2><ins>C’est quoi la conversion d’URL ?</ins></h2>
<p>Imaginez, vous migrez votre site <a href="http://www.oscommerce.com/" hreflang="en">OsCommerce</a> vers la plateforme <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a>.
<br />
<br />
<ins>Voici à quoi ressemble l’url du produit sous <a href="http://www.oscommerce.com/" hreflang="en">OsCommerce</a> :</ins></p>
<ul>
<li>http://www.monsite.com/Toyota-Yaris-p-123.html</li>
</ul>
<p><ins>Et maintenant, sur votre site sous <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a> :</ins></p>
<ul>
<li>http://www.monsite.com/123-Toyota-Yaris.html</li>
</ul>
<p>Et c’est là qu’intervient la conversion d’URL afin de permettre de ne pas perdre l’URL de l'ancienne page.</p>
<h2><ins>A quoi ça sert ?</ins></h2>
<p>Premièrement, vous l’aurez compris, cela permet de ne pas avoir de page <a href="http://fr.wikipedia.org/wiki/Liste_des_codes_HTTP" hreflang="fr">404</a> quand un visiteur arrive via une ancienne URL (google, ou bookmark par exemple).</p>
<p>Mais imaginez si vous n’aviez pas fait cela, les moteurs de recherches auraient donc dans leurs « index » des dizaines, centaines ou milliers de pages renvoyant vers une erreur <a href="http://fr.wikipedia.org/wiki/Liste_des_codes_HTTP" hreflang="fr">404</a>.
<br />
Hors d'après <a href="http://www.seroundtable.com/archives/021944.html" hreflang="en">JohnMu</a>, ingénieur chez Google les erreur <a href="http://fr.wikipedia.org/wiki/Liste_des_codes_HTTP" hreflang="fr">404</a> permettent aux moteurs de recherche de "nettoyer" leur index, c'est-à-dire de supprimer de leur base toutes les pages périmées, ce qui veut dire que vous allez devoir recommencer tout votre référencement à partir de zéro…</p>
<p>Il existe une technique pour pallier à ce problème, les redirections <a href="http://fr.wikipedia.org/wiki/Liste_des_codes_HTTP" hreflang="fr">301</a>.
<br />
Selon <a href="http://www.ietf.org/rfc/rfc2616.txt" hreflang="en">RFC2616</a>, les moteurs de recherche devraient remplacer automatiquement l’URL qui fait une redirection <a href="http://fr.wikipedia.org/wiki/Liste_des_codes_HTTP" hreflang="fr">301</a> par l’adresse destinataire de la redirection et ils devraient sauvegarder cette dernière comme adresse officielle du contenu concerné.
<br />
<ins>Exactement ce qu’il nous faut :</ins></p>
<ul>
<li>Car Google va comprendre cela, et va mettre à jour son « index ». Il va donc remplacer l’ancienne URL par la nouvelle, et le mieux dans tout cela, c’est qu’il va garder le « PageRank » de la page. Ce qui veut dire que votre page ne perdra pas ou peu de place sur Google lors d’une recherche.</li>
<li>Car à chaque fois qu’un visiteur utilisera l’ancienne adresse dans son navigateur (bookmark), le navigateur va automatiquement comprendre que l’url a changé et va donc rediriger le visiteur sur la bonne page.</li>
</ul>
<h2><ins>Dans quels cas j’ai besoin de faire cela ?</ins></h2>
<p><ins>Il y a plusieurs dizaines de cas, mais les principaux sont certainement les suivants :</ins></p>
<ul>
<li>Migration d’un <a href="http://www.oscommerce.com/" hreflang="en">OsCommerce</a> vers <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a></li>
<li>Migration d’un <a href="http://www.powerboutique.com/" hreflang="fr">PowerBoutique</a> vers <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a></li>
<li>Migration d’un <a href="http://virtuemart.net/" hreflang="en">VitueMart</a> vers <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a></li>
<li>Migration d’un <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a> vers <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a> (et oui… même dans ce cas)</li>
<li>Changement du rewrite d’une catégorie, d’un produit ou d’un cms (si on change le nom/rewrite sous <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a>, alors l’url de la page change… et donc on perd le référencement de celle-ci).</li>
<li>…</li>
</ul>
<h2><ins>Ca ne permet donc que de rediriger une ancienne page vers une nouvelle ?</ins></h2>
<p>Eh bien, NON! Il est même possible de crée une conversion d’URL pour la « beauté » et le « SEO Friendly » de l’url.
<br />
En effet, c’est déjà le cas avec l’utilisation des URL Rewrite de <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a>, on a la possibilité d’avoir une jolie url avec le nom du produit dedans, plutôt que des caractères bizarres (product.php?id_product=123).
<br />
<br />
<a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a> propose donc de base de changer les URL pour vous, mais certaines pages ne bénéficient pas de cette fonctionnalité (c’est la cas de page contact par exemple qui s’appelle « contact-form.php »).
<br />
Il est donc possible de créer une redirection/alias qui va dire que l’url « www.monsite.com/Contactez-nous.html » renverra vers la page « www.monsite.com/contact-form.php ».
<br />
Dans le cas d’une redirection, le visiteur verra toujours le nom « contact-form.php » dans l’url, mais dans le cas d’un alias (rewrite), le visiteur ne verra que le nom de la nouvelle page.
<br />
<br />
Mais attention, car si Google voit 2 pages identiques (contact-form.php et Contactez-nous.html) il va passer celles-ci en duplicate content, et Google n’aime pas DU TOUT ça! Il est donc très important dans des cas comme celui-ci de vérifier qu’aucune de vos pages ne renvoie vers l’ancienne url (contact-form.php).</p>
<h2><ins>C’est bien beau tout ça, mais comment on fait ?</ins></h2>
<p>Avec <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a> de base, vous n’avez pas la possibilité de faire cela. Hormis en mettant les mains dans le fichier « .htaccess » et de s’y connaitre, car une erreur et c’est le crash du site.</p>
<p><a href="http://www.prestashop.com/forums/member/890/pierreyves" hreflang="fr">Pierre-yves</a> a donc développé (sur l’idée de Jeckyl de Mediacom87) un module qui permet de faire cela depuis le panel d'administration Prestashop.</p>
<h2><ins>A quoi ca ressemble ?</ins></h2>
<p><a href="https://blog.yacoubi.fr/public/prestashop/prestashop_301_1.png" title="prestashop_301_1.png"><img src="https://blog.yacoubi.fr/public/prestashop/.prestashop_301_1_s.jpg" alt="prestashop_301_1.png" title="prestashop_301_1.png" /></a><a href="https://blog.yacoubi.fr/public/prestashop/prestashop_301_2.png" title="prestashop_301_2.png"><img src="https://blog.yacoubi.fr/public/prestashop/.prestashop_301_2_s.jpg" alt="prestashop_301_2.png" title="prestashop_301_2.png" /></a><a href="https://blog.yacoubi.fr/public/prestashop/prestashop_301_3.png" title="prestashop_301_3.png"><img src="https://blog.yacoubi.fr/public/prestashop/.prestashop_301_3_s.jpg" alt="prestashop_301_3.png" title="prestashop_301_3.png" /></a></p>
<h2><ins>Ou trouver ce module ?</ins></h2>
<p>Vous trouverez le lien en bas de ce billet qui vous permettra de l’acheter à moindre coût.</p>
<p><strong><a href="http://prestashop.mediacom87.fr/nos-modules/94-conversion-et-redirection-d-url.html" hreflang="fr">Acheter le module sur le store de Mediacom87</a></strong></p>
<p><a href="http://www.pierreyves.be/" hreflang="fr">Pierre-yves</a> se tiens également à votre disposition pour tous développements, installations, maintenances <a href="http://www.prestashop.com/" hreflang="fr">PrestaShop</a> sur-mesure.</p>
Xen utilisation de l'IPv6 vif-route
urn:md5:3670f51351c0ec4ced24e4783b65ea6e
2010-06-26T23:54:00+02:00
2011-11-12T01:00:27+01:00
Mohamed YACOUBI
Xen
dom0
domU
Gentoo
infogérance
ipv6
linux
vif-route
virtualisation
xen
<p><img src="https://blog.yacoubi.fr/public/Logo/.Xen_logo_s.jpg" alt="Xen_logo.png" style="display:block; margin:0 auto;" title="Xen_logo.png, fév. 2010" />
<br />
Mon bloc <strong><a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a></strong> étant enfin routé correctement, je me suis attelé à la configuration de ce dernier sur le Dom0 et DomU <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong>.
<br />
<br />
Ma configuration <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> étant à l'origine en bridge et disposant d'un bloc routé vers mon serveur, j'ai donc dût basculer ma configuration <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> en mode route. (vif-route)
<br />
<br />
Bien entendu à l'instar du mode bridge, le mode route n'est pas compatible IPv6 ...
<br />
Voici deux patch à appliquer (compatible Xen-4) ainsi qu'un exemple de configuration (Gentoo).
<br />
<br /></p>
<h3>1) Dom0</h3>
<p><br /></p>
<ul>
<li>vif-common</li>
</ul>
<pre class="diff"><span style="color: #888822;">--- vif-common.sh~ <span style="">2010</span><span style="">-04</span><span style="">-07</span> <span style="">18</span>:<span style="">12</span>:<span style="">04.000000000</span> <span style="">+0200</span></span>
<span style="color: #888822;">+++ vif-common.sh <span style="">2010</span><span style="">-06</span><span style="">-26</span> <span style="">23</span>:<span style="">08</span>:<span style="">38.000000000</span> <span style="">+0200</span></span>
<span style="color: #440088;">@@ <span style="">-14</span>,<span style="">7</span> <span style="">+14</span>,<span style="">7</span> @@</span>
# License along with this library; if not, write to the Free Software
# Foundation, Inc., <span style="">59</span> Temple Place, Suite <span style="">330</span>, Boston, MA <span style="">02111</span><span style="">-1307</span> USA
#
<span style="color: #991111;">-</span>
<span style="color: #00b000;">+# IPv6 Patched by Timeuhmeuh</span>
dir=$<span style="">(</span>dirname "$<span style="">0</span>"<span style="">)</span>
. "$dir/xen-hotplug-common.sh"
<span style="color: #440088;">@@ <span style="">-135</span>,<span style="">6</span> <span style="">+135</span>,<span style="">17</span> @@</span>
ip addr show "$<span style="">1</span>" | awk "/^.*inet.*$<span style="">1</span>\$/<span style="">{</span>print \$<span style="">2</span><span style="">}</span>" | sed -n '<span style="">1</span> s,/.*,,p'
<span style="">}</span>
<span style="color: #00b000;">+##</span>
<span style="color: #00b000;">+# ip6_of interface</span>
<span style="color: #00b000;">+#</span>
<span style="color: #00b000;">+# Print the IPv6 address currently in use at the given interface, or nothing if</span>
<span style="color: #00b000;">+# the interface is not up.</span>
<span style="color: #00b000;">+#</span>
<span style="color: #00b000;">+ip6_of<span style="">(</span><span style="">)</span></span>
<span style="color: #00b000;">+<span style="">{</span></span>
<span style="color: #00b000;">+ ip <span style="">-6</span> addr show dev "$<span style="">1</span>" scope global | awk -F'<span style="">[</span> |/<span style="">]</span>' '/inet6 <span style="">(</span><span style="">(</span><span style="">[</span><span style="">0</span>-9a-f<span style="">]</span>+:*<span style="">)</span>+<span style="">)</span>/ <span style="">{</span> print $<span style="">6</span> <span style="">}</span> ' | awk '/::/ <span style="">{</span>print $<span style="">1</span><span style="">}</span>'</span>
<span style="color: #00b000;">+<span style="">}</span></span>
<span style="color: #00b000;">+</span>
##
# dom0_ip
<span style="color: #440088;">@@ <span style="">-156</span>,<span style="">3</span> <span style="">+167</span>,<span style="">38</span> @@</span>
fi
echo "$result"
<span style="">}</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+##</span>
<span style="color: #00b000;">+# dom0_ip6</span>
<span style="color: #00b000;">+#</span>
<span style="color: #00b000;">+# Print the IPv6 address of the interface in dom0 through which we are routing.</span>
<span style="color: #00b000;">+# This is the IPv6 address on the interface specified as "netdev" as a parameter</span>
<span style="color: #00b000;">+# to these scripts, or eth0 by default. This function will call fatal if no</span>
<span style="color: #00b000;">+# such interface could be found.</span>
#
<span style="color: #00b000;">+dom0_ip6<span style="">(</span><span style="">)</span></span>
<span style="color: #00b000;">+<span style="">{</span></span>
<span style="color: #00b000;">+ local nd=$<span style="">{</span>netdev:-eth0<span style="">}</span></span>
<span style="color: #00b000;">+ local result=$<span style="">(</span>ip6_of "$nd"<span style="">)</span></span>
<span style="color: #00b000;">+ if <span style="">[</span> -z "$result" <span style="">]</span>; then</span>
<span style="color: #00b000;">+ echo ""</span>
<span style="color: #00b000;">+ else</span>
<span style="color: #00b000;">+ echo "$result"</span>
<span style="color: #00b000;">+ fi</span>
<span style="color: #00b000;">+<span style="">}</span></span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+##</span>
<span style="color: #00b000;">+# is_ip6</span>
<span style="color: #00b000;">+#</span>
<span style="color: #00b000;">+# Verifing IPv6 address</span>
<span style="color: #00b000;">+#</span>
<span style="color: #00b000;">+is_ipv6<span style="">(</span><span style="">)</span></span>
<span style="color: #00b000;">+<span style="">{</span></span>
<span style="color: #00b000;">+case "$<span style="">1</span>" in</span>
<span style="color: #00b000;">+ *:*:*<span style="">)</span></span>
<span style="color: #00b000;">+ echo "yes"</span>
<span style="color: #00b000;">+ ;;</span>
<span style="color: #00b000;">+ *<span style="">)</span></span>
<span style="color: #00b000;">+ echo ""</span>
<span style="color: #00b000;">+esac</span>
<span style="color: #00b000;">+<span style="">}</span></span></pre>
<ul>
<li>vif-route</li>
</ul>
<pre class="diff"><span style="color: #888822;">--- vif-route~ <span style="">2010</span><span style="">-04</span><span style="">-07</span> <span style="">18</span>:<span style="">12</span>:<span style="">04.000000000</span> <span style="">+0200</span></span>
<span style="color: #888822;">+++ vif-route <span style="">2010</span><span style="">-06</span><span style="">-26</span> <span style="">23</span>:<span style="">12</span>:<span style="">45.000000000</span> <span style="">+0200</span></span>
<span style="color: #440088;">@@ <span style="">-18</span>,<span style="">17</span> <span style="">+18</span>,<span style="">24</span> @@</span>
# Read from the store:
# ip list of IP networks for the vif, space-separated <span style="">(</span>default given in
# this script<span style="">)</span>.
<span style="color: #00b000;">+#</span>
<span style="color: #00b000;">+# IPv6 Patched by Timeuhmeuh - http://blog.yacoubi.fr</span>
#============================================================================
dir=$<span style="">(</span>dirname "$<span style="">0</span>"<span style="">)</span>
. "$dir/vif-common.sh"
main_ip=$<span style="">(</span>dom0_ip<span style="">)</span>
<span style="color: #00b000;">+main_ip6=$<span style="">(</span>dom0_ip6<span style="">)</span></span>
case "$command" in
online<span style="">)</span>
<span style="color: #00b000;">+ log info "<span style="">[</span>vif-route<span style="">]</span> online request, ip $<span style="">{</span>ip<span style="">}</span> with main_ip $<span style="">{</span>main_ip<span style="">}</span> and main_ip6 $<span style="">{</span>main_ip6<span style="">}</span> for $vif."</span>
ifconfig $<span style="">{</span>vif<span style="">}</span> $<span style="">{</span>main_ip<span style="">}</span> netmask <span style="">255.255</span><span style="">.255</span><span style="">.255</span> up
<span style="color: #991111;">- echo <span style="">1</span> >/proc/sys/net/ipv4/conf/$<span style="">{</span>vif<span style="">}</span>/proxy_arp</span>
<span style="color: #00b000;">+ if <span style="">[</span> ! -z "$<span style="">{</span>main_ip6<span style="">}</span>" <span style="">]</span>; then</span>
<span style="color: #00b000;">+ ip <span style="">-6</span> addr add $<span style="">{</span>main_ip6<span style="">}</span> dev $<span style="">{</span>vif<span style="">}</span></span>
<span style="color: #00b000;">+ fi</span>
<span style="color: #00b000;">+ echo <span style="">1</span> >/proc/sys/net/ipv4/conf/$<span style="">{</span>vif<span style="">}</span>/proxy_arp</span>
ipcmd='add'
cmdprefix=''
;;
<span style="color: #440088;">@@ <span style="">-43</span>,<span style="">7</span> <span style="">+50</span>,<span style="">16</span> @@</span>
# If we've been given a list of IP addresses, then add routes from dom0 to
# the guest using those addresses.
for addr in $<span style="">{</span>ip<span style="">}</span> ; do
<span style="color: #991111;">- $<span style="">{</span>cmdprefix<span style="">}</span> ip route $<span style="">{</span>ipcmd<span style="">}</span> $<span style="">{</span>addr<span style="">}</span> dev $<span style="">{</span>vif<span style="">}</span> src $<span style="">{</span>main_ip<span style="">}</span></span>
<span style="color: #00b000;">+ result=$<span style="">(</span>is_ipv6 "$<span style="">{</span>addr<span style="">}</span>"<span style="">)</span></span>
<span style="color: #00b000;">+ if <span style="">[</span> -z "$<span style="">{</span>result<span style="">}</span>" <span style="">]</span> ; then</span>
<span style="color: #00b000;">+ result=`$<span style="">{</span>cmdprefix<span style="">}</span> ip route $<span style="">{</span>ipcmd<span style="">}</span> $<span style="">{</span>addr<span style="">}</span> dev $<span style="">{</span>vif<span style="">}</span> src $<span style="">{</span>main_ip<span style="">}</span> <span style="">2</span>>&<span style="">1</span>`</span>
<span style="color: #00b000;">+ log info "<span style="">[</span>vif-route<span style="">]</span> Result: $<span style="">{</span>result<span style="">}</span>"</span>
<span style="color: #00b000;">+ else</span>
<span style="color: #00b000;">+ log info "<span style="">[</span>vif-route<span style="">]</span> Adding IPv6 address $<span style="">{</span>addr<span style="">}</span> with src $<span style="">{</span>main_ip6<span style="">}</span> for $vif."</span>
<span style="color: #00b000;">+ result=`$<span style="">{</span>cmdprefix<span style="">}</span> ip <span style="">-6</span> route $<span style="">{</span>ipcmd<span style="">}</span> $<span style="">{</span>addr<span style="">}</span> dev $<span style="">{</span>vif<span style="">}</span> src $<span style="">{</span>main_ip6<span style="">}</span> <span style="">2</span>>&<span style="">1</span>`</span>
<span style="color: #00b000;">+ log info "<span style="">[</span>vif-route<span style="">]</span> Result: $<span style="">{</span>result<span style="">}</span>"</span>
<span style="color: #00b000;">+ fi</span>
<span style="color: #00b000;">+# $<span style="">{</span>cmdprefix<span style="">}</span> ip route $<span style="">{</span>ipcmd<span style="">}</span> $<span style="">{</span>addr<span style="">}</span> dev $<span style="">{</span>vif<span style="">}</span> src $<span style="">{</span>main_ip<span style="">}</span></span>
done
fi</pre>
<ul>
<li>/etc/conf.d/net</li>
</ul>
<pre>
config_eth0=( "192.168.0.1/24" "2001:758:f00:340:192:168:0:12/64" "2001:758:5312::/48" )
</pre>
<ul>
<li>/etc/xen/domU</li>
</ul>
<pre>
vif = [ 'ip=2001:758:5312::2 192.168.0.10' ]
</pre>
<h3>2) Dom0</h3>
<p><br /></p>
<ul>
<li>/etc/conf.d/net</li>
</ul>
<pre>
config_eth0=( "192.168.0.2/24" "2001:758:5312::2/48" )
routes_eth0=( "default gw 192.168.0.1" "default via 2001:758:5312::" )
</pre>
<p>Patch :</p>
<ul>
<li><a href="https://blog.yacoubi.fr/public/Patch_Xen/xen-vif-route-ipv6.diff">xen-vif-route-ipv6.diff</a></li>
<li><a href="https://blog.yacoubi.fr/public/Patch_Xen/xen-vif-common-ipv6.diff">xen-vif-common-ipv6.diff</a></li>
</ul>
<p><br />
Lien utile : <a href="http://notes.benv.junerules.com/all/software/xen-and-routed-ipv6/" hreflang="en">xen-and-routed-ipv6</a></p>
useradd unknown group
urn:md5:7ddbbd79662478d1f6cdb2ece23ae1b5
2010-04-24T21:25:00+02:00
2010-04-24T21:06:01+02:00
Mohamed YACOUBI
Gentoo
cluster
emerge
Gentoo
infogérance
linux
useradd unknown group
<p><img src="https://blog.yacoubi.fr/public/Logo/.gentoo-logo_s.jpg" alt="gentoo-logo" style="display:block; margin:0 auto;" title="gentoo-logo, avr. 2010" />
<br /></p>
<ol>
<li><ins>Contexte :</ins></li>
</ol>
<p>Il s'agit d'un serveur sous <strong>Gentoo Linux</strong> hébergeant des milliers de comptes (1520 précisément).</p>
<pre class="bash">srv1 ~ <span style="color: #808080; font-style: italic;"># equery l sys-apps/shadow</span>
<span style="color: #7a0874; font-weight: bold;">[</span> Searching <span style="color: #000000; font-weight: bold;">for</span> package <span style="color: #ff0000;">'shadow'</span> <span style="color: #000000; font-weight: bold;">in</span> all categories among: <span style="color: #7a0874; font-weight: bold;">]</span>
<span style="color: #000000; font-weight: bold;">*</span> installed packages
<span style="color: #7a0874; font-weight: bold;">[</span>I--<span style="color: #7a0874; font-weight: bold;">]</span> <span style="color: #7a0874; font-weight: bold;">[</span> <span style="color: #7a0874; font-weight: bold;">]</span> sys-apps<span style="color: #000000; font-weight: bold;">/</span>shadow<span style="color: #000000;">-4.0</span><span style="color: #000000;">.18</span><span style="color: #000000;">.2</span> <span style="color: #7a0874; font-weight: bold;">(</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span></pre>
<ol>
<li><ins>Problème :</ins></li>
</ol>
<p>Lors de la création de nouveau compte :</p>
<pre class="bash">srv1 ~ <span style="color: #808080; font-style: italic;"># /usr/sbin/useradd -m -d /ftps/XXXX/XX/xx15000 -s /bin/false -gusers -u 15000 xx15000</span>
useradd: unknown group <span style="color: #c20cb9; font-weight: bold;">users</span></pre>
<ol>
<li><ins>Résolution :</ins></li>
</ol>
<p>Tout d'abord je crée un utilisateur pour l'ajouter manuellement dans le groupe <q>users</q>.</p>
<pre>
srv1 ~ # /usr/sbin/useradd -m -d /ftps/XXXX/XX/xx15000 -s /bin/false -u 15000 xx15000
srv1 ~ # gpasswd -a xx15000 users
Ajout de l'utilisateur xx15000 au groupe users
</pre>
<p>Le problème ne viens pas donc du groupe (<strong>/etc/group</strong> corrompu par exemple).
<br />
<br />
Je procède ensuite à la mise à jour de <q>shadow</q> vers la dernière version.</p>
<pre>
sys-apps/shadow-4.1.2.2 [4.0.18.2]
</pre>
<p>Ayant constaté lors de la mise à jour l'ajout d'une option dans le fichier <strong>/etc/login.defs</strong> (qui définit la configuration de <q>shadow</q> pour le système), je m'y intéresse.</p>
<pre class="text">#MAX_MEMBERS_PER_GROUP 0</pre>
<p>Cette option définie le nombre maximum de membres par entrée de groupe.
<br />
Lorsque le maximum est atteint, une nouvelle entrée de groupe (ligne) est démarrée dans <strong>/etc/group</strong> (avec le même nom, même mot de passe et même GID).
<br />
Cette fonctionnalité (groupe découpé) permet de limiter la longueur des lignes dans le fichier de groupes.
<br />
<br />
Je décide donc d'utiliser cette option (avec mes 1520 utilisateurs la ligne correspondant au groupe <q>users</q> fait 10301 caractères).</p>
<pre class="text">MAX_MEMBERS_PER_GROUP 150</pre>
<p>Je régénère mon fichier <strong>/etc/group</strong>.</p>
<pre class="bash"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>grpconv</pre>
<p>Le fait de limiter la longueur des lignes à 150 utilisateurs a résolu le problème.
<br />
<br />
J'ai effectué un test avec une limitation à 25 utilisateurs, un segfault est alors renvoyé à chaque tentative de création d'utilisateur, je pense donc que je serai confronté dans les prochains mois à un nouveau problème <q>Quelles seront les limitations exacte avec /etc/group ?</q>.</p>
Xen utilisation de l'IPv6 en bridge
urn:md5:5bd4439bf35c73b44615819a8160ce2e
2010-03-15T19:39:00+01:00
2010-03-16T10:26:42+01:00
Mohamed YACOUBI
Xen
bridge
dom0
domU
infogérance
ipv6
linux
virtualisation
xen
<p><img src="https://blog.yacoubi.fr/public/Logo/.Xen_logo_s.jpg" alt="Xen_logo.png" style="display:block; margin:0 auto;" title="Xen_logo.png, fév. 2010" />
<br />
Ayant obtenu un bloc <strong><a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a></strong> tout récemment, j'ai tenté de le configurer sur mon Dom0 <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> pensant que le billet <strong><a href="https://blog.yacoubi.fr/index.php?post/2009/09/15/Xen-bridge-IPv6-support">Xen bridge IPv6 support</a></strong> suffirait.
<br />
<br />
Il n'en fut rien, <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> lors de l"initialisation du bridge ne traite aucunement la partie <strong><a href="http://fr.wikipedia.org/wiki/IPv6" hreflang="fr">IPv6</a></strong>, j'ai donc développé un petit patch en m'appuyant sur la partie <strong><a href="http://fr.wikipedia.org/wiki/IPv4" hreflang="fr">IPv4</a></strong>.
<br />
<br /></p>
<pre class="diff"><span style="color: #888822;">--- /etc/xen/scripts/network-bridge~ <span style="">2008</span><span style="">-06</span><span style="">-03</span> <span style="">14</span>:<span style="">50</span>:<span style="">29.000000000</span> <span style="">+0100</span></span>
<span style="color: #888822;">+++ /etc/xen/scripts/network-bridge <span style="">2010</span><span style="">-03</span><span style="">-02</span> <span style="">18</span>:<span style="">15</span>:<span style="">50.000000000</span> <span style="">+0100</span></span>
<span style="color: #440088;">@@ <span style="">-103</span>,<span style="">6</span> <span style="">+103</span>,<span style="">8</span> @@</span>
get_ip_info<span style="">(</span><span style="">)</span> <span style="">{</span>
addr_pfx=`ip addr show dev $<span style="">1</span> | egrep '^ *inet ' | sed -e 's/ *inet //' -e "s/$<span style="">1</span>//"`
gateway=`ip route show dev $<span style="">1</span> | fgrep default | sed 's/default via //'`
<span style="color: #00b000;">+ addr_pfx_6=`ip <span style="">-6</span> addr show dev $<span style="">1</span> | egrep '^ *inet' | sed -e 's/ *inet6 //' -e "s/$<span style="">1</span>//" | egrep -E ^<span style="">2</span>`</span>
<span style="color: #00b000;">+ gateway_6=`ip <span style="">-6</span> route show dev $<span style="">1</span> | fgrep default | sed 's/default via //' | cut -d' ' -f1`</span>
<span style="">}</span>
do_ifup<span style="">(</span><span style="">)</span> <span style="">{</span>
<span style="color: #440088;">@@ <span style="">-113</span>,<span style="">6</span> <span style="">+115</span>,<span style="">18</span> @@</span>
ip addr add $<span style="">{</span>addr_pfx<span style="">}</span> dev $<span style="">1</span>
ip link set dev $<span style="">1</span> up
<span style="">[</span> -n "$gateway" <span style="">]</span> && ip route add default via $<span style="">{</span>gateway<span style="">}</span>
<span style="color: #00b000;">+ fi</span>
<span style="color: #00b000;">+ fi</span>
<span style="color: #00b000;">+<span style="">}</span></span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+do_ifup_6<span style="">(</span><span style="">)</span> <span style="">{</span></span>
<span style="color: #00b000;">+ if <span style="">[</span> $<span style="">1</span> != "$<span style="">{</span>netdev<span style="">}</span>" <span style="">]</span> || ! ifup $<span style="">1</span> ; then</span>
<span style="color: #00b000;">+ if <span style="">[</span> -n "$addr_pfx_6" <span style="">]</span> ; then</span>
<span style="color: #00b000;">+ # use the info from get_ip_info<span style="">(</span><span style="">)</span></span>
<span style="color: #00b000;">+ ip <span style="">-6</span> addr flush $<span style="">1</span></span>
<span style="color: #00b000;">+ ip <span style="">-6</span> addr add $<span style="">{</span>addr_pfx_6<span style="">}</span> dev $<span style="">1</span></span>
<span style="color: #00b000;">+ ip <span style="">-6</span> link set dev $<span style="">1</span> up</span>
<span style="color: #00b000;">+ <span style="">[</span> -n "$gateway_6" <span style="">]</span> && ip route add default via $<span style="">{</span>gateway_6<span style="">}</span></span>
fi
fi
<span style="">}</span>
<span style="color: #440088;">@@ <span style="">-245</span>,<span style="">6</span> <span style="">+259</span>,<span style="">7</span> @@</span>
fi
add_to_bridge2 $<span style="">{</span>bridge<span style="">}</span> $<span style="">{</span>pdev<span style="">}</span>
do_ifup $<span style="">{</span>bridge<span style="">}</span>
<span style="color: #00b000;">+ do_ifup_6 $<span style="">{</span>bridge<span style="">}</span></span>
if <span style="">[</span> $<span style="">{</span>antispoof<span style="">}</span> = 'yes' <span style="">]</span> ; then
antispoofing
<span style="color: #440088;">@@ <span style="">-272</span>,<span style="">6</span> <span style="">+287</span>,<span style="">7</span> @@</span>
ip link set $<span style="">{</span>bridge<span style="">}</span> name $<span style="">{</span>tdev<span style="">}</span>
ip link set $<span style="">{</span>pdev<span style="">}</span> name $<span style="">{</span>netdev<span style="">}</span>
do_ifup $<span style="">{</span>netdev<span style="">}</span>
<span style="color: #00b000;">+ do_ifup_6 $<span style="">{</span>netdev<span style="">}</span></span>
brctl delbr $<span style="">{</span>tdev<span style="">}</span>
<span style="">}</span></pre>
<p><br />
<br />
Patch : <a href="https://blog.yacoubi.fr/public/Patch_Xen/xen-vif-bridge-ipv6.diff">xen-vif-bridge-ipv6.diff</a></p>
Gestion des sessions Magento
urn:md5:ae56cdfb6004a9853eb09e9cebbd54e4
2010-03-08T20:28:00+01:00
2010-09-10T16:48:56+02:00
Mohamed YACOUBI
Magento
linux
magento
memcache
memcached
mysql
php
<p><img src="https://blog.yacoubi.fr/public/Logo/.magento_logo_s.jpg" alt="magento_logo.jpg" style="display:block; margin:0 auto;" title="magento_logo.jpg, fév. 2010" />
<br />
Suite à mon article <strong><a href="https://blog.yacoubi.fr/index.php?post/2009/03/30/Centralisation-des-sessions-Magento-en-cluster">Centralisation des sessions Magento en cluster</a></strong> présentant l'utilisation de <strong><a href="http://www.danga.com/memcached/" hreflang="fr">Memcached</a></strong> avec <strong><a href="http://www.magentocommerce.com" hreflang="fr">Magento</a></strong>, voici également d'autres façons de gérer les sessions.
<br />
<br /></p>
<ol>
<li><ins>Utilisation du mode par défaut :</ins></li>
</ol>
<p>Lors de l'utilisation de ce mode par défaut, les sessions sont sauvegardées dans le répertoire /home/www/domain.com/var/session. Dans le cadre d'un système clusterisé il serait nécessaire de mutualiser ce répertoire.
<br />
<br />
Dans le cadre de l'utilisation de <strong><a href="http://www.magentocommerce.com" hreflang="en">Magento</a></strong> sur un serveur en StandAlone, je vous conseil de stocker vos sessions (profitez-en pour vous occuper du cache) en RAM afin d'optimiser au mieux les accès.
<br />
Par exemple mon <q>/etc/fstab</q> avec 256Mo alloué pour le cache et 64Mo pour les sessions</p>
<pre>
tmpfs /home/www/domain.com/var/cache tmpfs size=256M 0 0
tmpfs /home/www/domain.com/var/session tmpfs size=64M 0 0
</pre>
<p>Attention en cas de redémarrage du serveur le cache et les sessions seront intégralement perdus, il conviendra donc de régénérer le cache depuis l'administration.
<br />
<br /></p>
<ol>
<li><ins>Utilisation d'une base de données :</ins></li>
</ol>
<p>Il vous suffit de choisir l'option appropriée lors de l'étape 3 de l'assistant d'installation : <q>Save session data in Database</q> ou d'effectuer la modification suivante dans <q>app/etc/local.xml</q>.</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;"><session_save<span style="font-weight: bold; color: black;">></span></span></span><span style="color: #339933;"><![CDATA[db]]></span><span style="color: #009900;"><span style="font-weight: bold; color: black;"></session_save<span style="font-weight: bold; color: black;">></span></span></span></pre>
<p>Les sessions devraient à présent apparaître dans la table core_session.
<br />
<br /></p>
<ol>
<li><ins>Utilisation de Memcached :</ins></li>
</ol>
<p>Voir le précèdent billet : <strong><a href="https://blog.yacoubi.fr/index.php?post/2009/03/30/Centralisation-des-sessions-Magento-en-cluster">Memcached et Magento</a></strong></p>
Xen et utilisation du NAT
urn:md5:856db80503ad6bee7ab3e95c07891ec6
2010-03-01T19:19:00+01:00
2010-03-16T10:30:52+01:00
Mohamed YACOUBI
Xen
dom0
domU
infogérance
linux
virtualisation
xen
<p><img src="https://blog.yacoubi.fr/public/Logo/.Xen_logo_s.jpg" alt="Xen_logo.png" style="display:block; margin:0 auto;" title="Xen_logo.png, fév. 2010" />
<br />
Un ami ayant eu un besoin urgent de pouvoir gérer des DomU <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> via le <strong><a href="http://fr.wikipedia.org/wiki/Network_address_translation" hreflang="en">NAT</a></strong> et comme la configuration de <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> en <strong><a href="http://fr.wikipedia.org/wiki/Network_address_translation" hreflang="en">NAT</a></strong> ne me plait guère, je me suis alors permis de développer un petit script très simple afin de gérer des règles de routage.</p>
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">IPTABLES=</span><span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables
<span style="color: #007800;">MORE=</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">more</span>
<span style="color: #007800;">GREP=</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">grep</span>
<span style="color: #007800;">ECHO=</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #007800;">IP_PUBLIC=</span>XXX.XXX.XXX.XXX
<span style="color: #007800;">IP_PRIVATE=</span>XXX.XXX.XXX.XXX<span style="color: #000000; font-weight: bold;">/</span>XX
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>GREP<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #ff0000;">'1'</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>ECHO<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #ff0000;">"1"</span> <span style="color: #000000; font-weight: bold;">></span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #808080; font-style: italic;"># Routage des requetes sortante DomU</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -L POSTROUTING -t nat <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>GREP<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IP_PUBLIC<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -A POSTROUTING -t nat -s <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IP_PRIVATE<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -j SNAT --to <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IP_PUBLIC<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Rules policy in progress :"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"________________________________________________________________________________________________"</span>
<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -t nat -L PREROUTING --line-numbers <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>MORE<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000;">+2</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"________________________________________________________________________________________________"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Actions :"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"+---+-----------------+"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"| 1 | Add Rules |"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"+---+-----------------+"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"| 2 | Delete Rules |"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"+---+-----------------+"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"| 3 | List Rules |"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"+---+-----------------+"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">" >> "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> TASK
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>TASK<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000; font-weight: bold;">in</span>
<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"#############"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"# 28/02/2010 #"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"#############"</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"== Add Rules =="</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">"IP Source >> "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> IPSOURCE
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -t nat -L PREROUTING --line-numbers <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>GREP<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPSOURCE<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"IP Source is already configured, please remove it before"</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">"IP Destination >> "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> IPDESTINATION
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"-------------------------------"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Apply this Rules, Traffic destined ${IPSOURCE} redirect to ${IPDESTINATION} ? (Y/N)"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">" >> "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> APPLY
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #7a0874; font-weight: bold;">[</span> <span style="color: #ff0000;">"${APPLY}"</span> = <span style="color: #ff0000;">"Y"</span> <span style="color: #7a0874; font-weight: bold;">]</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"You have not validated, rules not add"</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -A PREROUTING -t nat -j DNAT -d <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPSOURCE<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span> --to <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPDESTINATION<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>iptables save <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Success Rules Apply"</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"== Delete Rules =="</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">"Rules numbers >> "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> DELRULES
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -t nat -L PREROUTING --line-numbers <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>GREP<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>DELRULES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Rules not exist"</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Delete this Rules, `${IPTABLES} -t nat -L PREROUTING --line-numbers | ${GREP} -w ${DELRULES} | awk 'BEGIN { FS="</span> <span style="color: #ff0000;">" } { print "</span>Traffic destined to <span style="color: #ff0000;">"$6"</span> redirect <span style="color: #ff0000;">"$7 }'` ? (Y/N)"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">" >> "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> APPLY
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #7a0874; font-weight: bold;">[</span> <span style="color: #ff0000;">"${APPLY}"</span> = <span style="color: #ff0000;">"Y"</span> <span style="color: #7a0874; font-weight: bold;">]</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"You have not validated, rules not delete"</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -t nat -D PREROUTING <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>DELRULES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>iptables save <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Success Rules Apply"</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"== List Rules =="</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"________________________________________________________________________________________________"</span>
<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>IPTABLES<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> -t nat -L PREROUTING --line-numbers <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>MORE<span style="color: #7a0874; font-weight: bold;">}</span><span style="color: #000000; font-weight: bold;">|</span>> <span style="color: #000000;">+2</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"________________________________________________________________________________________________"</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">)</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"---------------------------"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Invalid selection"</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre>
<p><br />
<br />
Script : <a href="https://blog.yacoubi.fr/public/Patch_Xen/xen-nat.sh">xen-nat.sh</a></p>
Xen Allocution memoire superieur à 512Mo
urn:md5:de8a73729a08048d645e029284c012a7
2010-02-25T19:00:00+01:00
2010-03-01T19:14:53+01:00
Mohamed YACOUBI
Xen
dom0
domU
infogérance
linux
virtualisation
xen
<p><img src="https://blog.yacoubi.fr/public/Logo/.Xen_logo_s.jpg" alt="Xen_logo.png" style="display:block; margin:0 auto;" title="Xen_logo.png, fév. 2010" />
<br />
J'ai rencontré un nouveau problème avec l'ensemble du serveur <strong><a href="http://www.xen.org" hreflang="en">Xen</a></strong> (Dom0/DomU) lors de l'allocution de plus de 512Mo de RAM (1024Mo par exemple).</p>
<p>Le serveur sur lequel était alloué autant de mémoire vive crashé au démarrage. (ce qui est gênant lorsqu'on décide que Dom0 doit avoir plus de mémoire)
<br />
<br />
Ce bug n'est bien entendu pas présent lors de l'utilisation de <strong><a href="http://en.wikipedia.org/wiki/Hardware-assisted_virtualization" hreflang="en">HVM</a></strong> (Hardware-Assisted Virtual Machine) mais uniquement en paravirtualisation.</p>
<p>Dans le cas où ce bug se produit, il suffit simplement de désactiver l'option suivante dans le kernel et de le recompiler :</p>
<pre>
Processor type and features --->
[ ] Allocate 3rd-level pagetables from highmem
</pre>
<p>L'option <q>Allocate 3rd-level pagetables from highmem</q> , permet de placer les structures de données du gestionnaire de mémoire virtuelle en mémoire haute. Ces structures ayant une taille proportionnelle à la quantité de mémoire effectivement installée, cette option permet d'éviter qu'elles ne saturent la mémoire basse.</p>