<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gautier Franchini on Medium]]></title>
        <description><![CDATA[Stories by Gautier Franchini on Medium]]></description>
        <link>https://medium.com/@orsius?source=rss-b3b335db8f1a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IMpUC9kaMvAD4sQi.</url>
            <title>Stories by Gautier Franchini on Medium</title>
            <link>https://medium.com/@orsius?source=rss-b3b335db8f1a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:56:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@orsius/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ANSIBLE — HOW TO COLLECT INFORMATION ABOUT REMOTE HOSTS WITH GATHERS FACTS (2017)]]></title>
            <link>https://medium.com/@orsius/ansible-how-to-collect-information-about-remote-hosts-with-gathers-facts-2017-308c455850d0?source=rss-b3b335db8f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/308c455850d0</guid>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible-tutorial]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[ansible-playbook]]></category>
            <dc:creator><![CDATA[Gautier Franchini]]></dc:creator>
            <pubDate>Sat, 14 Nov 2020 06:21:51 GMT</pubDate>
            <atom:updated>2020-11-14T06:21:51.745Z</atom:updated>
            <content:encoded><![CDATA[<h3>ANSIBLE — HOW TO COLLECT INFORMATION ABOUT REMOTE HOSTS WITH GATHERS FACTS (2017)</h3><figure><img alt="Anisble Logo" src="https://cdn-images-1.medium.com/max/1024/1*GXmzedrglMx6A2IF3zh5Dw.jpeg" /></figure><h3>Ansible — How to collect information about your remote hosts (2017)</h3><p>In order to do so, we will discuss about ansible module: Gathers facts</p><p>💬 Official webpage:</p><ul><li><a href="https://docs.ansible.com/ansible/setup_module.html">https://docs.ansible.com/ansible/setup_module.html</a></li><li><a href="https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_module.html">https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_module.html</a></li></ul><h3>Display facts from all hosts and store them at /tmp/facts indexed by hostname</h3><pre>$ ansible all -m setup --tree /tmp/facts</pre><p>➡ now check the file to have a clear view off all variables <em>(facts)</em> collected by ansible for your host like the well known {{ inventory_hostname }}</p><h3>To list the fact directly in your playbook you have to set gather_facts: True in your playbook</h3><pre>gather_facts: True</pre><pre>  tasks:<br>    - debug: var=hostvars[inventory_hostname][&#39;ansible_enp0s3&#39;][&#39;ipv4&#39;][&#39;address&#39;]</pre><h3>get current target host’s IP address and use it in your ansible role or playbook</h3><p>You can use in your <em>template.j2</em>{{ ansible_eth0.ipv4.address }} the same way you use {{ inventory_hostname }}</p><h3>To set the value in your vars file</h3><pre>---<br>host_ip: &quot;{{ ansible_enp0s3.ipv4.address }}&quot;</pre><h3>use case</h3><p>➡ here is an example: <a href="https://github.com/orsius/ansible-dtx-cassandra-3">https://github.com/orsius/ansible-dtx-cassandra-3</a></p><p>⚠ This git repository is not meant to be use in production, it’s just to illustrate this blog post.</p><p><a href="https://github.com/orsius/ansible-dtx-cassandra-3">orsius/ansible-dtx-cassandra-3</a></p><figure><img alt="Ansible Configuration Management Tool" src="https://cdn-images-1.medium.com/max/200/1*GsFr0_P3EJHpBO8D-8ct_w.png" /></figure><p>I Hope it’ll help someone one day ッ</p><p>kr,<br>G.</p><h3>update: 2018–04–19</h3><p><strong>You can also use “setup” in your .yaml file.</strong></p><p><em>e.g. In my current use case, I need to get the </em>default ipv4 addr<em>:</em></p><pre>- name: Gather facts from new server<br>  setup:<br>    filter: ansible_default_ipv4.address</pre><p>You can now call {{ ansible_default_ipv4.address }} in your playbook.<br><em>(setup load all the ansible_</em>** variables)</p><p>ℹ️ For those who are interested to learn more with ansible I recommend this website: <a href="https://www.educba.com/ansible-roles/?source=leftnav">www.educba.com</a> ; I found the information complete and easy to read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=308c455850d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup a secured redis-cluster on centos7 (2017)]]></title>
            <link>https://medium.com/@orsius/setup-a-secured-redis-cluster-on-centos7-2017-944ac5b17f45?source=rss-b3b335db8f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/944ac5b17f45</guid>
            <category><![CDATA[centos7]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[redis-cluster]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[sentinel]]></category>
            <dc:creator><![CDATA[Gautier Franchini]]></dc:creator>
            <pubDate>Fri, 13 Nov 2020 08:42:19 GMT</pubDate>
            <atom:updated>2020-11-13T08:42:19.435Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setup a secured redis-cluster on centos7 (2017)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PxgvN1-a6moSV11YWt-PPQ.jpeg" /></figure><h3>What is redis exactly?</h3><p><strong>Redis</strong> is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.</p><p><strong>Redis Sentinel</strong> provides high availability for Redis. In practical terms this means that using Sentinel you can create a Redis deployment that resists without human intervention to certain kind of failures.</p><p>⚠️ You need at least three Sentinel instances for a robust deployment.</p><p>💬 Sentinel constantly checks if your master and slave instances are working as expected.</p><p>📓 If a master is not working as expected, Sentinel can start a failover process where a slave is promoted to master, the other additional slaves are reconfigured to use the new master, and the applications using the Redis server informed about the new address to use when connecting.</p><p>ℹ️ Sentinel manages the failover, it doesn’t configure Redis for HA. It is an important distinction.</p><h3>Documentation</h3><ul><li>Redis <a href="https://redis.io/topics/sentinel">Sentinel Documentation</a></li><li>Redis <a href="https://redis.io/topics/cluster-spec">Cluster Specification</a></li><li>Redis <a href="https://redis.io/commands/">Commands Documentation</a></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07d2911d40d237b4d0bf23f1e8733de9/href">https://medium.com/media/07d2911d40d237b4d0bf23f1e8733de9/href</a></iframe><h3>What we are going to install</h3><p>Following all the step below you will setup a redis-cluster compose of 2 redis server monitor by 3 redis-sentinel ‘agent’</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/164cb7f74f4a35692116edf29d7d4258/href">https://medium.com/media/164cb7f74f4a35692116edf29d7d4258/href</a></iframe><h3>Prerequisites</h3><ul><li>have created a dedicated user/group <em>(not mandatory)</em></li></ul><pre>$ groupadd -g 1983 redis<br>$ useradd -u 1983 -s &quot;/sbin/nologin&quot; -c &quot;redis user&quot; -g 1983 redis</pre><ul><li>have the epel repository setup properly</li></ul><pre># Setup the repository:<br>$ curl -L -O <a href="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm">https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm</a> &amp;&amp; yum install epel-release-latest-7.noarch.rpm<br>yum repolist<br># you should see: epel-testing.repo epel.repo</pre><h3>Installation &amp; Configuration</h3><h3>redis &amp; redis-sentinel packages</h3><ul><li>Install rpm package</li></ul><pre># Install the package and dependencies:<br>$ yum search redis &amp;&amp; yum install redis</pre><ul><li>Service Management</li></ul><pre># start and check redis service:<br>$ systemctl start redis.service &amp;&amp; systemctl status redis.service<br># start and check sentinel service:<br>$ systemctl start redis-sentinel.service &amp;&amp; systemctl status redis-sentinel.service</pre><ul><li>Check the redis server:</li></ul><pre># To test the installation of Redis, use below given command<br># If the response output is PONG, it means installation is completed successfully.<br>$ redis-cli -h ${SERVER_NODE} -p 6379 ping</pre><h3>redis Configuration</h3><p>In the example below I only set the minimum parameters that are mandatory for a redis-cluster to run.</p><p>💬 In our current configuration the clustername is set to “redis-cluster”</p><h4>redis.conf</h4><p>redis.conf<br>By default, if no “bind” configuration directive is specified, Redis listens for connections from all the network interfaces available on the server.</p><p>Of course there are plenty of custom parameters dedicated to redis optimisation. <em>(feel free to browse the official latest stable released redis.conf and a sentinel.conf sample files)</em></p><p>ℹ️ There is some little differences between the master and the slave configuration <em>(see below)</em></p><ul><li>master node</li></ul><pre>bind ${SERVER_IP}<br>port 6379<br>dir /var/lib/redis</pre><ul><li>slave node</li></ul><pre>bind ${SERVER_IP}<br>port 6379<br>dir /var/lib/redis<br>slaveof ${MASTER_NODE_IP} 6379</pre><h4>redis-sentinel.conf</h4><p>ℹ️ each sentinel process is paired with a redis-server process</p><pre>sentinel monitor redis-cluster ${MASTER_NODE_IP} 6379 2<br>sentinel down-after-milliseconds redis-cluster 5000<br>sentinel parallel-syncs redis-cluster 1<br>sentinel failover-timeout redis-cluster 10000</pre><p>💬 For more detailed information please refer to the official sentinel documentation.</p><h3>secure redis-cluster</h3><p>ℹ️ Official Redis <a href="https://redis.io/topics/security">Security webpage</a></p><p>Require clients to issue AUTH before processing any other commands. This might be useful in environments in which you do not trust others with access to the host running redis-server.</p><p>Protected mode is a layer of security protection, in order to avoid that Redis instances left open on the internet are accessed and exploited.</p><p>⚠️ Since Redis is pretty fast an outside user can try up to 150k passwords per second against a good box. This means that you should use a very strong password otherwise it will be very easy to break.</p><h4>generate a random password</h4><pre>REDIS_PASSWD=$(date | md5)<br>	99c43b31c059dd34a5c6dfc9c1515f58</pre><p>To set a layer of security on our current redis cluster we have to modify our configuration files as follow</p><ul><li>redis.conf <strong>master node</strong></li></ul><pre>bind ${SERVER_IP}<br>port 6379<br>dir /var/lib/redis<br>requirepass ${REDIS_PASSWD}<br>masterauth ${REDIS_PASSWD}</pre><ul><li>redis.conf <strong>slave node</strong></li></ul><pre>bind ${SERVER_IP}<br>port 6379<br>dir /var/lib/redis<br>requirepass ${REDIS_PASSWD}<br>slaveof ${MASTER_NODE_IP} 6379</pre><ul><li>sentinel file <em>(slave and master)</em></li></ul><pre>. . .<br>sentinel monitor redis-cluster ${REDIS_SRV} ${REDIS_PORT_USED} 1<br># sentinel auth-pass &lt;master-name&gt; &lt;password&gt;<br>sentinel auth-pass redis-cluster ${REDIS_PASSWD}<br>. . .</pre><h3>Restart services</h3><pre>$ systemctl restart ${SERVICE_NAME}</pre><h3>Check the Cluster State with authentication enabled.</h3><ul><li>Now you can reach anyone of your redis-cluster member using the set password</li></ul><pre>$ redis-cli -h ${REDIS_SRV} -p ${REDIS_PORT_USED} -a ${PASSWORD} info replication</pre><p>You should see information about the cluster replication displayed in your terminal.</p><h3>redis-cli, the Redis command line interface</h3><p>redis-cli is the Redis command line interface, a simple program that allows to send commands to Redis, and read the replies sent by the server, directly from the terminal.</p><p>💬 port 6379 for redis-srv and port 26379 for sentinel</p><h3>redis-cluster test</h3><ul><li>Check redis-cluster status</li></ul><pre>${SERVER_IP}:26379&gt; sentinel ckquorum  redis-cluster<br>OK 3 usable Sentinels. Quorum and failover authorization can be reached</pre><ul><li>returns list of slaves</li></ul><pre>${SERVER_IP}:26379&gt; sentinel slaves redis-cluster</pre><ul><li>returns list of master</li></ul><pre>${SERVER_IP}:26379&gt; sentinel master  redis-cluster</pre><ul><li>initiate failover</li></ul><pre>${SERVER_IP}:26379&gt; sentinel failover redis-cluster</pre><ul><li>get list of slaves and master</li></ul><pre>${SERVER_IP}:26379&gt; sentinel slaves redis-cluster</pre><ul><li>returns list of master</li></ul><pre>${SERVER_IP}:26379&gt; sentinel master  redis-cluster</pre><ul><li>Initiate the failover</li></ul><pre>${SERVER_IP}:26379&gt; sentinel failover redis-cluster</pre><h3>A complete configuration example</h3><p>Hoping it’ll help someone one day, I put my configuration files on <em>Github</em>; here is the repository url: <a href="https://github.com/orsius/redis-cluster">github.com/orsius/redis-cluster</a></p><p><a href="https://github.com/orsius/redis-cluster.git">orsius/redis-cluster</a></p><p><em>Keep calm</em> and continue using <em>redis-cluster</em> ッ<br>G.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=944ac5b17f45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Usefulness of an MQ layer in an ELK stack (2017)]]></title>
            <link>https://medium.com/@orsius/truch-58640db6b0ae?source=rss-b3b335db8f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/58640db6b0ae</guid>
            <category><![CDATA[message-broker]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[message-queue]]></category>
            <dc:creator><![CDATA[Gautier Franchini]]></dc:creator>
            <pubDate>Thu, 12 Nov 2020 15:52:54 GMT</pubDate>
            <atom:updated>2020-11-12T16:03:09.572Z</atom:updated>
            <content:encoded><![CDATA[<h3>USEFULNESS OF AN MQ LAYER IN AN ELK STACK <em>(2017)</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MeClUlN0GkL1mEjlFoSTQQ.jpeg" /></figure><h4>First things first, disambiguation; let’s talk about these strange words. (2017)</h4><h4>What does ELK means?</h4><p>An <a href="https://www.elastic.co/elastic-stack">ELK stack</a> is composed of <a href="https://www.elastic.co/elasticsearch/">Elasticsearch</a>, <a href="https://www.elastic.co/logstash">Logstash</a>, and <a href="https://www.elastic.co/kibana">Kibana</a>; these 3 components are owned by the elastic.co company and are particularly useful to handle Data. <em>(ship, enrich, index and search your Data)</em></p><h4>What does MQ means?</h4><p>In computer science, The message queue paradigm is a sibling of the publisher/subscriber pattern.<br>You can imagine an MQ component works like several mailboxes; meaning that publisher(s)/subscriber(s) do not interact with the message at the same time, many publishers can post a message for one subscriber and vice versa.</p><p><em>➡ </em><a href="https://redis.io/"><em>Redis</em></a> or <a href="https://kafka.apache.org/"><em>Kafka</em></a> or <a href="https://www.rabbitmq.com/"><em>RabbitMQ</em></a> can be used as buffer in the ELK stack.</p><h4>What is . . .</h4><ul><li><strong>Redis</strong> is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.</li><li><strong>RabbitMQ</strong> is open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover.</li><li><strong>Apache Kafka</strong> is a robust open-source, scalable pub/sub message queue system originally developed by LinkedIn.</li></ul><h4>OK, now I’ve got a better understanding, but why should I use that in a my ELK stack?</h4><p>When it comes to the Elastic Stack ecosystem, there’s no “one and only one best approach”, it always depends on your precise use case and requirements. You need to ask yourself what is important to you or to your end-users and then design your solution accordingly.</p><p>ℹ️ To give you a quick answer, just remember that your MQ cluster will prevent your ELK stack against <strong>Event Spikes</strong>!</p><p>Spike of data is very common in a production environments; An example?<br>You’re indexing (real time) your web-server logs (apache); Your company is the target of an IP Flood <em>(a type of Denial of Service attack)</em> ; therefore the logs a grow exponentially; and logstash (your filtering element) will be soon overloaded; with an MQ system you’ll prevent (at least for a moment, depending your MQ cluster setup) your logging chain to failed.</p><p>In an elk architecture, processing is typically split into different stages <strong>Shipping</strong>, <strong>Filtering </strong><em>(drop, enrich data)</em> and <strong>Indexing</strong>.</p><p>Logstash <em>(or beat or any other shipper)</em> instance that receives data from different data sources is responsible to immediately persist data received to a Kafka topic, redis key, rabbitMQ queue, its a producer. On the other side, a Logstash instance <em>(filtering one)</em> will consume data, at its own throttled speed, while performing transformations (enriching data) and indexed it into Elasticsearch.</p><p>From an administrator point of view, it can make your live easier to apply release upgrade. As you may know, elastic publish news version of its elements very often, and to be able to work together in a very efficient way they need to be align on the same version. Cutting your stack with a MQ layer allow you to be able to update elasticsearch cluster independently and then plan to upgrade the other components later next week … etc.</p><p><strong>An MQ cluster makes your ELK stack stronger!</strong></p><p>💬 But of course don’t forget that an <strong>MQ cluster</strong> is yet another piece of software you need to tend to in your production environment <em>(monitoring, maintain your component up to date); </em>You need also to have good knowledge of your MQ software to be able to configure it properly, secured it and do the troubleshooting when something bad append.</p><p>See You folks, and let’s start indexing stuff with ELK <strong>ッ</strong></p><p>G.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58640db6b0ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>