首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >即使是根用户,当我尝试在Ubuntu14.04LXC容器之间创建糖浆卷时,我也会收到“不允许的操作”。

即使是根用户,当我尝试在Ubuntu14.04LXC容器之间创建糖浆卷时,我也会收到“不允许的操作”。
EN

Server Fault用户
提问于 2018-09-16 02:08:27
回答 1查看 700关注 0票数 -2

即使是根用户,当尝试在Ubuntu14.04LXC容器之间创建糖浆卷时,我也会收到“不允许的操作”。

需要在安装之前在本地测试解决方案,即使在本地,我也无法安装。

代码语言:javascript
复制
xfce4-terminal -T LocalTerm  

出口

在LocalTerm:

代码语言:javascript
复制
PS1='[\u@\h]-[\D{%T}]-[\W] => '  

lxc profile copy default default-bkp  
lxc profile set default raw.lxc lxc.apparmor.profile=unconfined  

clear   
lxc stop ubt1404X64C001  
lxc stop ubt1404X64C002  

lxc delete ubt1404X64C001  
lxc delete ubt1404X64C002  

lxc launch ubuntu:14.04 ubt1404X64C001  
lxc launch ubuntu:14.04 ubt1404X64C002  

clear  
sleep 10  

lxc list --format csv  

lxc config get ubt1404X64C001 security.privileged  
lxc config set ubt1404X64C001 security.privileged true  
lxc config get ubt1404X64C002 security.privileged  
lxc config set ubt1404X64C002 security.privileged true  
lxc restart ubt1404X64C001  
lxc restart ubt1404X64C002    

xfce4-terminal -T ubt1404X64C001Term -e "bash -c 'lxc exec ubt1404X64C001 -- /bin/bash; exec bash; exit 0;'"   
xfce4-terminal -T ubt1404X64C002Term -e "bash -c 'lxc exec ubt1404X64C002 -- /bin/bash; exec bash; exit 0;'"   

在ubt1404X64C001Term和ubt1404X64C002Term:

代码语言:javascript
复制
PS1='[\u@\h]-[\D{%T}]-[\W] => '  
echo '' >> /etc/hosts  
apt-get update   

apt-get upgrade  
apt-get dist-upgrade  
apt-get autoremove  
apt-get install netcat net-tools  
lsb_release -a  
    No LSB modules are available.  
    Distributor ID: Ubuntu  
    Description:    Ubuntu 14.04.5 LTS  
    Release:    14.04  
    Codename:   trusty  
uname -a  
    Linux ubt1404X64C002 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux  
cat /etc/fstab  
    LABEL=cloudimg-rootfs   /    ext4   defaults    0 0       
apt-get install attr fuse libaio1 liburcu-dev libxml2 python2.7 python-pip rpcbind   
echo '' > ~/testAttr  
setfattr -n user.name -v "UserNameValue" ~/testAttr  
setfattr -n trusted.glusterfs.test -v "working" ~/testAttr  
getfattr -d -m - ~/testAttr  
    trusted.glusterfs.test="working"  
    user.name="UserNameValue"  
add-apt-repository ppa:gluster/glusterfs-4.1  
apt-get update  
    W: Failed to fetch   
    http://ppa.launchpad.net/gluster/glusterfs-4.1/ubuntu/dists  
    /trusty/main/binary-amd64/Packages  404  Not Found  
    E: Some index files failed to download. They have been ignored, or old ones used instead.  
    but available to: artful,bionic,cosmic,devel and xenial  
apt-get install glusterfs-server glusterfs-client open-iscsi watchdog    
glusterfs --version | grep built  
    glusterfs 3.4.2 built on Jan 14 2014 18:05:35  
    Not installed 4.1 version because apt-get update failed with error above to trusty version  

在ubt1404X64C002Term:

代码语言:javascript
复制
ifconfig eth0 | grep 'inet '  
    20.30.40.50  
echo '10.20.30.40 ubt1404X64C001' >> /etc/hosts   
cat /etc/hostname  
ping ubt1404X64C001  
iptables -I INPUT -p all -s ubt1404X64C001 -j ACCEPT  

在ubt1404X64C001Term:

代码语言:javascript
复制
ifconfig eth0 | grep 'inet '  
    10.20.30.40  
echo '20.30.40.50 ubt1404X64C002' >> /etc/hosts  
cat /etc/hostname  
ping ubt1404X64C002  
iptables -I INPUT -p all -s ubt1404X64C002 -j ACCEPT  

mkdir -p /root/tomirrorwith/glusterfs  
cd /root/tomirrorwith/glusterfs   
gluster peer probe ubt1404X64C002  
    peer probe: success  
gluster peer status   
    Hostname: ubt1404X64C002    
    Port: 24007    
    State: Peer in Cluster (Connected)    
gluster volume create gv0 replica 2 ubt1404X64C001:/root/tomirrorwith/glusterfs ubt1404X64C002:/root/tomirrorwith/glusterfs force  
    volume create: gv0: failed  
    ------  
    /var/log/glusterfs/cli.log at ubt1404X64C001  
        W [rpc-transport.c:175:rpc_transport_load] 0-rpc-transport: missing 'option transport-type'. defaulting to "socket"  
        I [socket.c:3480:socket_init] 0-glusterfs: SSL support is NOT enabled  
        I [socket.c:3495:socket_init] 0-glusterfs: using system polling thread  
        I [cli-cmd-volume.c:392:cli_cmd_volume_create_cbk] 0-cli: Replicate cluster type found. Checking brick order.  
        I [cli-cmd-volume.c:304:cli_cmd_check_brick_order] 0-cli: Brick order okay  
        I [cli-rpc-ops.c:805:gf_cli_create_volume_cbk] 0-cli: Received resp to create volume  
        I [input.c:36:cli_batch] 0-: Exiting with: -1   
    ------  
    /var/log/glusterfs/etc-glusterfs-glusterd.vol.log at ubt1404X64C002  
        E [glusterd-op-sm.c:3719:glusterd_op_ac_stage_op] 0-management: Stage failed on operation 'Volume Create', Status : -1  
    ------  

