volume

Docker 数据卷

不问归期 提交于 2020-01-10 19:44:14
Docker 数据卷 数据卷是一个可供一个或多个容器使用的特殊目录,它绕过 UFS,可以提供很多有用的特性: 数据卷可以在容器之间共享和重用 对数据卷的修改会立马生效 对数据卷的更新,不会影响镜像 卷会一直存在,直到没有容器使用 创建 在用 docker run 命令的时候,使用 -v 标记来创建一个数据卷并挂载到容器里。在一次 run 中多次使用可以挂载多个数据卷。 例如: docker run -itd -p 6380:6380 -v /home/docker_test:/root/ --name volum_test aaf79d45ddb1 #查看挂载 # 方式1 docker inspect dc00070e3903|grep "Source" "Source": "/home/docker_test", "Source": "/var/lib/docker/volumes/e3fb369eaf07fcbaf97f897dc3a5fad0615b3dbe0cba55d57232b272feef6a2b/_data", # 方式2 docker inspect dc00070e3903|grep -10 "Mounts" { "Type": "bind", "Source": "/home/docker_test", "Destination": "/root",

kubernetes CSI

喜夏-厌秋 提交于 2020-01-10 19:12:06
CSI - Container Storage Interface(容器存储接口) CSI 代表 容器存储接口 ,CSI 试图建立一个行业标准接口的规范,借助 CSI 容器编排系统(CO)可以将任意存储系统暴露给自己的容器工作负载。有关详细信息,请查看 设计方案 。 csi 卷类型是一种 out-tree(即跟其它存储插件在同一个代码路径下,随 Kubernetes 的代码同时编译的) 的 CSI 卷插件,用于 Pod 与在同一节点上运行的外部 CSI 卷驱动程序交互。部署 CSI 兼容卷驱动后,用户可以使用 csi 作为卷类型来挂载驱动提供的存储。 CSI 持久化卷支持是在 Kubernetes v1.9 中引入的,作为一个 alpha 特性,必须由集群管理员明确启用。换句话说,集群管理员需要在 apiserver、controller-manager 和 kubelet 组件的 “ --feature-gates = ” 标志中加上 “ CSIPersistentVolume = true ”。 CSI 持久化卷具有以下字段可供用户指定: driver :一个字符串值,指定要使用的卷驱动程序的名称。必须少于 63 个字符,并以一个字符开头。驱动程序名称可以包含 “。”、“ - ”、“_” 或数字。 volumeHandle :一个字符串值,唯一标识从 CSI 卷插件的

Having Docker access External files

青春壹個敷衍的年華 提交于 2020-01-09 07:48:21
问题 I am interested in having docker have access to external files, however, I do not wish to include them as a volume. The files that I need access to will change over time, and this means I would need to re-mount repeatedly. Unless, I can mount a mere directory, and whatever is in that directory is also mounted. I am just in need of allowing a software program pushed into a container, to run "over" my local system, where this software program has access to files on my local system. Advice? Is

Docker volume mapping sync files from guest to host

情到浓时终转凉″ 提交于 2020-01-06 06:34:08
问题 I created this basic Dockerfile expecting that test would become visible like html/test in host, but it didn't. I think because Docker creates an empty html dir in host and syncs that to guest. I tried with docker run and docker-compose, the results were the same. The thing is, when I do the same actions with the WordPress image from Dockerhub, I see it creates a directory on host, neatly syncing all files from /var/www/html in guest. So now I wonder how I can create the same behaviour.

kubernetes之Scheduler原理分析

瘦欲@ 提交于 2020-01-06 03:11:12
scheduler在整个系统承担了承上启下的重要功能 承上值负责接受Controller Manager创建新的pod,安排目标Node 旗下指安置工作完成后,目标Node上的kubelet服务进程接管后续工作,负责pod生命周期下半生。 kubernetes Scheduler作用是将待调度的pod,按照特定的调度算法和调度策略绑定到集群中合适的Node上,并将绑定信息写入etcd中。整个调度过程涉及三个对象。分别是待调度Pod列表,可用Node列表,以及调度算法和策略。简单地说,就是通过调度算法为待调度pod列表地每个pod从Node里欸报中选择一个最合适的Node 默认调度流程 (1)预选调度过程,即遍历所有目标node,筛选出符合要求的候选节点。内置了多种预选策略。 (2)确定最优节点,在第一步的基础上,采用优选策略计算每个候选节点的积分,分高者胜出。 Scheduler中可用的预选策略包含:NoDiskConflict,PodFitsResources,PodSelectorMatches,PodFitsHost,CheckNodeLabelPresence,CheckServiceAffinity和PodFitsPorts策略等。其默认的AlgorithmProvider加载的预选策略predicates包括:PodFitsPorts、PodFitsResources

