作者存档:phpor
rbd nbd
rbd vs rbd-nbd 两者功能一样,效果也没啥差别,只是实现方式有所不同; 前者使用内核的rbd模块访 …
创建新的名字空间
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#define _GNU_SOURCE #include <sched.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <unistd.h> static char child_stack[1048576]; static int child_fn() { printf("PID: %ld\n", (long)getpid()); sleep(100000); return 0; } int main(int ac, char** av) { int ch; int flag = SIGCHLD; while((ch = getopt(ac, av, "pmnuU")) != -1) { switch(ch) { case 'p': flag |= CLONE_NEWPID;break; case 'm': flag |= CLONE_NEWNS;break; case 'n': flag |= CLONE_NEWNET;break; case 'u': flag |= CLONE_NEWUTS;break; case 'U': flag |= CLONE_NEWUSER;break; } } pid_t child_pid = clone(child_fn, child_stack+1048576, flag, NULL); printf("clone() = %ld\n", (long)child_pid); waitpid(child_pid, NULL, 0); return 0; } |
功能: 创建新的名字空间,并使得进程处于sl …
centos7 之vnc黑色桌面
有时候,我们为了安全,禁用root账号登录,需要root的话,在普通账号登录后再sudo;也有时候,我们期望v …
windows virtio
kvm上安装windows虚拟机时,如果起初配置的磁盘就是virtio驱动的,则安装时会发现不到 …
kvm 之mem balloon
对于kvm虚拟机,由于宿主机和guest之间的独立性很大,当guest把很多内存用于系统cache的话,宿主机 …
docker 之 exec失败的问题
环境:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# docker info Containers: 56 Running: 33 Paused: 0 Stopped: 23 Images: 31 Server Version: 1.12.5 Storage Driver: devicemapper Pool Name: data-docker_thinpool Pool Blocksize: 524.3 kB Base Device Size: 32.21 GB Backing Filesystem: xfs Data file: Metadata file: Data Space Used: 516.2 GB Data Space Total: 644.2 GB Data Space Available: 128.1 GB Metadata Space Used: 45.47 MB Metadata Space Total: 16.98 GB Metadata Space Available: 16.93 GB Thin Pool Minimum Free Space: 64.42 GB Udev Sync Supported: true Deferred Removal Enabled: true Deferred Deletion Enabled: false Deferred Deleted Device Count: 0 Library Version: 1.02.135-RHEL7 (2016-11-16) Logging Driver: journald Cgroup Driver: cgroupfs Plugins: Volume: local Network: host bridge null overlay Swarm: inactive Runtimes: runc docker-runc Default Runtime: runc Security Options: seccomp Kernel Version: 3.10.0-514.6.1.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 Number of Docker Hooks: 2 CPUs: 40 Total Memory: 94.14 GiB Name: VM-2-10-12 ID: NYBE:NZML:4KQQ:PF2J:RXCB:IPPI:Y3BI:CY7E:RVAC:WVWV:VDM2:3EEK Docker Root Dir: /data1/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Insecure Registries: docker-registry.i.bbtfax.com:5000 127.0.0.0/8 Registries: docker.io (secure) |
现象: [crayon …
windows 内存计算
不严格地讲,内存各部分关系大致如下: 可用(60287) + 已用(37G) = 总数(96G) 已缓存(4 …
libudev on centos7
只需要安装 systemd-devel 就行了
vnc in openstack
在openstack管理的虚拟机中启动vnc时,:1 是启动不了的,似乎是被kvm已某种方式给占用了,而这种占 …