亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

目錄 搜尋
Compose About versions and upgrading (Compose) ASP.NET Core + SQL Server on Linux (Compose) CLI environment variables (Compose) Command-line completion (Compose) Compose(組成) Compose command-line reference(組合命令行參考) Control startup order (Compose) Django and PostgreSQL (Compose) Docker stacks and distributed application bundles (Compose) docker-compose build(docker-compose構(gòu)建) docker-compose bundle docker-compose config docker-compose create docker-compose down docker-compose events docker-compose exec docker-compose help docker-compose images docker-compose kill docker-compose logs docker-compose pause docker-compose port docker-compose ps docker-compose pull docker-compose push docker-compose restart docker-compose rm docker-compose run docker-compose scale docker-compose start docker-compose stop docker-compose top docker-compose unpause docker-compose up Environment file (Compose) Environment variables in Compose Extend services in Compose Frequently asked questions (Compose) Getting started (Compose) Install Compose Link environment variables (deprecated) (Compose) Networking in Compose Overview of Docker Compose Overview of docker-compose CLI Quickstart: Compose and WordPress Rails and PostgreSQL (Compose) Sample apps with Compose Using Compose in production Using Compose with Swarm Engine .NET Core application (Engine) About images, containers, and storage drivers (Engine) Add nodes to the swarm (Engine) Apply custom metadata (Engine) Apply rolling updates (Engine) apt-cacher-ng Best practices for writing Dockerfiles (Engine) Binaries (Engine) Bind container ports to the host (Engine) Breaking changes (Engine) Build your own bridge (Engine) Configure container DNS (Engine) Configure container DNS in user-defined networks (Engine) CouchDB (Engine) Create a base image (Engine) Create a swarm (Engine) Customize the docker0 bridge (Engine) Debian (Engine) Default bridge network Delete the service (Engine) Deploy a service (Engine) Deploy services to a swarm (Engine) Deprecated Engine features Docker container networking (Engine) Docker overview (Engine) Docker run reference (Engine) Dockerfile reference (Engine) Dockerize an application Drain a node (Engine) Engine FAQ (Engine) Fedora (Engine) Get started (Engine) Get started with macvlan network driver (Engine) Get started with multi-host networking (Engine) How nodes work (Engine) How services work (Engine) Image management (Engine) Inspect the service (Engine) Install Docker (Engine) IPv6 with Docker (Engine) Join nodes to a swarm (Engine) Legacy container links (Engine) Lock your swarm (Engine) Manage nodes in a swarm (Engine) Manage sensitive data with Docker secrets (Engine) Manage swarm security with PKI (Engine) Manage swarm service networks (Engine) Migrate to Engine 1.10 Optional Linux post-installation steps (Engine) Overview (Engine) PostgreSQL (Engine) Raft consensus in swarm mode (Engine) Riak (Engine) Run Docker Engine in swarm mode Scale the service (Engine) SDKs (Engine) Select a storage driver (Engine) Set up for the tutorial (Engine) SSHd (Engine) Storage driver overview (Engine) Store service configuration data (Engine) Swarm administration guide (Engine) Swarm mode key concepts (Engine) Swarm mode overlay network security model (Engine) Swarm mode overview (Engine) Understand container communication (Engine) Use multi-stage builds (Engine) Use swarm mode routing mesh (Engine) Use the AUFS storage driver (Engine) Use the Btrfs storage driver (Engine) Use the Device mapper storage driver (Engine) Use the OverlayFS storage driver (Engine) Use the VFS storage driver (Engine) Use the ZFS storage driver (Engine) Engine: Admin Guide Amazon CloudWatch logs logging driver (Engine) Bind mounts (Engine) Collect Docker metrics with Prometheus (Engine) Configuring and running Docker (Engine) Configuring logging drivers (Engine) Control and configure Docker with systemd (Engine) ETW logging driver (Engine) Fluentd logging driver (Engine) Format command and log output (Engine) Google Cloud logging driver (Engine) Graylog Extended Format (GELF) logging driver (Engine) Journald logging driver (Engine) JSON File logging driver (Engine) Keep containers alive during daemon downtime (Engine) Limit a container's resources (Engine) Link via an ambassador container (Engine) Log tags for logging driver (Engine) Logentries logging driver (Engine) PowerShell DSC usage (Engine) Prune unused Docker objects (Engine) Run multiple services in a container (Engine) Runtime metrics (Engine) Splunk logging driver (Engine) Start containers automatically (Engine) Storage overview (Engine) Syslog logging driver (Engine) tmpfs mounts Troubleshoot volume problems (Engine) Use a logging driver plugin (Engine) Using Ansible (Engine) Using Chef (Engine) Using Puppet (Engine) View a container's logs (Engine) Volumes (Engine) Engine: CLI Daemon CLI reference (dockerd) (Engine) docker docker attach docker build docker checkpoint docker checkpoint create docker checkpoint ls docker checkpoint rm docker commit docker config docker config create docker config inspect docker config ls docker config rm docker container docker container attach docker container commit docker container cp docker container create docker container diff docker container exec docker container export docker container inspect docker container kill docker container logs docker container ls docker container pause docker container port docker container prune docker container rename docker container restart docker container rm docker container run docker container start docker container stats docker container stop docker container top docker container unpause docker container update docker container wait docker cp docker create docker deploy docker diff docker events docker exec docker export docker history docker image docker image build docker image history docker image import docker image inspect docker image load docker image ls docker image prune docker image pull docker image push docker image rm docker image save docker image tag docker images docker import docker info docker inspect docker kill docker load docker login docker logout docker logs docker network docker network connect docker network create docker network disconnect docker network inspect docker network ls docker network prune docker network rm docker node docker node demote docker node inspect docker node ls docker node promote docker node ps docker node rm docker node update docker pause docker plugin docker plugin create docker plugin disable docker plugin enable docker plugin inspect docker plugin install docker plugin ls docker plugin push docker plugin rm docker plugin set docker plugin upgrade docker port docker ps docker pull docker push docker rename docker restart docker rm docker rmi docker run docker save docker search docker secret docker secret create docker secret inspect docker secret ls docker secret rm docker service docker service create docker service inspect docker service logs docker service ls docker service ps docker service rm docker service scale docker service update docker stack docker stack deploy docker stack ls docker stack ps docker stack rm docker stack services docker start docker stats docker stop docker swarm docker swarm ca docker swarm init docker swarm join docker swarm join-token docker swarm leave docker swarm unlock docker swarm unlock-key docker swarm update docker system docker system df docker system events docker system info docker system prune docker tag docker top docker unpause docker update docker version docker volume docker volume create docker volume inspect docker volume ls docker volume prune docker volume rm docker wait Use the Docker command line (Engine) Engine: Extend Access authorization plugin (Engine) Docker log driver plugins Docker network driver plugins (Engine) Extending Engine with plugins Managed plugin system (Engine) Plugin configuration (Engine) Plugins API (Engine) Volume plugins (Engine) Engine: Security AppArmor security profiles for Docker (Engine) Automation with content trust (Engine) Content trust in Docker (Engine) Delegations for content trust (Engine) Deploying Notary (Engine) Docker security (Engine) Docker security non-events (Engine) Isolate containers with a user namespace (Engine) Manage keys for content trust (Engine) Play in a content trust sandbox (Engine) Protect the Docker daemon socket (Engine) Seccomp security profiles for Docker (Engine) Secure Engine Use trusted images Using certificates for repository client verification (Engine) Engine: Tutorials Engine tutorials Network containers (Engine) Get Started Part 1: Orientation Part 2: Containers Part 3: Services Part 4: Swarms Part 5: Stacks Part 6: Deploy your app Machine Amazon Web Services (Machine) Digital Ocean (Machine) docker-machine active docker-machine config docker-machine create docker-machine env docker-machine help docker-machine inspect docker-machine ip docker-machine kill docker-machine ls docker-machine provision docker-machine regenerate-certs docker-machine restart docker-machine rm docker-machine scp docker-machine ssh docker-machine start docker-machine status docker-machine stop docker-machine upgrade docker-machine url Driver options and operating system defaults (Machine) Drivers overview (Machine) Exoscale (Machine) Generic (Machine) Get started with a local VM (Machine) Google Compute Engine (Machine) IBM Softlayer (Machine) Install Machine Machine Machine CLI overview Machine command-line completion Machine concepts and help Machine overview Microsoft Azure (Machine) Microsoft Hyper-V (Machine) Migrate from Boot2Docker to Machine OpenStack (Machine) Oracle VirtualBox (Machine) Provision AWS EC2 instances (Machine) Provision Digital Ocean Droplets (Machine) Provision hosts in the cloud (Machine) Rackspace (Machine) VMware Fusion (Machine) VMware vCloud Air (Machine) VMware vSphere (Machine) Notary Client configuration (Notary) Common Server and signer configurations (Notary) Getting started with Notary Notary changelog Notary configuration files Running a Notary service Server configuration (Notary) Signer configuration (Notary) Understand the service architecture (Notary) Use the Notary client
文字

