Linux命名空间

Namespaces

isolation building blocks 统称为Namespaces

Linux 3.12内核支持六种Namespaces 1. UTS:hostname 2. IPC:进程间通信 3. PID:chroot进程树 4. NET:网络访问 5. NS:挂载点 6. User:将虚拟的userid映射到真实的userid

Purpose

The CLONE_NEW* identifiers listed in parentheses are the names of the constants used to identify namespace types when employing the namespace-related APIs

Mount Spaces(CLONE_NEWNS)

isolate the set of filesystem mount points seen by a group of processes.

Thus, processes in different mount namespaces can have different views of the filesystem hierarchy.

the mount() and umount() system calls instead performed operations that affected just the mount namespace associated with the calling process.

UTS(CLONE_NEWUTS)

LinuX Containers 1. 一种操作系统层次上的资源的虚拟化。 2. 容器有效地将由单个操作系统管理的资源划分到孤立的组中,以更好地在孤立的组之间平衡有冲突的资源使用需求。 3. 将不同应用的运行隔离

依赖linux运行的三种隔离机制 1. cgroups 2. chroot 3. namespaces(isolation building block)

IPC (CLONE_NEWIPC)

PID(CLONE_NEWPID)

Network(CLONE_NEWNET)

User(CLONE_NEWUSER)