{"id":709,"date":"2017-05-20T11:19:33","date_gmt":"2017-05-20T04:19:33","guid":{"rendered":"http:\/\/blog.trichev.com\/?p=709"},"modified":"2017-08-10T09:08:12","modified_gmt":"2017-08-10T02:08:12","slug":"glusterfs-3-6-1-add-replacement-hdd-to-a-glusterfs-volume","status":"publish","type":"post","link":"https:\/\/trichev.com\/blog\/2017\/05\/20\/glusterfs-3-6-1-add-replacement-hdd-to-a-glusterfs-volume\/","title":{"rendered":"GlusterFS 3.6.1 Add replacement HDD to a glusterfs volume"},"content":{"rendered":"<p>First, make sure a new HDD replaced and initialized correctly. In my example it&#8217;s \/dev\/sdc.<\/p>\n<p>Creating linux primary partition, formating as xfs and mounting to the same mount point as it was before:<br \/>\n<code>parted -a optimal \/dev\/sdc mkpart primary 0% 100%<br \/>\nmkfs.xfs -i size=512 \/dev\/sdc1<br \/>\nmount \/dev\/sdc1 \/export\/sdc1<br \/>\nmkdir -p \/export\/sdc1\/brick1<\/code><\/p>\n<p><code>gluster volume info gfsvol<\/code> &#8211; BrickN server1-gluster:\/export\/sdc1\/brick1 should be listed here<\/p>\n<p><code>Volume Name: gfsvol<br \/>\nType: Replicate<br \/>\nVolume ID: def9e71b-e3cd-4d25-a604-e53aa717e744<br \/>\nStatus: Started<br \/>\nNumber of Bricks: 1 x 2 = 2<br \/>\nTransport-type: tcp<br \/>\nBricks:<br \/>\nBrick1: server1-gluster:\/export\/sdc1\/brick1<br \/>\nBrick2: server2-gluster:\/export\/sdc1\/brick1<\/code><\/p>\n<p><code>gluster volume heal gfsvol full<\/code><br \/>\nAnother transaction is in progress for gfsvol. Please try again after sometime.<\/p>\n<p><code>ls -ltr \/var\/log\/glusterfs<\/code><\/p>\n<p><code>cat etc-glusterfs-glusterd.vol.log<\/p>\n<p>[2017-05-17 23:57:24.089817] W [socket.c:611:__socket_rwv] 0-management: readv on \/var\/run\/6a4503614e8aae691f635297ed0dca19.socket failed (Invalid argument)<br \/>\nThe message \"I [MSGID: 106005] [glusterd-handler.c:4142:__glusterd_brick_rpc_notify] 0-management: Brick server1-gluster:\/export\/sdc1\/brick1 has disconnected from glusterd.\" repeated 39 times between [2017-05-17 23:55:27.065833] and [2017-05-17 23:57:24.091004]<br \/>\n[2017-05-17 23:57:27.090603] W [socket.c:611:__socket_rwv] 0-management: readv on \/var\/run\/6a4503614e8aae691f635297ed0dca19.socket failed (Invalid argument)<br \/>\n[2017-05-17 23:57:27.091934] I [MSGID: 106005] [glusterd-handler.c:4142:__glusterd_brick_rpc_notify] 0-management: Brick server1-gluster:\/export\/sdc1\/brick1 has disconnected from glusterd.<br \/>\n[2017-05-17 23:57:30.091171] W [socket.c:611:__socket_rwv] 0-management: readv on \/var\/run\/6a4503614e8aae691f635297ed0dca19.socket failed (Invalid argument)<\/code><\/p>\n<p><code>gluster volume heal gfsvol full<\/code><br \/>\nCommit failed on server2-gluster. Please check log file for details.<\/p>\n<p><code>cat \/var\/log\/glusterfs\/bricks\/export-sdc1-brick1.log<\/code><\/p>\n<p><code>[2017-05-17 23:35:29.469536] I [MSGID: 100030] [glusterfsd.c:2018:main] 0-\/usr\/sbin\/glusterfsd: Started running \/usr\/sbin\/glusterfsd version 3.6.1 (args: \/usr\/sbin\/glusterfsd -s server1-gluster --volfile-id gfsvol.server1-gluster.export-sdc1-brick1 -p \/var\/lib\/glusterd\/vols\/gfsvol\/run\/server1-gluster-export-sdc1-brick1.pid -S \/var\/run\/6a4503614e8aae691f635297ed0dca19.socket --brick-name \/export\/sdc1\/brick1 -l \/var\/log\/glusterfs\/bricks\/export-sdc1-brick1.log --xlator-option *-posix.glusterd-uuid=c876c33a-3605-4c5c-b773-8d5e85655111 --brick-port 49153 --xlator-option gfsvol-server.listen-port=49153)<br \/>\n[2017-05-17 23:35:29.608846] I [graph.c:269:gf_add_cmdline_options] 0-gfsvol-server: adding option 'listen-port' for volume 'gfsvol-server' with value '49153'<br \/>\n[2017-05-17 23:35:29.608880] I [graph.c:269:gf_add_cmdline_options] 0-gfsvol-posix: adding option 'glusterd-uuid' for volume 'gfsvol-posix' with value 'c876c33a-3605-4c5c-b773-8d5e85655111'<br \/>\n[2017-05-17 23:35:29.640944] I [rpcsvc.c:2142:rpcsvc_set_outstanding_rpc_limit] 0-rpc-service: Configured rpc.outstanding-rpc-limit with value 64<br \/>\n[2017-05-17 23:35:29.641025] W [options.c:898:xl_opt_validate] 0-gfsvol-server: option 'listen-port' is deprecated, preferred is 'transport.socket.listen-port', continuing with correction<br \/>\n[2017-05-17 23:35:29.656007] E [posix.c:5604:init] 0-gfsvol-posix: Extended attribute trusted.glusterfs.volume-id is absent<br \/>\n[2017-05-17 23:35:29.656026] E [xlator.c:425:xlator_init] 0-gfsvol-posix: Initialization of volume 'gfsvol-posix' failed, review your volfile again<br \/>\n[2017-05-17 23:35:29.656034] E [graph.c:322:glusterfs_graph_init] 0-gfsvol-posix: initializing translator failed<br \/>\n[2017-05-17 23:35:29.656041] E [graph.c:525:glusterfs_graph_activate] 0-graph: init failed<br \/>\n[2017-05-17 23:35:29.656750] W [glusterfsd.c:1194:cleanup_and_exit] (--&gt; 0-: received signum (0), shutting down<br \/>\n<\/code><\/p>\n<p>&#8220;[2017-05-17 23:35:29.656007] E [posix.c:5604:init] 0-gfsvol-posix: Extended attribute trusted.glusterfs.volume-id is absent&#8221; &#8211; here it is. Let&#8217;s add extended attribute.<\/p>\n<p><code>grep volume-id \/var\/lib\/glusterd\/vols\/gfsvol\/info | cut -d= -f2 | sed 's\/-\/\/g'<br \/>\ndef9e71be3cd4d25a604e53aa717e744<\/code><\/p>\n<p><code>setfattr -n trusted.glusterfs.volume-id -v 0xdef9e71be3cd4d25a604e53aa717e744 \/export\/sdc1\/brick1<br \/>\n<\/code><br \/>\n<code>service glusterd restart<\/code><\/p>\n<p>Just to confirm:<br \/>\n<code>getfattr -d -m . -e hex \/export\/sdc1\/brick1<\/code><\/p>\n<p>Check if it&#8217;s getting synced:<br \/>\n<code>while [ 1 ]; do du -sh \/export\/sdc1\/brick1; sleep 30; done<\/code><\/p>\n<p>Start heal process again<br \/>\n<code>gluster volume heal gfsvol full<\/code><\/p>\n<p><code>gluster volume heal gfsvol info<\/code><\/p>\n<p>Links: <a href=\"https:\/\/serverfault.com\/questions\/710220\/how-do-you-add-a-replacement-hdd-to-a-glusterfs-volume\">https:\/\/serverfault.com\/questions\/710220\/how-do-you-add-a-replacement-hdd-to-a-glusterfs-volume<\/a><br \/>\n<a href=\"https:\/\/joejulian.name\/blog\/replacing-a-brick-on-glusterfs-340\/\">https:\/\/joejulian.name\/blog\/replacing-a-brick-on-glusterfs-340\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, make sure a new HDD replaced and initialized correctly. In my example it&#8217;s \/dev\/sdc. Creating linux primary partition, formating as xfs and mounting to the same mount point as it was before: parted -a optimal \/dev\/sdc mkpart primary 0% 100% mkfs.xfs -i size=512 \/dev\/sdc1 mount \/dev\/sdc1 \/export\/sdc1 mkdir -p \/export\/sdc1\/brick1 gluster volume info gfsvol [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[231],"tags":[212,220,32,28,14,11],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/709"}],"collection":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/comments?post=709"}],"version-history":[{"count":7,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/709\/revisions"}],"predecessor-version":[{"id":716,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/709\/revisions\/716"}],"wp:attachment":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/media?parent=709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/categories?post=709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/tags?post=709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}