ZFS是下一代文件系統(tǒng),支持許多高級存儲技術(shù),如卷管理,快照,校驗和,壓縮和重復(fù)數(shù)據(jù)刪除,復(fù)制等。

它由Sun Microsystems(現(xiàn)在是Oracle Corporation)創(chuàng)建,并且根據(jù)CDDL許可證開源。由于CDDL和GPL之間的許可不兼容,ZFS不能作為主線Linux內(nèi)核的一部分發(fā)貨。但是,ZFS On Linux(ZoL)項目提供了可以單獨安裝的樹外內(nèi)核模塊和用戶空間工具。

Linux(ZoL)端口上的ZFS健康且成熟。但是,目前不推薦使用zfsDocker存儲驅(qū)動程序進(jìn)行生產(chǎn)使用,除非您在Linux上擁有豐富的ZFS經(jīng)驗。

注意:在Linux平臺上還有一個ZFS的FUSE實現(xiàn)。這不被推薦。本地ZFS驅(qū)動程序(ZoL)經(jīng)過更多測試,性能更高,使用更廣泛。本文檔的其余部分涉及本地ZoL端口。

先決條件

  • ZFS需要一個或多個專用塊設(shè)備,最好是固態(tài)驅(qū)動器(SSD)。

  • ZFS僅支持泊塢CE與Ubuntu 14.04或更高版本,與zfs包(16.04及更高版本)或zfs-nativeubuntu-zfs已安裝的軟件包(14.04)。

    • 對于Ubuntu 14.04,您需要先啟用補充軟件包存儲庫,ppa:zfs-native/stable然后才能安裝軟件包。有關(guān)說明,請參閱https://launchpad.net/~zfs-native/+archive/ubuntu/stable。

  • Docker EE或CS-Engine或任何其他Linux平臺不支持ZFS。

  • /var/lib/docker/目錄必須安裝在ZFS格式的文件系統(tǒng)上。

  • 更改存儲驅(qū)動程序?qū)⑹鼓褎?chuàng)建的任何容器在本地系統(tǒng)上都不可訪問。使用docker save保存的容器,并推動現(xiàn)有圖像多克爾集線器或私人倉庫,讓你不必后重新創(chuàng)建它們。

