<?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 Avi Mor on Medium]]></title>
        <description><![CDATA[Stories by Avi Mor on Medium]]></description>
        <link>https://medium.com/@avmor?source=rss-8eb1b2c9d3f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*CVLeUIzGN3teFnLF1ChDRw.jpeg</url>
            <title>Stories by Avi Mor on Medium</title>
            <link>https://medium.com/@avmor?source=rss-8eb1b2c9d3f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:21:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@avmor/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[Deploying Red Hat Ceph Storage 4.0 On Azure VMs with Cockpit and Red Hat Enterprise Linux 8.0]]></title>
            <link>https://medium.com/swlh/deploying-red-hat-ceph-storage-4-0-on-azure-vms-with-cockpit-and-red-hat-enterprise-linux-8-0-43d1278b3f2a?source=rss-8eb1b2c9d3f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/43d1278b3f2a</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ceph]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <dc:creator><![CDATA[Avi Mor]]></dc:creator>
            <pubDate>Fri, 17 Apr 2020 12:12:15 GMT</pubDate>
            <atom:updated>2020-04-21T16:00:15.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*VMLBlv47lpf6oR2t8qI-gw.png" /></figure><p>In this article we are going to deploy Red Hat Ceph Storage 4.0 (RHCS 4.0) on Azure VMs with Cockpit. The deployment shown is for testing purposes and not for a production environment.</p><h3>Ceph installation made easy</h3><p>In RHCS 4.0, Ceph installation is much easier than before. In this version, we can use the Cockpit Web Console which gives the ability to run the Ceph installation with GUI.</p><p>Under the hood ceph-ansible is still used to run the installation, but the advantage is that you don&#39;t need to be proficient in Ansible. All you need to do is to choose your hosts, choose the role of each host in the cluster(that is, choose which hosts are the OSDs, which are the MONs, RGWs, MDSs and so on) and begin the installation process.</p><p>In this demo — we’re going to install a RHCS 4.0 cluster on top of Azure VMs.</p><h3>Deploying the Azure VMs</h3><p>Our cluster will be built from 5 VMs:</p><p>In addition to the cluster hosts, there is a need for one additional VM: the Ansible Controller ( ceph-deployer).</p><p>The steps shown below are for all the VMs created but please note that some steps only apply to some hosts and not to others:</p><p>Choose your VM name and image. Choose Red Hat Enterprise Linux 8.0 for all the hosts (click on <em>Browse all public and private images</em> to find the RHEL 8.0 image).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lQvq64Yo8M68ypp0.png" /></figure><p>Choose the VM size based on your needs. We’re going with the B2s VM size for all the machines, as it’s enough for a test cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yJ53AG1KiTw_9Yn8.png" /></figure><p>Configure the Networking. If not already set, change the <em>NIC network security group</em> to <em>Basic</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RBvTviruy3MmA65u.png" /></figure><p>Choose your OS disk, here we’re going with Premium SSD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wRvxbAlCmAk77ZIz.png" /></figure><p><em>For OSD hosts only</em>: Add Data disks. Click on <em>Create and attach a new disk</em>. Choose a disk size suitable for your needs. We are going with three 8 [GiB] Premium SSD disks. Three osd daemon will use these three disks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TdjLWjM-lpQm9YA_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wKI4yX686dt5a_hb.png" /></figure><p>Finish the installation process as you see fit — the <em>Advanced</em> and <em>Tags</em> tabs are optional and can be left as they are by default.</p><p>After all the VMs are deployed, go to the Virtual Machines page and filter by the suitable Resource Group. You should see your 5 machines in Running state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nyuAA2WXLLS7FUaK.png" /></figure><p>To check your VMs are responding by pinging them. For that, ICMP needs to be allowed. This is achieved by clicking on the VM name, navigating to <em>Networking</em> under <em>Settings</em> and then clicking on <em>Add inbound port rule</em>.</p><p>Every time you open a port, whether it’s ICMP or port 9090 that needs to be opened on the ceph-deployer host in order to allow access from the browser to Cockpit, make sure to add the rule on both the subnet and the network interface.</p><p>In addition, beware of security issues; you can allow access only to your network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FU6pkp0JZyP_W6G-.png" /></figure><p>Another thing you can do is set Static IP for the hosts and also a DNS name. Both things can be done by navigating to the <em>Overview</em> tab on the VM page and then clicking on <em>Public IP address</em>. By default, the IP address given to an Azure VM is dynamic, which means it changes with each restart.</p><h3>Install RHCS 4.0 using Cockpit</h3><p>SSH to ceph-deployer :</p><p>ssh &lt;user&gt;@&lt;ceph-deployer-ip/ceph-deployer-dns-name&gt;</p><p>Register your RHEL 8.0 machine with your credentials. The full manual is here — <a href="https://access.redhat.com/solutions/253273">https://access.redhat.com/solutions/253273</a>:</p><p>sudo subscription-manager list --available --all</p><p>Find the pool that includes your RHCS subscription and attach it:</p><pre>sudo subscription-manager list --available --all<br>sudo subscription-manager attach --pool=&lt;POOL_ID&gt;</pre><p>Enable the RHEL 8.0 repos on your machine:</p><pre>sudo subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms<br>sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms</pre><p>Run update and wait for it to finish:</p><p>sudo dnf update -y</p><p>Enable the RHCS 4 Tools and Ansible repos in order to install the Cockpit Ceph Installer:</p><p>sudo subscription-manager repos --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms --enable=ansible-2.8-for-rhel-8-x86_64-rpms</p><p>Install Cockpit on the deployer:</p><pre>sudo yum install cockpit cockpit-dashboard<br>sudo firewall-cmd --add-port=9090/tcp<br>sudo firewall-cmd --permanent --add-port=9090/tcp<br>sudo systemctl enable cockpit.socket<br>sudo systemctl start cockpit.socket</pre><p>Install the Cockpit Ceph Installer:</p><p>sudo dnf install cockpit-ceph-installer</p><p>Log in to the Red Hat registry:</p><p>sudo podman login -u CUSTOMER_PORTAL_USERNAME <a href="https://registry.redhat.io/">https://registry.redhat.io</a></p><p>If not already there, add <em>registry.redhat.io</em> to <em>registries.conf</em>:</p><pre>vim /etc/containers/registries.conf </pre><pre>[registries.search] <br>registries = [&#39;registry.redhat.io&#39;, &#39;registry.access.redhat.com&#39;, &#39;registry.fedoraproject.org&#39;, &#39;registry.centos.org&#39;, &#39;docker.io&#39;]</pre><p>As the Ansible user, start the ansible-runner-service using sudo:</p><p>sudo ansible-runner-service.sh -s</p><p>Before going ahead with the Installation via Cockpit, let us make a few changes in the Ansible playbooks that will be run. First, let’s make a change in the site.yml file and add some tasks that will register our target hosts and enable the needed repos:</p><pre>cd /usr/share/ceph-ansible vim site.yml</pre><p>In the pre-tasks, after the gather facts task, add the following tasks:</p><pre>- name: register to Red Hat<br>  redhat_subscription:<br>    state: present<br>    username: &quot;&lt;user-name&gt;&quot;<br>    password: &quot;&lt;password&gt;&quot;<br>    pool_ids: &quot;&lt;pool-id&gt;&quot;<br>    <br>- name: Add baseos<br>  command: &quot;sudo subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms&quot;<br>  <br>- name: Add appstream-rpms<br>  command: &quot;sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms&quot;<br>  <br>- name: install lsb_release<br>  yum:<br>    name: redhat-lsb-core<br>    state: latest</pre><p>If you run the Metrics role on a standalone host (and not collocated on another host such as the Monitor host), make sure you change the prerequisite_rhcs_cdn_install.yml file in order to make sure the Red Hat Storage Tools Repository is enabled on the Metrics host:</p><p>sudo vim roles/ceph-common/tasks/installs/prerequisite_rhcs_cdn_install.yml</p><p>At the <em>enable red hat storage tools repository</em> task, change the when to:</p><p>(grafana_server_group_name in group_names or rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names or iscsi_gw_group_name in group_names or client_group_name in group_names)</p><p>Next, copy the Cockpit Ceph Installer SSH key to all nodes in the cluster:</p><p>sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub _ANSIBLE_USER_@_HOST_NAME_</p><p>In our case:</p><pre>sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub sds@&lt;ceph-metrics-ip/ceph-metrics-dns-name&gt;</pre><pre>sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub sds@&lt;ceph-mon-ip/ceph-mon-dns-name&gt;</pre><pre>sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub sds@&lt;ceph-osd0-ip/ceph-osd0-dns-name&gt;</pre><pre>sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub sds@&lt;ceph-osd1-ip/ceph-osd1-dns-name&gt;</pre><pre>sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub sds@&lt;ceph-osd2-ip/ceph-osd2-dns-name&gt;</pre><p>Go to Cockpit on your browser (latest versions of Chrome/Fireforx) at &lt;ceph-deployer-ip/ceph-deployer-dns-name&gt;:9090. In order to use Cockpit on your browser when it runs on top of an Azure VM, the 9090 port needs to be opened on the machine via the Azure Portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5ENzYb-HWwCrgaun.png" /></figure><p>Go to the Ceph Installer on the sidebar. The full installation process is well-documented in the following guide, starting from section 3.6 — <a href="https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/4/html-single/installation_guide/index#installing-red-hat-ceph-storage-using-the-cockpit-Web-interface">https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/4/html-single/installation_guide/index#installing-red-hat-ceph-storage-using-the-cockpit-Web-interface</a>.</p><p>In the Environment page, we’re setting the following:</p><ul><li>Cluster Type: Development/POC</li><li>Service Account token: If you do not have a Red Hat Registry Service Account, create one using the Registry Service Account webpage — <a href="https://access.redhat.com/terms-based-registry/">https://access.redhat.com/terms-based-registry/</a>.</li><li>Installation type: RPM</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yjAhLotQcqdbs-s9.png" /></figure><p>Click on <em>Hosts</em> and then choose the role for each host:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xHIgOaxLPqBcdTU4.png" /></figure><p>Click on <em>Validate</em> to validate your deployment. Click on <em>Probe Hosts</em> to start the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*paTe88887ccjU63a.png" /></figure><p>There are some warning messages because the hosts chosen are not strong enough for production. However, since the Cluster Type is set to Development/POC, it will allow us to continue.</p><p>Click on <em>Network</em> to choose your networking settings for the cluster. Afterwards, click on <em>Review</em> to get an overview of the settings made:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iG7SHn6DJI9qBQ-4.png" /></figure><p>Click on <em>Deploy</em> to move to the last screen. Afterwards, click <em>save</em> and start the installation.</p><p>At the end of the process, we have a Ceph cluster ready for use:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nHVti5Cyms1thijO.png" /></figure><p>Note that by default, the radosgw binds on the internal interface and on port 8080. In export to allow interaction with the outside world, the port needs to be opened in the Azure portal. You can open any port you may need on any machine (for example, to access the Grafana dashboard, open port 3000 on the ceph-metrics host).</p><h3>Ceph Installer logs</h3><p>If something fails during the Cockpit Installation process and you want to know why, you can find the full output of the Ansible roles that are run at /usr/share/ansible-runner-service/artifacts. Enter the relevant directory there and check stdout for the full output.</p><h3>Conclusion</h3><p>In this demo, I introduced to you how to deploy RHCS 4.0 on Azure VMs. It has truly become easier than ever before. I hope that this tutorial will help you get some experience with Ceph.</p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43d1278b3f2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/deploying-red-hat-ceph-storage-4-0-on-azure-vms-with-cockpit-and-red-hat-enterprise-linux-8-0-43d1278b3f2a">Deploying Red Hat Ceph Storage 4.0 On Azure VMs with Cockpit and Red Hat Enterprise Linux 8.0</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing The Ceph Cluster Maps]]></title>
            <link>https://medium.com/swlh/managing-the-ceph-cluster-maps-1093b81178d3?source=rss-8eb1b2c9d3f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1093b81178d3</guid>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ceph]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <dc:creator><![CDATA[Avi Mor]]></dc:creator>
            <pubDate>Fri, 03 Apr 2020 20:54:39 GMT</pubDate>
            <atom:updated>2020-04-18T15:59:27.077Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ceph — Managing The Ceph Cluster Maps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*qQoGSiNKBHjsv_9UIMjafQ.png" /></figure><h3>Cluster Map</h3><p>In Ceph there is the Cluster Map, which is a collection of several maps. Generally, the MON Map is the key-component in Ceph; for this reason, when a client starts and tries to interact with the cluster, the first step is to interact with the MON to retrieve the cluster map and discover the location of all the other cluster component, like: OSDs, other MONs, MDSs. Once that happens, the client can directly communicate with other daemons to retrieve the data successfully from Ceph.</p><ul><li><strong>MON Map:</strong> Contains the address of the others mons, fsid of the cluster and indicates the current epochs.</li><li><strong>OSD Map:</strong> Contains the details of the OSDs, the pools in the cluster, CRUSH map and epochs of the OSDs, replica size, PG numbers.</li><li><strong>PG Maps:</strong> Contain the list of the pg’s. Acting set, upset, state of PG’s, PG’s ID, PG’s version.</li><li><strong>MDS Map:</strong> Contain the address and status of each MDS and list of metadata servers and their status ( Up / In).</li><li><strong>MGR Map:</strong> Contains the MGR modules that are enabled.</li><li><strong>Service Map:</strong> Track the changes of component that related to the librados, like: Radosgw, RBD, CephFS.</li></ul><h4><strong>MGR dump example: (Part of the output). Please note that my cluster is collected — All the daemons are in the same cluster.</strong></h4><pre>{<br>   &quot;epoch&quot;: 212,<br>   &quot;active_gid&quot;: 174121,<br>   &quot;active_name&quot;: &quot;mon0&quot;,<br>   &quot;active_addrs&quot;: {<br>   &quot;addrvec&quot;: [<br>        {<br>            &quot;type&quot;: &quot;v2&quot;,<br>            &quot;addr&quot;: &quot;192.168.42.10:6800&quot;,<br>            &quot;nonce&quot;: 1202<br>        },<br>        {<br>            &quot;type&quot;: &quot;v1&quot;,<br>            &quot;addr&quot;: &quot;192.168.42.10:6801&quot;,<br>            &quot;nonce&quot;: 1202<br>         }<br>       ]<br>     },<br>    &quot;active_addr&quot;: &quot;192.168.42.10:6801/1202&quot;,<br>    &quot;active_change&quot;: &quot;2020-04-03 18:41:05.887473&quot;,<br>    &quot;available&quot;: true,<br>    &quot;standbys&quot;: [],<br>    &quot;modules&quot;: [<br>      &quot;dashboard&quot;,<br>      &quot;prometheus&quot;<br>     ],</pre><h4>MON dump example:</h4><pre> epoch 1<br> fsid 2cba2661-4a5d-4900-9802-de34ee0a41d5<br> last_changed 2020-03-22 14:35:40.696521<br> created 2020-03-22 14:35:40.696521<br> min_mon_release 14 (nautilus)<br> 0: [v2:192.168.42.10:3300/0,v1:192.168.42.10:6789/0] mon.mon0</pre><h4>What is the command to dump each of the maps?</h4><pre>ceph mon dump</pre><pre>ceph osd dump</pre><pre>ceph pg dump</pre><pre>ceph fs dump</pre><pre>ceph mgr dump</pre><pre>ceph service dump</pre><h4>Where are the Ceph maps stored?</h4><p>The cluster maps are saved in a Key-Value DB, such as LevelDB or RocksDB.</p><h4>How to retrieve the epoch for each map:</h4><p>The epoch is the version of the map. When a change happens in the cluster, the epoch of the map is changed. To see the epoch, type the command:</p><pre>ceph -s -f json-pretty</pre><h4>Examples of MON epoch:</h4><pre>&quot;monmap&quot;: {<br><strong><em>    &quot;epoch&quot;: 1,</em></strong><strong><br></strong>    &quot;fsid&quot;: &quot;2cba2661-4a5d-4900-9802-de34ee0a41d5&quot;,<br>    &quot;modified&quot;: &quot;2020-03-22 14:35:40.696521&quot;,<br>    &quot;created&quot;: &quot;2020-03-22 14:35:40.696521&quot;,<br>    &quot;min_mon_release&quot;: 14,<br>    &quot;min_mon_release_name&quot;: &quot;nautilus&quot;,<br>    &quot;features&quot;: {<br>        &quot;persistent&quot;: [<br>            &quot;kraken&quot;,<br>            &quot;luminous&quot;,<br>            &quot;mimic&quot;,<br>            &quot;osdmap-prune&quot;,<br>            &quot;nautilus&quot;<br>        ],<br>        &quot;optional&quot;: []</pre><h4>Example of MGR epoch:</h4><pre>&quot;mgrmap&quot;: {<br><strong><em>    &quot;epoch&quot;: 212,</em></strong><strong><br></strong>    &quot;active_gid&quot;: 174121,<br>    &quot;active_name&quot;: &quot;mon0&quot;,<br>    &quot;active_addrs&quot;: {<br>        &quot;addrvec&quot;: [<br>            {<br>                &quot;type&quot;: &quot;v2&quot;,<br>                &quot;addr&quot;: &quot;192.168.42.10:6800&quot;,<br>                &quot;nonce&quot;: 1202<br>            },<br>            {<br>                &quot;type&quot;: &quot;v1&quot;,<br>                &quot;addr&quot;: &quot;192.168.42.10:6801&quot;,<br>                &quot;nonce&quot;: 1202<br>            }<br>        ]<br>    },</pre><h4>Example of OSD epoch:</h4><pre>&quot;osdmap&quot;: {<br>    &quot;osdmap&quot;: {<br><strong><em>        &quot;epoch&quot;: 251,</em></strong><strong><br></strong>        &quot;num_osds&quot;: 6,<br>        &quot;num_up_osds&quot;: 5,<br>        &quot;num_in_osds&quot;: 5,<br>        &quot;num_remapped_pgs&quot;: 0<br>    }<br>},</pre><h4>How does the client (S3, RBD, FS) connect with the MON?</h4><p>The client needs at least one available MON in the cluster to interact with. The best practice is to have an odd number of MONs in a production environment. Once the client connects to the MON, it retrieves the cluster maps. If one of the monitors goes down, the client searches for another monitor in the cluster.</p><p>Therefore, it is important that all MONs will be fully-synchronized and have the same epoch. Otherwise the mons would be a point of failure.</p><h4>The PAXOS algorithm:</h4><p>As mentioned before, in a production the number of MONs should be an odd number. In order to be able to maintain it, Ceph uses an algorithm called PAXOS, and this algorithm works by this way:</p><p>Paxos is a distributed consensus algorithm. Every time the MON epoch has changed and a MON has modified a map, it sends the update to the other MONs. This way the MONs keep the cluster synchronized and consistent. Finally, Ceph commits the updates of the epoch after all of the MONs agreed about the state.</p><p>Please remember that when there are write changes, Ceph uses the PAXOS algorithm. And when there is a read. It means when the client should read the maps, it reads directly from the key-value store.</p><h4>Monitor Quorum:</h4><p>In every cluster with multiple MONs, there is a leader, and every non-leader is called a peon. Every time that a MON is restarted, there is an election, and a new leader is chosen.</p><p>The leader always asks the other MONs to give the epochs, for the simple reason that a MON can be outside the cluster for a while and once it gets into the cluster again, it must be up-to-date. In case that a MON is not responding to this request — the MON will be marked as out of the cluster.</p><h4>Managing the MONs:</h4><pre>ceph mon dump </pre><pre>ceph mon get map -o binfile - Export a binary copy of the current map</pre><pre>monmaptool --print binfile - Display human readable</pre><h4>Monitor leases:</h4><p>When there is a quorum, the leader sends short-terms leases to the others monitors in the cluster. Allowing them to distribute the cluster map to OSDs and clients.</p><p>The lease is for about three seconds, and the leader renews it periodically. Once one of the peons is not responding to the renewal request, this MON will leave the quorum.</p><p>There are situations when a peon is not getting any response from the leader, the peon assumes that the leader is not alive anymore and the peon will ask for an election for a new leader to be chosen.</p><h4>OSD Map:</h4><p>The OSD Map keeps changing while OSDs join or leave the cluster (for various reasons, including hardware failure). For example if there is any aggressive workload from the customers, There is a change that the OSDs should start flapping (Out and in from the cluster). When an OSD joins a cluster, its PGs begin peering. During this peering process, IO is temporarily halted, so in the event of a number of OSD’s flapping, the client IO can be severely impacted.</p><p>Unlike the situation with the MONs, in the world of the OSDs there are no leaders or peons.</p><p>Each OSD has an epoch number and in this way OSDs can understand between themselves which OSDs are not up to date.</p><p>There is something called peering. Peering basically is the process that all the OSDs that store a placement-group (PG) are getting approval between them about that state of the objects in that PG.</p><p>When a client is talking with some OSDs, the OSD checks the epoch, if there is any difference, the OSD will increment so that the client can update its OSD map.</p><h4>Some useful commands:</h4><pre>ceph osd dump</pre><pre>ceph osd get map -o bin file - Export a binary copy of the current map.</pre><pre>osdmaptool --print binfile - Display a human-readable copy of the map to standard output</pre><pre>osdmaptool --export-crush crushbinfile binfile - Extract the crush map from the osd map.</pre><pre>osdmaptool --import-crush crushbinfile bin file - Import a new crush map.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1093b81178d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/managing-the-ceph-cluster-maps-1093b81178d3">Managing The Ceph Cluster Maps</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ceph — What is Multipart upload, OMAP, and Resharding?]]></title>
            <link>https://levelup.gitconnected.com/ceph-what-is-multipart-upload-omap-and-resharding-b72d339c939f?source=rss-8eb1b2c9d3f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b72d339c939f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[ceph]]></category>
            <dc:creator><![CDATA[Avi Mor]]></dc:creator>
            <pubDate>Sat, 21 Mar 2020 19:37:18 GMT</pubDate>
            <atom:updated>2021-07-15T01:03:49.218Z</atom:updated>
            <content:encoded><![CDATA[<h3>FCeph — What is Multipart upload, OMAP, and Resharding?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*t3zJ6VGo4a-6uDZU6YwoDA.png" /></figure><h3>What is Multipart?</h3><p>Generally, with multipart you can upload large object files in parts. The multipart includes three steps, as specified below.</p><p>The benefits of multipart uploads are the following:</p><ul><li>Pause/Resume the necessary parts;</li><li>Improve performance — better throughput</li><li>Upload the object during creation.</li></ul><h3>The three steps:</h3><ul><li><strong>Multipart Upload Initiation:</strong> When a request comes to upload an object file, the first thing you get is the Upload ID. This is a unique number/identifier for your upload.</li><li><strong>Parts Upload:</strong> It’s important to remember that besides the upload ID, we need the part ID. It means that for every upload, there’s Upload ID and Part ID. Please note, if you upload a new file with an existing Part ID, this part will be overwritten.</li><li><strong>Multipart Upload Completion or Abort</strong>: In order to complete the multipart process, we need to finish uploading all our parts. Only when the process is completed, we get the ACK that all the parts are okay, and only then can we mark the upload as completed. Please note that if the upload process is aborted, then the multipart process gets stuck and never ends, unless there’s a lifecycle rule, or you re-upload the multipart objects files again.</li></ul><h3>Let’s practice:</h3><p>First, you can use the Ceph-Nano project to create a Ceph cluster. Here you can find more detail about it: <a href="https://github.com/ceph/cn">https://github.com/ceph/cn</a>.</p><p>Once the cluster is working and ready, follow these steps to understand what multipart looks like in the Ceph pool.</p><p>Let’s have a look at how an object looks in the pool after it gets uploaded. Start by uploading an object:</p><pre>aws s3 cp avi_test s3://test --endpoint-url <a href="http://localhost:8080/">http://localhost:8080</a></pre><p>Then, let’s view the pool called: <strong>default.rgw.buckets.data</strong> with the command:</p><pre>rados ls -p default.rgw.buckets.data</pre><p>By default, this pool contains all the data users have uploaded to the cluster via RGW. The output should be something like:</p><pre>cdeb898f-18fb-4509-b886-5bd67c627abb.14119.1_avi_test</pre><p>Please note that <strong>cdeb898f-18fb-4509-b886–5bd67c627abb.14119.1</strong> is the bucket marker.</p><p>For multipart to take place, we can use the awscli tool. I have to say, the user side should set the multipart threshold for the multipart chuncks. let’s create one with dd command:</p><pre>dd if=/dev/zero of=testfile bs=1024 count=10240</pre><p>You can also use the truncate command:</p><pre>truncate -s 20M text.txt</pre><p>Let’s upload this file. The awscli tool supports multipart upload by default.</p><pre>aws s3 cp testfile s3://test --endpoint-url <a href="http://localhost:8080/">http://localhost:8080</a></pre><p>Type the command “rados ls -p pool name” again, Please note that this time, it looks like:</p><pre>cdeb898f-18fb-4509-b886-5bd67c627abb.14119.1__multipart_testfile.2~Ebr8ghHTE-SGwufDxS_GaDp6WnZ9AA7.1</pre><p>As I mentioned earlier, we have an Upload ID and a Part ID:</p><p><strong><em>UploadID:</em></strong> .2~Ebr8ghHTE-SGwufDxS_GaDp6WnZ9AA7 | <strong><em>PartID:</em></strong> . 1 (at the end of the line)</p><p>Also, if we run the command:</p><pre>radosgw-admin bucket stats | grep &quot;bucket name&quot; -A 15</pre><p>We will see that the bucket id is unchanged:</p><pre>&quot;id&quot;: &quot;cdeb898f-18fb-4509-b886-5bd67c627abb.14119.1&quot;</pre><p>When multipart is used, objects are uploaded to a pool called: <strong>“default.rgw.buckets.non-ec”</strong>. This pool will be empty when multipart is not in use. Only when multipart is running we will see objects in this pool.</p><p>To see all the multipart uploads status, run the command:</p><pre>aws s3api list-multipart-uploads --bucket my-bucket</pre><h3>The GC (Garbage Collector):</h3><p>When users delete files or upload files with the same name, the files are overwritten (also in re-multipart), and Ceph will insert them into something called GC.</p><p>Ceph does not remove the files immediately, we can use the commands to list all the files scheduled for removal:</p><pre>radosgw-admin gc list</pre><p>And:</p><pre>radosgw-admin gc list --include-all</pre><p>specify — include-all to list all entries, including unexpired.</p><p>By default, Ceph waits for 2 hours between gc cycles. To manually run the gc deletion process, run:</p><pre>radosgw-admin gc process --include-all</pre><h3>Ceph index and resharding</h3><h4>What is OMAP?</h4><p>The index object’s OMAP contains the key-value for all the objcet’s in the pool.</p><p>The important thing is the pool called: <strong>“default.rgw.buckets.index”</strong>. Basically it’s is the index of the bucket. Let’s run the command:</p><pre>rados ls -p default.rgw.buckets.index</pre><p>We will see the bucket id, beginning with ״.dir.״:</p><pre>.dir.cdeb898f-18fb-4509-b886-5bd67c627abb.14119.1</pre><p>To list the objects inside this bucket, write the following command:</p><pre>rados listomapkeys -p default.rgw.buckets.index .dir.cdeb898f-18fb-4509-b886-5bd67c627abb.14119.1</pre><p>Output:</p><pre>avi_test</pre><p>There are some situations when the OMAP gets bigger and bigger, for example: 10 Million objects in one OMAP. It will probably impact our performance. Basically, we read the index while write request is sent, then it search for the right place that the object should be writen.</p><p>Because of that, we can use the resharding option, this command takes a large OMAP and cuts it into pieces. So for one bucket, we will have a few OMAPs. The best practice is 100,000 objects per shard.</p><p>To check the status of every bucket we can use the command:</p><pre>radosgw-admin check limit | grep &quot;OVER 100.000000%&quot;</pre><p>This command finds for us the buckets that have large OMAPs.</p><p>Partial output:</p><pre>&quot;fill_status&quot;: &quot;OVER 100.000000%&quot;</pre><p>It means that the bucket gets over the limit, and we need to make the resharding process.</p><p>Important thing: Please note, when the resharding process is running, there is no I/O to this bucket, although this is a rather quick process for buckets that are not so big. My suggestion is, before every reshard process, please consult with the support about it.</p><p>To list all buckets, use the following command:</p><pre>radosgw-admin bucket list</pre><p>Once we found the problematic buckets, we can use the command:</p><pre>radosgw-admin bucket reshard --num-shard 2 --bucket=test</pre><p>We will see that now, we have 2 OMAPS:</p><pre>rados ls -p default.rgw.buckets.index</pre><pre>.dir.cdeb898f-18fb-4509-b886-5bd67c627abb.14270.1.0<br>.dir.cdeb898f-18fb-4509-b886-5bd67c627abb.14270.1.1</pre><p>Basically, we will see that parts of the files are located in the first OMAP and the other files are in the second one.</p><p>To change the value of max objects per shard, edit the value (please consult with the support beforehand):</p><pre>rgw_max_objects_per_shard = 100000 to something else.</pre><h3>What is RGW dynamic bucket index resharding?</h3><p>Basically, working with a large environment, the resharding process can be very discouraging. This feature can help with that, it detects the problematic bucket and runs the process in the background and creates the required shards to this bucket.</p><h4>How does it work?</h4><p>When a new object is added to the bucket. Also, there is an automatic background process that runs periodically. Once we have the required bucket, the bucket is added to the reshard queue.</p><p>To list all the bucket that is currently in the list, type the command:</p><pre>radosgw-admin reshard list</pre><p>To check the status of the process:</p><pre>radosgw-admin reshard status --bucket &lt;bucket_name&gt;</pre><p>Enable/Disable dynamic bucket index resharding, make the change in: /etc/ceph/ceph.conf, under rgw section.</p><pre>rgw_dynamic_resharding = true</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b72d339c939f" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/ceph-what-is-multipart-upload-omap-and-resharding-b72d339c939f">Ceph — What is Multipart upload, OMAP, and Resharding?</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to configure RGW multisite in Ceph]]></title>
            <link>https://medium.com/swlh/how-to-configure-rgw-multisite-in-ceph-65e89a075c1f?source=rss-8eb1b2c9d3f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/65e89a075c1f</guid>
            <category><![CDATA[ceph]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[Avi Mor]]></dc:creator>
            <pubDate>Sat, 07 Mar 2020 17:08:39 GMT</pubDate>
            <atom:updated>2020-03-07T17:08:39.860Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is for deploying multisite on ceph-nano. There are a few dangerous commands, so make sure that you understand what are you doing before you implement this on a production environment.</p><h3>What is Multisite in Ceph Storage?</h3><p>The multisite configuration gives us the ability to replicate multiple Ceph clusters. The master cluster will replicate the data from one object store cluster to the secondary object store cluster.</p><p>Let’s talk a bit about CRR, which is an AWS Feature. Generally, CRR is a self-service that AWS supports for replication of buckets. In CRR, by default, every S3 object that is uploaded to some bucket will be replicated to a bucket in another region.</p><p>Basically, with CRR we can choose which bucket to replicate, while with Multisite — we replicate, by default, the entire cluster to another site. However, there is an option to replicate only specific buckets in Ceph (see below). The multisite configuration is done by the Ceph Administrator and for now it’s not self-service like in AWS.</p><p>Multisite is an interesting option; we can use it in two configurations:</p><ul><li>Active/Active replication;</li><li>Failover and failback.</li></ul><h3>Things to understand before configuring Multisite:</h3><p>It is important to say that by default the RGW will not replicate anything. We use the default realm, zone and zonegroup. In order to be able to configure multisite, we will have to know a few things to make this operation work.</p><h3>What is a Realm, a Zonegroup and a Zone?</h3><p>Realm: A realm represents the global namespace for all objects and bucket in multisite replication space. Basically, it holds the “Zonegroup”, and Zonegroups hold the zone. In the end, we take 2 clusters and we set something called namespace, and that gives us the option to work on both of them.</p><p>Zonegroup: The master Zonegroup will hold few zones: master zone and secondary zone for example. The data will replicate from the master zone to the secondary zone. Important to say, in every zonegroup we have at least one master zone.</p><p>Zone: Each zone is backed by at least on radosgw, there can be more.</p><h3>Different Architectures:</h3><p>Single zone: Basically it contain one zonegroup and one zone in a realm.</p><p>Multizone: Contains one Zonegroup; this zonegroup can contain few zones. We have at least one master zone, and in this way we can replicate the data to the others zones.</p><p>Multi zone group: Contains multiple zonegroups. In every zonegroup there is one zone or more.</p><p>Multiregion: Contains multiple namespaces, each contains zonegroups and zones.</p><h3>What are Periods and Epochs?</h3><p>Basically, every realm (Namespace) has something called Period. In Periods, there is something called epoch, which represents the version of the period.</p><p>When will the epochs change? In every change that we make in our cluster, we generate a new version of the epoch.</p><h3>Demo:</h3><p>In our Demo, we will use the ceph-nano project for configuring the multisite. You can find more information here: <a href="https://github.com/ceph/cn">https://github.com/ceph/cn</a>.</p><p>The first step is to create 2 Ceph clusters: master and slave. After the containers will be created, we can enter to the container with:</p><pre>docker exec -it “Container ID” bash</pre><p>Login to the Master Cluster with the command above.</p><p>The first step is to configure a realm. We will need to create a new default realm. By default when the RGW service is started, it searches for the default realm. And the default realm is called “Default”. Now we will override this by simple command:</p><pre>radosgw-admin realm create --default --rgw-realm=gold</pre><p>By using — default we can set this realm as default.</p><p>Create master zonegroup. Before, you can remove the default one by the command:</p><pre>radosgw-admin zonegroup delete --rgw-zonegroup=default</pre><p>Then just create:</p><pre>radosgw-admin zonegroup create --rgw-zonegroup=us --master --default --endpoint=http://”master_ip”:8000</pre><p>Please note that we are using “ — master” to set this zonegroup as master.</p><p>Create a master zone:</p><pre>radosgw-admin zone create --rgw-zone=us-east --master--rgw-zonegroup=us --endpoints=http://”master_ip” --access-key=1234567 --secret=098765 --default</pre><p>Please note that our zone is called: us-east. This zone is going to be the master, because of the “ — master” flag. We also set the endpoint that will serve the requests for this master zone. And finally, we created a replication user.</p><p>Let’s create the system user:</p><pre>radosgw-admin user create --uid=repuser --display-name=”Replication_user” --access-key=1234567 --secret=098765 --system</pre><p>Please note, remember to set the same access key and secret key as you set in the master zone creation.</p><p>Add the configuration into the /etc/ceph/ceph.conf file under rgw section:</p><pre>rgw zone = us-east</pre><p>The final step is to commit the change with:</p><pre>radosgw-admin period update --commit</pre><p>Please note, we should get the epoch number- which is 1. Also, please restart the container for the changes will be applied.</p><h3>Configure Secondary Zone:</h3><p>Please login to the secondary container, which is the “Slave” one:</p><pre>docker exec -it “Container ID” bash</pre><p>Pull the realm configuration:</p><pre>radosgw-admin realm pull --rgw-realm=gold --url=http://”master_ip:8000” --access-key=1234567 --secret=098765 --default</pre><p>Please note, we set the Ceph Master IP, and also the credentials for the replication user that we created before.</p><p>Next step is to pull the period:</p><pre>radosgw-admin period pull --url=http://”master_ip:8000” --access-key=1234567 --secret=098765</pre><p>At this point, we are now in the same realm and the same namespace (Realm + Period).</p><p>Create a secondary zone:</p><pre>radosgw-admin zone create --rgw-zone=us-west --rgw-zonegroup=us --endpoints=http://”secondary_ip:8001” --access=1234567 --secret=098765  --default</pre><p>Optional: We can set a flag of “ — read-only” — it means that clients will be able to upload objects only to the master zone and then the objects will be replicated to the secondary zone. Remember: Metadata actions will also be updated from the master zone.</p><p>Add the configuration into /etc/ceph/conf/ceph.conf file under the rgw section:</p><pre>rgw zone = us-west</pre><p>Let’s commit the Update by:</p><pre>radosgw-admin period update --commit</pre><p>Also, please restart the container for the changes will be applied.</p><h3>Useful commands:</h3><p>Check sync status:</p><pre>radosgw-admin sync status</pre><p>List all realm:</p><pre>radosgw-admin realm list</pre><p>List the periods:</p><pre>radosgw-admin period list</pre><p>List the zone groups:</p><pre>radosgw-admin zonegroup list</pre><p>List the zones:</p><pre>radosgw-admin zone list</pre><p>How to enable/disable replication of a specific bucket to another zone:</p><pre>radosgw-admin bucket sync [enable/disable] --bucket=&lt;bucket&gt;</pre><h3>How to test?</h3><p>First create a new user with the command:</p><pre>radosgw-admin user create --uid &quot;avi&quot; --display-name &quot;avi mor&quot;</pre><p>We use awcli to interact with the S3 protocol. Download awscli and configure it:</p><pre>aws configure</pre><p>Insert the access key and the secret key of the user that you created before.</p><p>create a bucket with the master endpoint. Then switch the endpoint to the secondary endpoint.</p><pre>aws s3 mb s3://avi --endpoint-url http://&quot;master_ip:8000&quot;</pre><p>on the master cluster:</p><pre>aws s3 ls s3:// --endpoint-url http://&quot;master_ip:8000&quot;</pre><p>Output should be:</p><pre>2020-03-06 20:25:12 avi</pre><p>on the secondary cluster:</p><pre>aws s3 ls s3:// --endpoint-url http://&quot;secondary_ip:8001&quot;</pre><p>Output should be the same as the master cluster. The bucket should be replicated across the clusters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65e89a075c1f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/how-to-configure-rgw-multisite-in-ceph-65e89a075c1f">How to configure RGW multisite in Ceph</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>