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
./sshd sshd re-exec requires execution with an absolute path
输入全路径执行命令,继续出现错误,如下:
1 2 3 4 5
/usr/sbin/sshd Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_ecdsa_key Could not load host key: /etc/ssh/ssh_host_ed25519_key sshd: no hostkeys available -- exiting.
执行sshd-keygen命令解决上述问题
1 2 3 4
/usr/sbin/sshd-keygen Generating SSH2 RSA host key: [ OK ] Generating SSH2 ECDSA host key: [ OK ] Generating SSH2 ED25519 host key: [ OK ]
给root生成一个密码
1 2 3 4 5 6
passwd root Changing password for user root. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully.
ssh root@localhost root@localhost's password: Last failed login: Sun Sep 29 09:16:59 UTC 2019 from localhost on ssh:notty There were 3 failed login attempts since the last successful login. Connection to localhost closed.
会遇到连不上去的问题,这时,需要修改/etc/ssh/sshd_config配置。
把里面的UsePAM yes改为UsePAM no
杀掉之前sshd进程后,再次启动
1 2
/usr/sbin/sshd WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several problems.
这时就可以成功登录了。
1 2 3
root@localhost root@localhost's password: Last login: Sun Sep 29 09:20:41 2019 from localhost
生成一个新的镜像
退出容器,并查看容器id
1 2 3
docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ca6a84a514c2 centos "bash" 34 minutes ago Exited (255) 11 seconds ago musing_goodall