使用zfs存儲驅(qū)動程序配置Docker

  1. 停止Docker。

  2. 將內(nèi)容復(fù)制/var/lib/docker//var/lib/docker.bk并刪除內(nèi)容/var/lib/docker/。$ sudo cp -au /var/lib/docker /var/lib/docker.bk  $ sudo rm -rf /var/lib/docker/*

  3. zpool在您的專用塊設(shè)備或設(shè)備上創(chuàng)建一個新的,并將其安裝到/var/lib/docker/。確保你已經(jīng)指定了正確的設(shè)備,因為這是一個破壞性的操作。此示例將兩個設(shè)備添加到池中。$ sudo zpool create -f zpool-docker -m /var/lib/docker /dev/xvdf /dev/xvdg該命令創(chuàng)建zpool并命名它zpool-docker。該名稱僅用于顯示目的,您可以使用不同的名稱。檢查池是否使用正確創(chuàng)建和安裝zfs list。$ sudo zfs list  NAME           USED  AVAIL  REFER  MOUNTPOINT zpool-docker    55K  96.4G    19K  /var/lib/docker

  4. 配置Docker以使用zfs。編輯/etc/docker/daemon.json并設(shè)置storage-driverzfs。如果該文件之前為空,它現(xiàn)在應(yīng)該如下所示:{“storage-driver”:“zfs”}保存并關(guān)閉文件。

  5. 啟動Docker。使用docker info驗證存儲驅(qū)動程序zfs。$ sudo docker信息容器:0正在運行:0已暫停:0已停止:0圖像:0服務(wù)器版本:17.03.1-ce存儲驅(qū)動程序:zfs Zpool:zpool-docker Zpool運行狀況:ONLINE父數(shù)據(jù)集:zpool-docker父級使用的空間:249856可用空間:103498395648父配額:否壓縮:關(guān)閉<output truncated>