How to extend the volume control

雨燕双飞 提交于 2020-01-05 22:44:05
问题 I would like to extend the volume "control". Expand with my new "line" to add (also a volume slider); How can i do that? 回答1: There is a class in the android.view package called VolumnePanel that inflates the volume_adjust_item.xml resource. You can find the VolumePanel.java in /sources/android-/android/view and the volume_adjust_item.xml in /platforms/android-/data/res/layout. Best of luck. 来源: https://stackoverflow.com/questions/12650446/how-to-extend-the-volume-control

calculate mp3 average volume

好久不见. 提交于 2020-01-05 12:16:47
问题 I need to know the average volume of an mp3 file so that when I convert it to mp3 (at a different bitrate) I can scale the volume too, to normalize it... Therefore I need a command line tool / ruby library that gives me the average volume in dB. 回答1: You can use sox (an open source command line audio tool http://sox.sourceforge.net/sox.html) to normalize and transcode your files at the same time. EDIT Looks like it doesn't have options for bit-rate. Anyway, sox is probably overkill if LAME

Why does my system change my device from /dev/sdj to /dev/xvdj?

那年仲夏 提交于 2020-01-04 03:46:09
问题 I have an Amazon EC2 instance. I booted up a volume and attached it to /dev/sdj. I edited my fstab file to have the line /dev/sdj /home/ec2-user/mydirectory xfs noatime 0 0 Then I mounted it (sudo mount /home/ec2-user/mydirectory) However, running the "mount" command says the following: /dev/xvdj on /home/ec2-user/mydirectory type xfs (rw,noatime) What? Why is it /dev/xvdj instead of /dev/sdj? 回答1: The devices are named /dev/xvdX rather than sdX in 11.04. This was a kernel change. The kernel

Linux LVM逻辑卷管理

让人想犯罪 __ 提交于 2020-01-03 12:12:33
一、LVM初始化 1.物理卷pv 常用命令 pvs/pvscan 查看系统里有pv的磁盘 pvdisplay 显示系统上面的pv状态 pvremove 删除pv 创建pv pvcreate /dev/sdb2 Physical volume "/dev/sdb2" successfully created. 查看pv列表 pvs/pvscan PV VG Fmt Attr PSize PFree /dev/sda2 vg_root lvm2 a-- 35.00g 1.00g /dev/sda3 vg_new lvm2 a-- 64.50g 9.50g /dev/sdb1 lvm2 --- 95.36g 95.36g /dev/sdb2 lvm2 --- <104.64g <104.64g 查看pv状态 pvdisplay --- Physical volume --- PV Name /dev/sda2 VG Name vg_root PV Size 35.00 GiB / not usable 4.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 8960 Free PE 256 Allocated PE 8704 PV UUID yC67Cm-Hvxr-aXde-ovxA-1qME-UEIa-hmkzgq --- Physical

docker容器实现数据持久化的两种方式及其区别

自闭症网瘾萝莉.ら 提交于 2020-01-02 19:17:09
前言 这篇博文是我对docker实现数据持久化几种方式的特征进行一个总结。 在docker中,它的存储文件系统是在dockerhost上原有的xfs或ext4架设了一层文件系统:overlay2(将此行重点标注的原因就是我在面试中被问到过:docker使用的是什么文件系统?) ,通过docker info命令可以查看出主机上docker相关的信息,包括支持的网络类型、系统版本、内核版本、docker主机的cpu、内存等信息。如下: 在docker中实现数据持久化有两种方式:Bind mount和Docker Manager Volume。 Bind mount和Docker Manager Volume的区别: Bind mount数据持久化的方式,如果是挂载本地的一个目录,则容器内对应的目录下的内容会被本地的目录覆盖掉,而Docker Manager Volume这种方式则不会,不管哪种方式的持久化,在容器被销毁后,本地的数据都不会丢失。 使用“-v”选项挂载时,Bind mount明确指定了要挂载docker host本地的某个目录到容器中,而Docker Manager Volume则只指定了要对容器内的某个目录进行挂载,而挂载的是docker host本地的哪个目录,则是由docker来管理的。 数据持久化的特点: Data Volume是目录或文件,不能是没有格式化的磁盘