Glusterfs Not Replicating data
Asked Answered
O

2

6

I have a glusterfs setup with two nodes (Node1 and Node2). I see connection has made between two connection. Problem is when I create some folders on Node1 it does not replicate it on Node2. Please suggest me to overcome if any one had fixed it?

If I mount it on some other server as glusterfs client and create files and folders then its replicating to glusterfs nodes. Is this behavior normal?

Volume Name: testvol
Type: Replicate
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: gluster1.example.com:/var/www/drupal7/sites/default/files
Brick2: gluster2.example.com:/var/www/drupal7/sites/default/files
Outwash answered 19/6, 2014 at 11:5 Comment(0)
B
8

Gluster volumes are supposed to access and update only via the clients. I saw a similar post by you on the same. Below links are suggested if you don't want to install the client in another node and install in the same server itself.

http://gopukrish.wordpress.com/glusterfs/
http://gopukrish.wordpress.com/high-availability-load-balanced-wordpress-site/
Buckra answered 16/7, 2014 at 15:57 Comment(1)
in your blog I saw server1:/datavol /var/www glusterfs _netdev,fetch-attempts=10 0 0 what does it mean?Tabernacle
E
5

I am not certain what you mean when you use the word 'node'. Gluster is generally made up of bricks, volumes, and hosts.

volumes are generally made up of bricks hosted on hosts. In your example you created a replicated volume named testvol made up of two bricks. One brick is on gluster1.example.com and the other is on gluster2.example.com.

bricks are just places that gluster stores things. They are not themselves replicated or distributed and you are not meant to access them.

volumes are replicated and/or distributed. volumes do not appear in your filesystem until you mount them somewhere.

It is my experience that "gluster" people frown upon having gluster running along with other applications in the same server, but setting that aside and continuing with your example, what you are trying to achieve can be accomplished by re-arranging your thinking a little.

  • Create a folder named /brick on gluster1.example.com
  • Create a folder named /brick on gluster2.example.com
  • Now create your gluster volume named testvol using gluster1.example.com:/brick and gluster2.example.com/brick
  • you will need to start the volume too.
  • next you need to mount your new testvol in your filesystem on gluster1.example.com and gluster2.example.com. Execute something like:

mkdir /mytestvol mount -t glusterfs gluster1.example.org:testvol /mytestvol

on each host. It is /mytestvol which is the replicated gluster filesystem. The bricks are used by gluster for its own purposes. /mytestvol is your view into the replicated gluster volume.

Assuming you mounted testvol on /mytestvol in both systems you can create files in /mytestvol on one of the systems and it will automatically appear on the other.

Now as to your example, you will probably want to move your files folder into /mytestvol and then soft-link back into your web server hierarchy. Something like:

mv /var/www/drupal7/sites/default/files /mytestvol ln -s /mytestvol/files /var/www/drupal7/sites/default/

Engineer answered 4/4, 2016 at 9:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.