{"id":461,"date":"2022-07-06T19:17:32","date_gmt":"2022-07-06T19:17:32","guid":{"rendered":"https:\/\/techtutelage.net\/?p=461"},"modified":"2024-02-13T19:28:51","modified_gmt":"2024-02-13T19:28:51","slug":"attach-a-block-volume-to-multiple-ubuntu-compute-instances-on-oracle-cloud-with-cluster-aware-ocfs2","status":"publish","type":"post","link":"https:\/\/techtutelage.net\/?p=461","title":{"rendered":"Attach a block volume to multiple Ubuntu compute instances on Oracle Cloud with cluster-aware OCFS2"},"content":{"rendered":"\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/n9q28qeb0Ms\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n\n\n\n<p><strong>WARNING!!!: This is not a tutorial. This article contains only the commands executed in the above video. For full step-by-step tutorial watch the video above!<\/strong><\/p>\n\n\n\n<p>Below you can fins all commands used in the video. IMPORTNAT: Each command must be executed on every node that will be a part of the cluster! <\/p>\n\n\n\n<p>Open \/etc\/iptables\/rules.v4 and add rule to open port 7777. <\/p>\n\n\n\n<p>iptables-restore  &lt; \/etc\/iptables\/rules.v4 &#8211; Reload iptables config file. <\/p>\n\n\n\n<p>apt install ocfs2-tools &#8211; Install ocfs2. <\/p>\n\n\n\n<p>uname -r &#8211; Get kernel version. <\/p>\n\n\n\n<p>apt install linux-modules-extra-X &#8211; Instal kernel modules (make sure replace X with your kernel version number. <\/p>\n\n\n\n<p>o2cb add-cluster ocfs2 &#8211; Create \/etc\/ofc2\/cluster.conf file and sets cluster named ocfs2. <\/p>\n\n\n\n<p>o2cb add-node ocfs2 NODE_NAME &#8211;ip PRIVATE_IP &#8211; Adds node to the cluster.conf run once for each node on every node. <\/p>\n\n\n\n<p>cat \/etc\/ocfs2\/cluster.conf &#8211; Examina cluster configuration file. <\/p>\n\n\n\n<p>dpkg-reconfigure ocfs2-tools &#8211; Configure the cluster setings. <\/p>\n\n\n\n<p>service o2cb start &#8211; Start the cluster. <\/p>\n\n\n\n<p>systemctl enable o2cb &#8211; Make service start on boot. <\/p>\n\n\n\n<p>systemctl enable ocfs2 &#8211; Make service start on boot <\/p>\n\n\n\n<p>sysctl kernel.panic=30 &#8211; Run this to set for kernel to work properly per Oracle <\/p>\n\n\n\n<p>sysctl kernel.panic_on_oops=1 &#8211; Run this to set for kernel to work properly per Oracle <\/p>\n\n\n\n<p>Open \/etc\/sysctl.conf and append the two lines below to the end of the file. <\/p>\n\n\n\n<p>kernel.panic=30 <\/p>\n\n\n\n<p>kernel.panic_on_oops=1 <\/p>\n\n\n\n<p>mkfs.ocfs2 -L &#8220;my_ocfs2_vol&#8221; \/dev\/sdb &#8211; Format your block storage. <\/p>\n\n\n\n<p>mkdir \/sharedstorage &#8211; Make mount point Add the line below to \/etc\/fstab per Oracle replace \/dev\/sdb with UUID <\/p>\n\n\n\n<p>\/dev\/sdb \/sharedstorage ocfs2 _netdev,defaults 0 0 <\/p>\n\n\n\n<p>blkid &#8211; Get UUID <\/p>\n\n\n\n<p>mount -a &#8211; Reload fstab and remount everything listed in it. <\/p>\n\n\n\n<p>o2cb register-cluster ocfs2 &#8211; Register cluster.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WARNING!!!: This is not a tutorial. This article contains only the commands executed in the above video. For full step-by-step tutorial watch the video above! Below you can fins all commands used in the video. IMPORTNAT: Each command must be executed on every node that will be a part of the cluster! Open \/etc\/iptables\/rules.v4 and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-tutorials","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=461"}],"version-history":[{"count":1,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":462,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/461\/revisions\/462"}],"wp:attachment":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}