尝试在C001TermUbt1404X64上修复:

代码语言:javascript
复制
    cd /sys/module/fuse/parameters/  
    echo Y > userns_mounts  
        ERROR:  
            bash: userns_mounts: Permission denied  

关于Github的同样的问题

关于discuss.linuxcontainers.org的同样问题

EN

回答 1

Server Fault用户

发布于 2018-10-15 04:18:39

我不能在我的廉价云提供商上更改ubuntu版本,但是在ubuntu18.04上进行了本地测试。

在我的搜索中,我发现人们告诉ubuntu14.04不能运行固定版本的臀部,使得在这个ubuntu版本上不可能使用它。

即使解决了与这个问题相关的错误

在ubuntu18.04上安装版本4.1是可能的,它解决了上面的错误,但砂砾不镜像我镜像文件夹的内容,如下所示:

Xfce4端-T LocalTerm

出口

在LocalTerm:

代码语言:javascript
复制
PS1='[\u@\h]-[\D{%T}]-[\W] => '  

lxc profile copy default default-bkp  
lxc profile set default raw.lxc lxc.apparmor.profile=unconfined  

clear   
lxc stop ubt1804X64C001  
lxc stop ubt1804X64C002  

lxc delete ubt1804X64C001  
lxc delete ubt1804X64C002  

lxc launch ubuntu:18.04 ubt1804X64C001  
lxc launch ubuntu:18.04 ubt1804X64C002  

clear  
sleep 10  

lxc list --format csv  

lxc config get ubt1804X64C001 security.privileged  
lxc config set ubt1804X64C001 security.privileged true  
lxc config get ubt1804X64C002 security.privileged  
lxc config set ubt1804X64C002 security.privileged true  
lxc restart ubt1804X64C001  
lxc restart ubt1804X64C002    

xfce4-terminal -T ubt1804X64C001Term -e "bash -c 'lxc exec ubt1804X64C001 -- /bin/bash; exec bash; exit 0;'"   
xfce4-terminal -T ubt1804X64C002Term -e "bash -c 'lxc exec ubt1804X64C002 -- /bin/bash; exec bash; exit 0;'"   

在ubt1804X64C001Term和ubt1804X64C002Term:

代码语言:javascript
复制
PS1='[\u@\h]-[\D{%T}]-[\W] => '  
echo '' >> /etc/hosts  
apt-get update   

apt-get upgrade  
apt-get dist-upgrade  
apt-get autoremove  
apt-get install netcat net-tools  
lsb_release -a  
    No LSB modules are available.  
    Distributor ID: Ubuntu  
    Description:    Ubuntu 18.04.1 LTS  
    Release:    18.04  
    Codename:   bionic  
uname -a  
    Linux ubt1804X64C001 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux   
cat /etc/fstab  
    LABEL=cloudimg-rootfs   /    ext4   defaults    0 0  
apt-get install attr fuse libaio1 liburcu-dev libxml2 python2.7 python-pip rpcbind   
echo '' > ~/testAttr  
setfattr -n user.name -v "UserNameValue" ~/testAttr  
setfattr -n trusted.glusterfs.test -v "working" ~/testAttr  
getfattr -d -m - ~/testAttr  
    trusted.glusterfs.test="working"  
    user.name="UserNameValue"  
add-apt-repository ppa:gluster/glusterfs-4.1  
apt-get update  
    OK   
apt-get install glusterfs-server glusterfs-client open-iscsi watchdog 
glusterfs --version | grep 'glusterfs '  
    glusterfs 4.1.5    
mkdir -p /root/tomirrorwith/glusterfs  
cd /root/tomirrorwith/glusterfs   
ls

在ubt1804X64C002Term:

代码语言:javascript
复制
ifconfig eth0 | grep 'inet '  
    20.30.40.50  
echo '10.20.30.40 ubt1804X64C001' >> /etc/hosts   
cat /etc/hostname  
ping ubt1804X64C001  
iptables -I INPUT -p all -s ubt1804X64C001 -j ACCEPT  

在ubt1804X64C001Term:

代码语言:javascript
复制
ifconfig eth0 | grep 'inet '  
    10.20.30.40  
echo '20.30.40.50 ubt1804X64C002' >> /etc/hosts  
cat /etc/hostname  
ping ubt1804X64C002  
iptables -I INPUT -p all -s ubt1804X64C002 -j ACCEPT  

gluster peer probe ubt1804X64C002  
    peer probe: success  
gluster peer status   
    Number of Peers: 1  
    Hostname: ubt1804X64C002      
    Port: 24007  
    State: Peer in Cluster (Connected)  

gluster volume create gv0 replica 2 ubt1804X64C001:/root/tomirrorwith/glusterfs ubt1804X64C002:/root/tomirrorwith/glusterfs force  
    volume create: gv0: success: please start the volume to access data  
gluster volume start gv0  
    volume start: gv0: success 
echo 'TestValue' > TestFile

在ubt1804X64C002Term:

代码语言:javascript
复制
cd /root/tomirrorwith/glusterfs   
ls
# There is no TestFile created here on mirrored machine
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/931101

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档