namespace作用是啥?

Posted honpey

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了namespace作用是啥?相关的知识,希望对你有一定的参考价值。

突然想起个问题,linux系统里的namespace到底有什么用?是为了解决什么问题?

从内核的层面构造出虚拟机?

比如IPC,这个时候

https://lwn.net/Articles/531114/

这个链接中说涉及namespace的总体的目的是为了实现虚拟机

https://lwn.net/Articles/524952/

这篇文章中说是为了解决:【上面文章好好读】

There are many use cases for hypervisors. One is simple resource isolation, so that, for example, one can run a web server and a mail server on the same physical machine without having them interfere with one another. Another use case is to gather accurate service statistics. Thus, for example, the system manager may want to run top in order to obtain statistics about the mail server without seeing the effect of a database server on the same physical machine; placing the two servers in separate virtual machines allows such independent statistics gathering.

Hypervisors can be useful in conjunction with network applications. Since each virtual machine has its own IP address and port number space, it is possible, for example, to run two different web servers that each use port 80 inside different virtual machines. Hypervisors can also be used to provide root privilege to a user on one particular virtual machine. That user can then do anything they want on that virtual machine, without any danger of damaging the host system.

Finally, hypervisors can be used to run different versions of Linux on the same system, or even to run different operating systems (e.g., Linux and Windows) on the same physical machine.

【人类社会资源问题】

User namespaces provide isolation of the "user ID" resource. Thus, it is possible to create users that are visible only within a container. Most notably, user namespaces allow a container to have a user that has root privileges for operations inside the container without being privileged on the system as a whole. (There are various other namespaces in addition to those that Glauber discussed, such as the PID, UTS, and IPC namespaces. One or two of those namespaces were also mentioned later in the talk.)

以上是关于namespace作用是啥?的主要内容,如果未能解决你的问题,请参考以下文章

对称加密算法和非对称加密算法

深度学习-机器视觉学习路线

linux操作系统及常见命令

css3-动画(animation)

vue+vuex+axios从webpack-server获取模拟数据存入vuex并取回展示到页面

PHP 简介