管理 zfs

增加正在運行的設(shè)備的容量

要增加大小zpool,您需要將專用塊設(shè)備添加到Docker主機,然后將其添加到zpool使用zpool add命令:

$ sudo zpool add zpool-docker /dev/xvdh

限制容器的可寫入存儲配額

如果要基于每個image?dataset集實現(xiàn)配額,可以設(shè)置size存儲選項以限制單個容器可用于其可寫層的空間量。

編輯/etc/docker/daemon.json并添加以下內(nèi)容:

{  "storage-driver": "zfs",  "storage-opts": ["size=256M"]}

查看每個存儲驅(qū)動程序的所有存儲選項:

  • Stable

  • Edge

保存并關(guān)閉文件,然后重新啟動Docker。

如何zfs存儲驅(qū)動程序作品

ZFS使用以下對象:

  • 文件系統(tǒng):精簡配置,zpool按需分配空間。

  • 快照:文件系統(tǒng)的只讀空間有效時間點拷貝。

  • 克隆:快照的讀寫副本。用于存儲與上一層的差異。

創(chuàng)建一個克隆的過程:



  1. 從文件系統(tǒng)創(chuàng)建只讀快照。

  2. 從快照創(chuàng)建可寫克隆。這包含與父層的任何差異。

文件系統(tǒng),快照和克隆都從底層分配空間zpool。

映像和容器層在磁盤上

每個正在運行的容器的統(tǒng)一文件系統(tǒng)都安裝在一個安裝點上/var/lib/docker/zfs/graph/。繼續(xù)閱讀以獲得關(guān)于統(tǒng)一文件系統(tǒng)組成的解釋。

圖像分層和共享

圖像的基礎(chǔ)層是ZFS文件系統(tǒng)。每個子圖層都是基于ZFS下方圖層的ZFS快照。容器是基于ZFS快照的ZFS快照,該ZFS快照是從創(chuàng)建映像的頂層開始的。

下圖顯示了如何將這與基于雙層圖像的正在運行的容器放在一起。



