成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

LXD 2.0 系列(八):LXD中的LXD

系統 Linux 系統運維
這是 LXD 2.0 系列介紹文章的第八篇。最簡單的情況可以使用 Ubuntu 16.04 鏡像來展示。 Ubuntu 16.04 云鏡像預裝了 LXD。守護進程本身沒有運行,因為它是由套接字激活的,所以它不使用任何資源,直到你真正使用它。

這是 LXD 2.0 系列介紹文章的第八篇。

  1. LXD 入門
  2. 安裝與配置
  3. 你的***個 LXD 容器
  4. 資源控制
  5. 鏡像管理
  6. 遠程主機及容器遷移
  7. LXD 中的 Docker

介紹

在上一篇文章中,我介紹了如何在 LXD 中運行 Docker,這是一個訪問由 Docker 提供的應用程序組合的很好方式,同時 Docker 還運行在 LXD 提供的安全環境中。

我提到的一個情況是為你的用戶提供一個 LXD 容器,然后讓他們使用他們的容器來運行 Docker。那么,如果他們自己想要在其容器中使用 LXD 運行其他 Linux 發行版,或者甚至允許另一組人來訪問運行在他們的容器中的 Linux 系統呢?

原來 LXD 使得用戶運行嵌套容器變得非常簡單。

嵌套 LXD

最簡單的情況可以使用 Ubuntu 16.04 鏡像來展示。 Ubuntu 16.04 云鏡像預裝了 LXD。守護進程本身沒有運行,因為它是由套接字激活的,所以它不使用任何資源,直到你真正使用它。

讓我們啟動一個啟用了嵌套的 Ubuntu 16.04 容器:

  1. lxc launch ubuntu-daily:16.04 c1 -c security.nesting=true 

你也可以在一個已有的容器上設置 security.nesting:

  1. lxc config set <container name> security.nesting true 

或者對所有的容器使用一個指定的配置文件:

  1. lxc profile set <profile name> security.nesting true 

容器啟動后,你可以從容器內部得到一個 shell,配置 LXD 并生成一個容器:

  1. stgraber@dakara:~$ lxc launch ubuntu-daily:16.04 c1 -c security.nesting=true 
  2. Creating c1 
  3. Starting c1 
  4. stgraber@dakara:~$ lxc exec c1 bash 
  5. root@c1:~# lxd init 
  6. Name of the storage backend to use (dir or zfs): dir 
  7. We detected that you are running inside an unprivileged container. 
  8. This means that unless you manually configured your host otherwise, 
  9. you will not have enough uid and gid to allocate to your containers. 
  10. LXD can re-use your container's own allocation to avoid the problem. 
  11. Doing so makes your nested containers slightly less safe as they could 
  12. in theory attack their parent container and gain more privileges than 
  13. they otherwise would. 
  14. Would you like to have your containers share their parent's allocation (yes/no)? yes 
  15. Would you like LXD to be available over the network (yes/no)? no 
  16. Do you want to configure the LXD bridge (yes/no)? yes 
  17. Warning: Stopping lxd.service, but it can still be activated by
  18.  lxd.socket 
  19. LXD has been successfully configured. 
  20. root@c1:~# lxc launch ubuntu:14.04 trusty 
  21. Generating a client certificate. This may take a minute... 
  22. If this is your first time using LXD, you should also run: sudo lxd init 
  23. Creating trusty 
  24. Retrieving image: 100% 
  25. Starting trusty 
  26. root@c1:~# lxc list 
  27. +--------+---------+-----------------------+----------------------------------------------+------------+-----------+ 
  28. |  NAME  |  STATE  |         IPV4          |                     IPV6                     |    TYPE    | SNAPSHOTS | 
  29. +--------+---------+-----------------------+----------------------------------------------+------------+-----------+ 
  30. | trusty | RUNNING | 10.153.141.124 (eth0) | fd7:f15d:d1d6:da14:216:3eff:fef1:4002 (eth0) | PERSISTENT | 0         | 
  31. +--------+---------+-----------------------+----------------------------------------------+------------+-----------+ 
  32. root@c1:~# 

