Hostname: 172.17.0.3 Uuid: 6b04331d-6fe9-4d78-937e-b10c69f476fa State: Peer in Cluster (Connected)
创建复本卷
1 2 3 4 5
gluster volume create gv0 replica 2 172.17.0.2:/gluster/data 172.17.0.3:/gluster/data Replica 2 volumes are prone to split-brain. Use Arbiter or Replica 3 to avoid this. See: http://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/. Do you still want to continue? (y/n) y volume create: gv0: failed: The brick 172.17.0.3:/gluster/data is being created in the root partition. It is recommended that you don't use the system's root partition for storage backend. Or use 'force' at the end of the command if you want to override this behavior.
按提示,增加force参数
如果在启动容器时,没有设置--privileged参数,则会报如下错误。
1 2 3
gluster volume create gv0 replica 2 172.17.0.2:/gluster/data 172.17.0.3:/gluster/data force volume create: gv0: failed: Glusterfs is not supported on brick: 172.17.0.2:/gluster/data. Setting extended attributes failed, reason: Operation not permitted.
所以只能删除容器,再次启动,并加入--privileged参数。
再次执行gluster volume create命令,执行成功。
1 2
gluster volume create gv0 replica 2 172.17.0.2:/gluster/data 172.17.0.3:/gluster/data force volume create: gv0: success: please start the volume to access data