{"id":26837,"date":"2022-11-29T01:46:19","date_gmt":"2022-11-28T17:46:19","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=26837"},"modified":"2022-11-29T01:46:37","modified_gmt":"2022-11-28T17:46:37","slug":"lxd-2-0-install-config","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lxd-2-0-install-config.html","title":{"rendered":"LXD 2.0 \u7cfb\u5217\uff08\u4e8c\uff09\uff1a\u5b89\u88c5\u4e0e\u914d\u7f6e"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u7b80\u5355\u6765\u8bf4\uff0cLXD\u662f\u4e00\u4e2a\u5b88\u62a4\u8fdb\u7a0b\uff0c\u4e3aLXC\u5bb9\u5668\u7684\u7ba1\u7406\u63d0\u4f9b\u4e00\u7ec4REST API\u3002\u4e3b\u8981\u76ee\u6807\u662f\u63d0\u4f9b\u4e00\u79cd\u7c7b\u865a\u62df\u673a\u7684\u7528\u6237\u4f53\u9a8c\uff0c\u662f\u4e00\u79cd\u7b2c\u4e09\u65b9\u7684\u5bb9\u5668\u7ba1\u7406\u5de5\u5177\u3002\u4e0b\u9762\u5462\uff0c\u6211\u4eec\u6765\u4ecb\u7ecdLXD 2.0 \u7684\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u5b89\u88c5\u7bc7<\/strong><\/div>\n

\u6709\u5f88\u591a\u79cd\u529e\u6cd5\u53ef\u4ee5\u83b7\u5f97 LXD\u3002\u6211\u4eec\u63a8\u8350\u4f60\u914d\u5408\u6700\u65b0\u7248\u7684 LXC \u548c Linux \u5185\u6838\u4f7f\u7528 LXD\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4eab\u53d7\u5230\u5b83\u7684\u5168\u90e8\u7279\u6027\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u73b0\u5728\u4e5f\u5728\u6162\u6162\u7684\u964d\u4f4e\u5bf9\u65e7\u7248\u672c Linux \u53d1\u5e03\u7248\u7684\u652f\u6301\u3002<\/p>\n

\"LXD\"<\/p>\n

Ubuntu \u6807\u51c6\u7248\u5b89\u88c5<\/strong><\/span><\/div>\n

\u6240\u6709\u65b0\u53d1\u5e03\u7684 LXD \u90fd\u4f1a\u5728\u53d1\u5e03\u51e0\u5206\u949f\u540e\u4e0a\u4f20\u5230 Ubuntu \u5f00\u53d1\u7248\u7684\u5b89\u88c5\u6e90\u91cc\u3002\u8fd9\u4e2a\u5b89\u88c5\u5305\u7136\u540e\u5c31\u4f1a\u4f5c\u4e3a Ubuntu \u7528\u6237\u7684\u5176\u4ed6\u5b89\u88c5\u5305\u6e90\u7684\u79cd\u5b50\u3002<\/p>\n

\u5982\u679c\u4f7f\u7528 Ubuntu 16.04\uff0c\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5\uff1a<\/p>\n

sudo apt install lxd<\/pre>\n

\u5982\u679c\u8fd0\u884c\u7684\u662f Ubuntu 14.04\uff0c\u5219\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5\uff1a<\/p>\n

sudo apt -t trusty-backports install lxd<\/pre>\n
Ubuntu Core\u5b89\u88c5<\/strong><\/span><\/div>\n

\u4f7f\u7528 Ubuntu Core \u7a33\u5b9a\u7248\u7684\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u5b89\u88c5 LXD\uff1a<\/p>\n

sudo snappy install lxd.stgraber<\/pre>\n
Ubuntu \u5b98\u65b9 PPA<\/strong><\/span><\/div>\n

\u4f7f\u7528\u5176\u4ed6 Ubuntu \u53d1\u5e03\u7248 \u2014\u2014 \u6bd4\u5982 Ubuntu 15.10 \u2014\u2014 \u7684\u7528\u6237\u53ef\u4ee5\u6dfb\u52a0\u4e0b\u9762\u7684 PPA\uff08Personal Package Archive\uff09\u6765\u5b89\u88c5\uff1a<\/p>\n

sudo apt-add-repository ppa:ubuntu-lxc\/stable\r\nsudo apt update\r\nsudo apt dist-upgrade\r\nsudo apt install lxd<\/pre>\n
Gentoo\u5b89\u88c5<\/strong><\/span><\/div>\n

Gentoo \u5df2\u7ecf\u6709\u4e86\u6700\u65b0\u7684 LXD \u5305\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5\uff1a<\/p>\n

sudo emerge --ask lxd<\/pre>\n
\u4f7f\u7528\u6e90\u4ee3\u7801\u5b89\u88c5<\/strong><\/span><\/div>\n

\u5982\u679c\u4f60\u66fe\u7ecf\u7f16\u8bd1\u8fc7 Go \u8bed\u8a00\u7684\u9879\u76ee\uff0c\u90a3\u4e48\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1 LXD \u5e76\u4e0d\u662f\u5341\u5206\u56f0\u96be\u3002\u7136\u800c\u6ce8\u610f\uff0c\u4f60\u9700\u8981 LXC \u7684\u5f00\u53d1\u5934\u6587\u4ef6\u3002\u4e3a\u4e86\u8fd0\u884c LXD\uff0c \u4f60\u7684\u53d1\u5e03\u7248\u9700\u4e5f\u8981\u4f7f\u7528\u6bd4\u8f83\u65b0\u7684\u5185\u6838\uff08\u6700\u8d77\u7801\u662f 3.13\uff09\u3001\u6bd4\u8f83\u65b0\u7684 LXC \uff081.1.4 \u6216\u66f4\u9ad8\u7248\u672c\uff09\u3001LXCFS \u4ee5\u53ca\u652f\u6301\u7528\u6237\u5b50 uid\/gid \u5206\u914d\u7684 shadow \u6587\u4ef6\u3002\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1 LXD \u7684\u6700\u65b0\u6559\u7a0b\u53ef\u4ee5\u5728\u4e0a\u6e38 README\u91cc\u627e\u5230\u3002<\/p>\n

Ubuntu \u4e0a\u7684\u7f51\u7edc\u914d\u7f6e<\/div>\n

Ubuntu \u7684\u5b89\u88c5\u5305\u4f1a\u5f88\u65b9\u4fbf\u7684\u7ed9\u4f60\u63d0\u4f9b\u4e00\u4e2a\u201clxdbr0\u201d\u7f51\u6865\u3002\u8fd9\u4e2a\u7f51\u6865\u9ed8\u8ba4\u662f\u6ca1\u6709\u914d\u7f6e\u8fc7\u7684\uff0c\u53ea\u63d0\u4f9b\u901a\u8fc7 HTTP \u4ee3\u7406\u7684 IPv6 \u7684\u672c\u5730\u8fde\u63a5\u3002<\/p>\n

\u8981\u914d\u7f6e\u8fd9\u4e2a\u7f51\u6865\u5e76\u6dfb\u52a0 IPv4 \u3001 IPv6 \u5b50\u7f51\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

sudo dpkg-reconfigure -p medium lxd<\/pre>\n

\u6216\u8005\u76f4\u63a5\u901a\u8fc7 LXD \u521d\u59cb\u5316\u547d\u4ee4\u4e00\u6b65\u4e00\u6b65\u7684\u914d\u7f6e\uff1a<\/p>\n

sudo lxd init<\/pre>\n
\u5b58\u50a8\u540e\u7aef<\/div>\n

LXD \u63d0\u4f9b\u4e86\u51e0\u79cd\u5b58\u50a8\u540e\u7aef\u3002\u5728\u5f00\u59cb\u4f7f\u7528 LXD \u4e4b\u524d\uff0c\u4f60\u5e94\u8be5\u51b3\u5b9a\u5c06\u8981\u4f7f\u7528\u7684\u540e\u7aef\uff0c\u56e0\u4e3a\u6211\u4eec\u4e0d\u652f\u6301\u5728\u540e\u7aef\u4e4b\u95f4\u8fc1\u79fb\u5df2\u7ecf\u751f\u6210\u7684\u5bb9\u5668\u3002<\/p>\n

ZFS<\/strong><\/span><\/p>\n

\u6211\u4eec\u7684\u63a8\u8350\u662f ZFS\uff0c \u56e0\u4e3a\u5b83\u80fd\u652f\u6301 LXD \u7684\u5168\u90e8\u7279\u6027\uff0c\u540c\u65f6\u63d0\u4f9b\u6700\u5feb\u548c\u6700\u53ef\u9760\u7684\u5bb9\u5668\u4f53\u9a8c\u3002\u5b83\u5305\u62ec\u4e86\u4ee5\u5bb9\u5668\u4e3a\u5355\u4f4d\u7684\u78c1\u76d8\u914d\u989d\u3001\u5373\u65f6\u5feb\u7167\u548c\u6062\u590d\u3001\u4f18\u5316\u540e\u7684\u8fc1\u79fb\uff08\u53d1\u9001\/\u63a5\u6536\uff09\uff0c\u4ee5\u53ca\u5feb\u901f\u4ece\u955c\u50cf\u521b\u5efa\u5bb9\u5668\u7684\u80fd\u529b\u3002\u5b83\u540c\u65f6\u4e5f\u88ab\u8ba4\u4e3a\u8981\u6bd4 btrfs \u66f4\u6210\u719f\u3002\u8981\u548c LXD \u4e00\u8d77\u4f7f\u7528 ZFS \uff0c\u4f60\u9700\u8981\u9996\u5148\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5 ZFS\u3002<\/p>\n

Ubuntu 16.04 ,\u53ea\u9700\u8981\u7b80\u5355\u7684\u4f7f\u7528\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n

sudo apt install zfsutils-linux<\/pre>\n

Ubuntu 15.10, \u4e0a\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5\uff1a<\/p>\n

sudo apt install zfsutils-linux zfs-dkms<\/pre>\n

\u5982\u679c\u662f\u66f4\u65e7\u7684\u7248\u672c\uff0c\u4f60\u9700\u8981\u4ece zfsonlinux PPA \u5b89\u88c5\uff1a<\/p>\n

sudo apt-add-repository ppa:zfs-native\/stable\r\nsudo apt update\r\nsudo apt install ubuntu-zfs<\/pre>\n

\u914d\u7f6e LXD \u53ea\u9700\u8981\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

sudo lxd init<\/pre>\n

\u8fd9\u6761\u547d\u4ee4\u63a5\u4e0b\u6765\u4f1a\u5411\u4f60\u63d0\u95ee\u4e00\u4e9b ZFS \u7684\u914d\u7f6e\u7ec6\u8282\uff0c\u7136\u540e\u4e3a\u4f60\u914d\u7f6e\u597d ZFS\u3002<\/p>\n

btrfs<\/strong><\/span><\/div>\n

\u5982\u679c ZFS \u4e0d\u53ef\u7528\uff0c\u90a3\u4e48 btrfs \u53ef\u4ee5\u63d0\u4f9b\u76f8\u540c\u7ea7\u522b\u7684\u96c6\u6210\uff0c\u4f46\u4e0d\u80fd\u6b63\u786e\u5730\u62a5\u544a\u5bb9\u5668\u5185\u7684\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5\uff08\u867d\u7136\u914d\u989d\u4ecd\u7136\u53ef\u7528\uff09\u3002 btrfs \u540c\u65f6\u62e5\u6709\u5f88\u597d\u7684\u5d4c\u5957\u5c5e\u6027\uff0c\u800c\u8fd9\u662f ZFS \u6240\u4e0d\u5177\u6709\u7684\u3002\u4e5f\u5c31\u662f\u8bf4\u5982\u679c\u4f60\u8ba1\u5212\u5728 LXD \u4e2d\u518d\u4f7f\u7528 LXD\uff0c\u90a3\u4e48 btrfs \u5c31\u5f88\u503c\u5f97\u4f60\u8003\u8651\u3002 \u4f7f\u7528 btrfs \u7684\u8bdd\uff0cLXD \u4e0d\u9700\u8981\u8fdb\u884c\u4efb\u4f55\u7684\u914d\u7f6e\uff0c\u4f60\u53ea\u9700\u8981\u4fdd\u8bc1 \/var\/lib\/lxd \u4fdd\u5b58\u5728 btrfs \u6587\u4ef6\u7cfb\u7edf\u4e2d\uff0c\u7136\u540e LXD \u5c31\u4f1a\u81ea\u52a8\u4e3a\u4f60\u4f7f\u7528 btrfs \u4e86\u3002<\/p>\n

LVM<\/strong><\/span><\/div>\n

\u5982\u679c ZFS \u548c btrfs \u90fd\u4e0d\u662f\u4f60\u60f3\u8981\u7684\uff0c\u4f60\u8fd8\u53ef\u4ee5\u8003\u8651\u4f7f\u7528 LVM \u4ee5\u83b7\u5f97\u90e8\u5206\u7279\u6027\u3002 LXD \u4f1a\u4ee5\u81ea\u52a8\u7cbe\u7b80\u914d\u7f6e\u7684\u65b9\u5f0f\u4f7f\u7528 LVM\uff0c\u4e3a\u6bcf\u4e2a\u955c\u50cf\u548c\u5bb9\u5668\u521b\u5efa LV\uff0c\u5982\u679c\u9700\u8981\u7684\u8bdd\u4e5f\u4f1a\u4f7f\u7528 LVM \u7684\u5feb\u7167\u529f\u80fd\u3002 \u8981\u914d\u7f6e LXD \u4f7f\u7528 LVM\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a LVM \u5377\u7ec4\uff0c\u7136\u540e\u8fd0\u884c\uff1a lxc config set storage.lvm_vg_name \"THE-NAME-OF-YOUR-VG\" \u9ed8\u8ba4\u60c5\u51b5\u4e0b LXD \u4f7f\u7528 ext4 \u4f5c\u4e3a\u5168\u90e8\u903b\u8f91\u5377\u7684\u6587\u4ef6\u7cfb\u7edf\u3002\u5982\u679c\u4f60\u559c\u6b22\u7684\u8bdd\u53ef\u4ee5\u6539\u6210 XFS\uff1a<\/p>\n

lxc config set storage.lvm_fstype xfs\r\n<\/pre>\n
\u7b80\u5355\u76ee\u5f55<\/strong><\/span><\/div>\n

\u5982\u679c\u4e0a\u9762\u5168\u90e8\u65b9\u6848\u4f60\u90fd\u4e0d\u6253\u7b97\u4f7f\u7528\uff0cLXD \u4f9d\u7136\u80fd\u5728\u4e0d\u4f7f\u7528\u4efb\u4f55\u9ad8\u7ea7\u7279\u6027\u60c5\u51b5\u4e0b\u5de5\u4f5c\u3002\u5b83\u4f1a\u4e3a\u6bcf\u4e2a\u5bb9\u5668\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u7136\u540e\u5728\u521b\u5efa\u6bcf\u4e2a\u5bb9\u5668\u65f6\u89e3\u538b\u7f29\u955c\u50cf\u7684\u538b\u7f29\u5305\uff0c\u5e76\u5728\u5bb9\u5668\u62f7\u8d1d\u548c\u5feb\u7167\u65f6\u8fdb\u884c\u4e00\u6b21\u5b8c\u6574\u7684\u6587\u4ef6\u7cfb\u7edf\u62f7\u8d1d\u3002<\/p>\n

\u9664\u4e86\u78c1\u76d8\u914d\u989d\u4ee5\u5916\u7684\u7279\u6027\u90fd\u662f\u652f\u6301\u7684\uff0c\u4f46\u662f\u5f88\u6d6a\u8d39\u78c1\u76d8\u7a7a\u95f4\uff0c\u5e76\u4e14\u975e\u5e38\u6162\u3002\u5982\u679c\u4f60\u6ca1\u6709\u5176\u4ed6\u9009\u62e9\uff0c\u8fd9\u8fd8\u662f\u53ef\u4ee5\u5de5\u4f5c\u7684\uff0c\u4f46\u662f\u4f60\u8fd8\u662f\u9700\u8981\u8ba4\u771f\u7684\u8003\u8651\u4e00\u4e0b\u4e0a\u9762\u7684\u51e0\u4e2a\u66ff\u4ee3\u65b9\u6848\u3002<\/p>\n

\u914d\u7f6e\u7bc7<\/strong><\/div>\n

LXD \u5b88\u62a4\u8fdb\u7a0b\u7684\u5b8c\u6574\u914d\u7f6e\u9879\u5217\u8868\u53ef\u4ee5\u5728\u8fd9\u91cc\u627e\u5230\u3002<\/p>\n

\u7f51\u7edc\u914d\u7f6e<\/strong><\/span><\/div>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b LXD \u4e0d\u4f1a\u76d1\u542c\u7f51\u7edc\u3002\u548c\u5b83\u901a\u4fe1\u7684\u552f\u4e00\u529e\u6cd5\u662f\u901a\u8fc7 \/var\/lib\/lxd\/unix.socket \u4f7f\u7528\u672c\u5730 unix \u5957\u63a5\u5b57\u8fdb\u884c\u901a\u4fe1\u3002\u8981\u8ba9 LXD \u76d1\u542c\u7f51\u7edc\uff0c\u4e0b\u9762\u6709\u4e24\u4e2a\u6709\u7528\u7684\u547d\u4ee4\uff1a<\/p>\n

lxc config set core.https_address [::]\r\nlxc config set core.trust_password some-secret-string\r\n<\/pre>\n

\u7b2c\u4e00\u6761\u547d\u4ee4\u5c06 LXD \u7ed1\u5b9a\u5230 IPv6 \u5730\u5740 \u201c::\u201d\uff0c\u4e5f\u5c31\u662f\u76d1\u542c\u673a\u5668\u7684\u6240\u6709 IPv6 \u5730\u5740\u3002\u4f60\u53ef\u4ee5\u663e\u5f0f\u7684\u4f7f\u7528\u4e00\u4e2a\u7279\u5b9a\u7684 IPv4 \u6216\u8005 IPv6 \u5730\u5740\u66ff\u4ee3\u9ed8\u8ba4\u5730\u5740\uff0c\u5982\u679c\u4f60\u60f3\u7ed1\u5b9a\u67d0\u4e2a TCP \u7aef\u53e3\uff08\u9ed8\u8ba4\u662f 8443\uff09\u7684\u8bdd\u53ef\u4ee5\u5728\u5730\u5740\u540e\u9762\u6dfb\u52a0\u7aef\u53e3\u53f7\u5373\u53ef\u3002<\/p>\n

\u7b2c\u4e8c\u6761\u547d\u4ee4\u8bbe\u7f6e\u4e86\u5bc6\u7801\uff0c\u7528\u4e8e\u8ba9\u8fdc\u7a0b\u5ba2\u6237\u7aef\u628a\u81ea\u5df1\u6dfb\u52a0\u5230 LXD \u53ef\u4fe1\u8bc1\u4e66\u4e2d\u5fc3\u3002\u5982\u679c\u5df2\u7ecf\u7ed9\u4e3b\u673a\u8bbe\u7f6e\u4e86\u5bc6\u7801\uff0c\u5f53\u6dfb\u52a0 LXD \u4e3b\u673a\u65f6\u4f1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801\uff0cLXD \u5b88\u62a4\u8fdb\u7a0b\u4f1a\u4fdd\u5b58\u4ed6\u4eec\u7684\u5ba2\u6237\u7aef\u8bc1\u4e66\u4ee5\u786e\u4fdd\u5ba2\u6237\u7aef\u662f\u53ef\u4fe1\u7684\uff0c\u8fd9\u6837\u5c31\u4e0d\u9700\u8981\u518d\u6b21\u8f93\u5165\u5bc6\u7801\uff08\u53ef\u4ee5\u968f\u65f6\u8bbe\u7f6e\u548c\u53d6\u6d88\uff09\u3002<\/p>\n

\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u4e0d\u8bbe\u7f6e\u5bc6\u7801\uff0c\u800c\u662f\u4eba\u5de5\u9a8c\u8bc1\u6bcf\u4e2a\u65b0\u5ba2\u6237\u7aef\u662f\u5426\u53ef\u4fe1\u2014\u2014\u8ba9\u6bcf\u4e2a\u5ba2\u6237\u7aef\u53d1\u9001\u201cclient.crt\u201d\uff08\u6765\u81ea\u4e8e ~\/.config\/lxc\uff09\u6587\u4ef6\uff0c\u7136\u540e\u628a\u5b83\u6dfb\u52a0\u5230\u4f60\u81ea\u5df1\u7684\u53ef\u4fe1\u8bc1\u4e66\u4e2d\u5fc3\uff1a<\/p>\n

lxc config trust add client.crt<\/pre>\n
\u4ee3\u7406\u914d\u7f6e<\/strong><\/span><\/div>\n

\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f60\u4f1a\u60f3\u8ba9 LXD \u5b88\u62a4\u8fdb\u7a0b\u4ece\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u83b7\u53d6\u955c\u50cf\u3002\u5982\u679c\u4f60\u5904\u5728\u4e00\u4e2a\u5fc5\u987b\u901a\u8fc7 HTTP(s) \u4ee3\u7406\u94fe\u63a5\u5916\u7f51\u7684\u73af\u5883\u4e0b\uff0c\u4f60\u9700\u8981\u5bf9 LXD \u505a\u4e00\u4e9b\u914d\u7f6e\uff0c\u6216\u4fdd\u8bc1\u5df2\u5728\u5b88\u62a4\u8fdb\u7a0b\u7684\u73af\u5883\u4e2d\u8bbe\u7f6e\u6b63\u786e\u7684 PROXY \u73af\u5883\u53d8\u91cf\u3002<\/p>\n

lxc config set core.proxy_http http:\/\/squid01.internal:3128\r\nlxc config set core.proxy_https http:\/\/squid01.internal:3128\r\nlxc config set core.proxy_ignore_hosts image-server.local\r\n<\/pre>\n

\u4ee5\u4e0a\u4ee3\u7801\u4f7f\u6240\u6709 LXD \u53d1\u8d77\u7684\u6570\u636e\u4f20\u8f93\u90fd\u4f7f\u7528 squid01.internal HTTP \u4ee3\u7406\uff0c\u4f46\u4e0e\u5728 image-server.local \u7684\u670d\u52a1\u5668\u7684\u6570\u636e\u4f20\u8f93\u5219\u662f\u4f8b\u5916\u3002<\/p>\n

\u955c\u50cf\u7ba1\u7406<\/strong><\/span><\/div>\n

LXD \u4f7f\u7528\u52a8\u6001\u955c\u50cf\u7f13\u5b58\u3002\u5f53\u4ece\u8fdc\u7a0b\u955c\u50cf\u521b\u5efa\u5bb9\u5668\u7684\u65f6\u5019\uff0c\u5b83\u4f1a\u81ea\u52a8\u628a\u955c\u50cf\u4e0b\u8f7d\u5230\u672c\u5730\u955c\u50cf\u5546\u5e97\uff0c\u540c\u65f6\u6807\u5fd7\u4e3a\u5df2\u7f13\u5b58\u5e76\u8bb0\u5f55\u6765\u6e90\u3002\u51e0\u5929\u540e\uff08\u9ed8\u8ba4 10 \u5929\uff09\u5982\u679c\u67d0\u4e2a\u955c\u50cf\u6ca1\u6709\u88ab\u4f7f\u7528\u8fc7\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u81ea\u52a8\u5730\u88ab\u5220\u9664\u3002\u6bcf\u9694\u51e0\u5c0f\u65f6\uff08\u9ed8\u8ba4\u662f 6 \u5c0f\u65f6\uff09LXD \u8fd8\u4f1a\u68c0\u67e5\u4e00\u4e0b\u8fd9\u4e2a\u955c\u50cf\u662f\u5426\u6709\u65b0\u7248\u672c\uff0c\u7136\u540e\u66f4\u65b0\u955c\u50cf\u7684\u672c\u5730\u62f7\u8d1d\u3002<\/p>\n

\u6240\u6709\u8fd9\u4e9b\u90fd\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u914d\u7f6e\u9009\u9879\u8fdb\u884c\u914d\u7f6e\uff1a<\/p>\n

lxc config set images.remote_cache_expiry 5\r\nlxc config set images.auto_update_interval 24\r\nlxc config set images.auto_update_cached false\r\n<\/pre>\n

\u8fd9\u4e9b\u547d\u4ee4\u8ba9 LXD \u4fee\u6539\u4e86\u5b83\u7684\u9ed8\u8ba4\u5c5e\u6027\uff0c\u7f13\u5b58\u671f\u66ff\u6362\u4e3a 5 \u5929\uff0c\u66f4\u65b0\u95f4\u9694\u4e3a 24 \u5c0f\u65f6\uff0c\u800c\u4e14\u53ea\u66f4\u65b0\u90a3\u4e9b\u6807\u8bb0\u4e3a\u81ea\u52a8\u66f4\u65b0\uff08\u2013auto-update\uff09\u7684\u955c\u50cf\uff08lxc \u955c\u50cf\u62f7\u8d1d\u88ab\u6807\u8bb0\u4e3a \u2013auto-update\uff09\u800c\u4e0d\u662f LXD \u81ea\u52a8\u7f13\u5b58\u7684\u955c\u50cf\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u5230\u8fd9\u91cc\u4e3a\u6b62\uff0c\u4f60\u5c31\u5e94\u8be5\u6709\u4e86\u4e00\u4e2a\u53ef\u4ee5\u5de5\u4f5c\u7684\u3001\u6700\u65b0\u7248\u7684 LXD\uff0c\u73b0\u5728\u4f60\u53ef\u4ee5\u5f00\u59cb\u7528 LXD \u4e86\uff0c\u6216\u8005\u7b49\u5f85\u6211\u4eec\u7684\u4e0b\u4e00\u7bc7\u535a\u6587\uff0c\u6211\u4eec\u4f1a\u5728\u5176\u4e2d\u4ecb\u7ecd\u5982\u4f55\u521b\u5efa\u7b2c\u4e00\u4e2a\u5bb9\u5668\u4ee5\u53ca\u4f7f\u7528 LXD \u547d\u4ee4\u884c\u5de5\u5177\u64cd\u4f5c\u5bb9\u5668\u3002<\/p>\n

\u5982\u679c\u4f60\u4e0d\u60f3\u6216\u8005\u4e0d\u80fd\u5728\u4f60\u7684\u673a\u5668\u4e0a\u5b89\u88c5 LXD \uff0c\u4f60\u53ef\u4ee5\u8bd5\u8bd5\u5728\u7ebf\u7248\u7684 LXD\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-7687-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/lxd-2-0-install-config.html<\/a>\u7f16\u8f91\u5458\uff1a\u9676\u6b66\u6770\uff0c\u5ba1\u6838\u5458\uff1a\u82cf\u897f\u4e91<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u662f LXD 2.0 \u7cfb\u5217\u4ecb\u7ecd\u6587\u7ae0\u7684\u7b2c\u4e8c\u7bc7\u3002\u6709\u5f88\u591a\u79cd\u529e\u6cd5\u53ef\u4ee5\u83b7\u5f97 LXD\u3002\u6211\u4eec\u63a8\u8350\u4f60\u914d\u5408\u6700\u65b0\u7248\u7684 LXC \u548c Linux \u5185\u6838\u4f7f\u7528 LXD\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4eab\u53d7\u5230\u5b83\u7684\u5168\u90e8\u7279\u6027\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u73b0\u5728\u4e5f\u5728\u6162\u6162\u7684\u964d\u4f4e\u5bf9\u65e7\u7248\u672c Linux \u53d1\u5e03\u7248\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"author":63,"featured_media":28013,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-26837","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/26837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=26837"}],"version-history":[{"count":17,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/26837\/revisions"}],"predecessor-version":[{"id":258514,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/26837\/revisions\/258514"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/28013"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=26837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=26837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=26837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}