就是這樣簡單。

在線演示服務器

因為這篇文章很短,我想我會花一點時間談論我們運行中的演示服務器。我們今天早些時候剛剛達到了 10000 個會話!

這個服務器基本上只是一個運行在一個相當強大的虛擬機上的正常的 LXD,一個小型的守護進程實現了我們的網站所使用的 REST API。

當你接受服務條款時,將為你創建一個新的 LXD 容器,并啟用 security.nesting,如上所述。接著你就像使用 lxc exec 時一樣連接到了那個容器,除了我們使用 websockets 和 javascript 來做這些。

你在此環境中創建的容器都是嵌套的 LXD 容器。如果你想,你可以進一步地嵌套。

我們全范圍地使用了 LXD 資源限制,以防止一個用戶的行為影響其他用戶,并仔細監控服務器的任何濫用跡象。

如果你想運行自己的類似的服務器,你可以獲取我們的網站和守護進程的代碼:

  1. git clone https://github.com/lxc/linuxcontainers.org 
  2. git clone https://github.com/lxc/lxd-demo-server 

額外信息

LXD 的主站在: https://linuxcontainers.org/lxd

LXD 的 GitHub 倉庫: https://github.com/lxc/lxd

LXD 的郵件列表: https://lists.linuxcontainers.org

LXD 的 IRC 頻道: #lxcontainers on irc.freenode.net 

責任編輯:龐桂玉 來源: Linux中國
相關推薦

2016-07-29 14:12:21

2017-02-27 19:27:52

LXDDockerLinux

2017-03-08 10:40:14

LXD 2.0JujuLinux

2017-03-08 18:00:10

LXD 2.0LinuxOpenStack

2017-03-09 16:32:03

LXD 2.0Linux調試

2017-01-12 15:37:34

LinuxLXD 2.0鏡像管理

2017-03-07 16:41:03

LXD 2.0Linux實時遷移

2016-12-29 11:01:03

LinuxLXD 2.0資源控制

2016-08-24 15:12:41

LXDLinux容器

2016-08-22 21:41:37

LXDLinux容器管理器

2017-02-05 14:52:42

2015-04-24 10:57:22

Ubuntu 15.0Ubuntu

2017-12-25 13:51:32

LinuxUbuntu LinuLXD容器

2014-11-20 10:12:59

Docker容器LXDCanonica

2023-02-03 17:47:28

2017-11-01 15:38:54

jvm知識點總覽

2021-06-28 05:59:17

Webpack 前端打包與工程化

2009-01-20 09:31:42

Web 2.02009預測

2011-04-29 09:15:16

Servlet

2009-08-05 18:34:07

堆棧遍歷
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 日韩在线一区二区 | 欧美日韩精品影院 | 国际精品鲁一鲁一区二区小说 | 午夜影院 | 国产精品久久久久aaaa九色 | 黑人巨大精品欧美一区二区免费 | 日日干日日色 | 欧美一区二区三区在线 | 精品二 | 精品国产乱码久久久久久果冻传媒 | 欧美5区| 成人免费观看男女羞羞视频 | 欧美一区视频在线 | 国产免费看 | 亚洲国产一区二区视频 | 中文字幕一区在线观看视频 | 天天操夜夜操免费视频 | 日韩成人| 日本电影网站 | 91在线看视频 | 久久久久久一区 | 激情伊人网 | 国产精品视频免费观看 | 国产免国产免费 | 欧美日韩国产精品一区 | 天天干b| 日本久久精 | 国产激情91久久精品导航 | 久久99精品久久久久久国产越南 | 白浆在线 | 日韩欧美在线视频播放 | 国产视频精品免费 | 日韩午夜一区二区三区 | 成人激情视频在线播放 | 亚洲va国产日韩欧美精品色婷婷 | 91久久北条麻妃一区二区三区 | 天天草夜夜骑 | 亚洲在线 | 日韩成人在线视频 | 亚洲经典一区 | 日韩免费视频一区二区 |