當(dāng)你啟動一個容器時,以下步驟按順序進(jìn)行:

  1. 圖像的基礎(chǔ)層作為ZFS文件系統(tǒng)存在于Docker主機上。

  2. 其他圖像層是直接位于其下方的圖像層的數(shù)據(jù)集的克隆。在該圖中,通過獲取基礎(chǔ)層的ZFS快照并從該快照創(chuàng)建克隆來添加“第1層”。該克隆是可寫的,并從zpool消耗按需空間??煺帐侵蛔x的,將基本層保持為不可變對象。

  3. 當(dāng)容器啟動時,圖像上方會添加一個可寫圖層。在該圖中,容器的讀寫層是通過制作圖像頂層(第1層)的快照并從該快照創(chuàng)建克隆來創(chuàng)建的。

  4. 當(dāng)容器修改其可寫層的內(nèi)容時,將為已更改的塊分配空間。默認(rèn)情況下,這些塊是128k。

容器讀取和寫入的工作方式 zfs

讀取文件

每個容器的可寫層都是一個ZFS克隆,它將其所有數(shù)據(jù)與其創(chuàng)建的數(shù)據(jù)集(其父層的快照)共享。即使正在讀取的數(shù)據(jù)來自深層,讀操作也是最快的。

編寫文件

編寫一個新文件:根據(jù)需要從底層分配空間zpool,并將塊直接寫入容器的可寫層。

修改現(xiàn)有文件:只為已更改的塊分配空間,并使用寫時復(fù)制(CoW)策略將這些塊寫入容器的可寫層。這可以最大限度地減小圖層的大小并提高寫入性能。

刪除文件或目錄

  • 當(dāng)刪除存在于較低層的文件或目錄時,即使文件或目錄仍然存在于較低的只讀層中,ZFS驅(qū)動程序也會掩蓋該容器可寫層中的文件或目錄的存在。

  • 如果您創(chuàng)建并刪除容器可寫層中的文件或目錄,則塊將被回收zpool。

ZFS和Docker性能

有幾個因素會影響Docker使用zfs存儲驅(qū)動程序的性能。

  • 內(nèi)存:內(nèi)存對ZFS性能有重大影響。ZFS最初設(shè)計用于具有大量內(nèi)存的大型企業(yè)級服務(wù)器。

  • ZFS特性:ZFS包含重復(fù)數(shù)據(jù)刪除功能。使用此功能可能會節(jié)省磁盤空間,但會占用大量內(nèi)存。建議您停用zpoolDocker使用的此功能,除非您使用SAN,NAS或其他硬件RAID技術(shù)。

  • ZFS緩存:ZFS將磁盤塊緩存在稱為自適應(yīng)替換緩存(ARC)的內(nèi)存結(jié)構(gòu)中。ZFS 的Single Copy ARC功能允許一個塊的單個緩存副本由a的多個克隆共享使用此功能,多個運行中的容器可以共享一個緩存塊的單個副本。此功能使ZFS成為PaaS和其他高密度用例的理想選擇。

  • 碎片:碎片是ZFS等寫入時復(fù)制文件系統(tǒng)的自然副產(chǎn)品。ZFS通過使用128k的小塊來緩解這種情況。ZFS意向日志(ZIL)和寫入合并(延遲寫入)也有助于減少碎片。您可以使用監(jiān)視碎片zfs status。但是,如果不重新格式化和恢復(fù)文件系統(tǒng),則無法對ZFS進(jìn)行碎片整理。

  • 使用適用于Linux的本機ZFS驅(qū)動程序:由于性能較差,不建議使用ZFS FUSE實施。

性能最佳實踐

  • 使用快速存儲:固態(tài)硬盤(SSD)比旋轉(zhuǎn)磁盤提供更快的讀取和寫入速度。

  • 將卷用于寫入繁重的工作負(fù)載:卷為寫入繁重的工作負(fù)載提供最佳和最可預(yù)測的性能。這是因為它們繞過了存儲驅(qū)動程序,并且不會產(chǎn)生精簡配置和寫入時復(fù)制引入的任何潛在開銷。卷還有其他好處,例如允許您在容器之間共享數(shù)據(jù),并且即使在沒有正在運行的容器正在使用它們時也會持久存在。

上一篇: 下一篇: