mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-30 01:26:38 +00:00
refine the doc according to the comments
This commit is contained in:
parent
12a5882947
commit
43e709ca8d
@ -1,7 +1,7 @@
|
||||
Run xCAT in Docker Container
|
||||
============================
|
||||
|
||||
`Docker <https://www.docker.com/>`_ is a popular application containment environment. With Docker, applications/Services are shipped as **Docker images** and run in **Docker containers**. **Docker containers** include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system. The server on which **Docker containers** run are called **Docker host**.
|
||||
`Docker <https://www.docker.com/>`_ is a popular application containment environment. With Docker, applications/Services are shipped as **Docker images** and run in **Docker containers**. **Docker containers** include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system. The server on which **Docker containers** run is called **Docker host**.
|
||||
|
||||
When running xCAT in Docker container, you do not have to worry about the xCAT installation and configuration on different OS and hardware platforms, just focus on the cluster management work with xCAT features.
|
||||
|
||||
@ -9,9 +9,9 @@ When running xCAT in Docker container, you do not have to worry about the xCAT i
|
||||
Prerequisite: setup Docker host
|
||||
--------------------------------
|
||||
|
||||
You can select a baremental or virtual server with the Operating Systems which docker supports as a docker host,then install Docker on it. Please refer to `Docker Docs <https://docs.docker.com/>`_ for the details of system requirements and Docker installation.
|
||||
You can select a baremental or virtual server with the Operating Systems which docker supports as a docker host, then install Docker on it. Please refer to `Docker Docs <https://docs.docker.com/>`_ for the details on system requirements and Docker installation.
|
||||
|
||||
**Note:** Running xCAT in Docker requires x86_64 or ppc64le Docker hosts, since a **Docker image** can only run on the **Docker host** with the same archtecture, and xCAT currently only ships x86_64 and ppc64le Docker images.
|
||||
**Note:** **Docker image** can only run on the **Docker host** with the same architecture. Since xCAT currently only ships x86_64 and ppc64le Docker images, running xCAT in Docker requires x86_64 or ppc64le **Docker hosts**.
|
||||
|
||||
|
||||
An example configuration in the documentation
|
||||
@ -23,11 +23,11 @@ To demonstrate the steps to run xCAT in a Docker container, take a cluster with
|
||||
The Docker host network interface facing the compute nodes: eth0
|
||||
The IP address of eth0: 10.5.106.1/24
|
||||
The customized docker bridge: br0
|
||||
The docker container name running xCAT: xcat2-11mn
|
||||
The hostname of container xcat2-11mn: xcat2-11mn
|
||||
The IP address of container xcat2-11mn: 10.5.106.101
|
||||
The name server of container xcat2-11mn: 10.5.106.1
|
||||
The dns domain of container xcat2-11mn: clusters.com
|
||||
The docker container name running xCAT: xcatmn
|
||||
The hostname of container xcatmn: xcatmn
|
||||
The IP address of container xcatmn: 10.5.106.101
|
||||
The name server of container xcatmn: 10.5.106.1
|
||||
The dns domain of container xcatmn: clusters.com
|
||||
|
||||
|
||||
Create a customized bridge on the Docker host
|
||||
@ -35,7 +35,7 @@ Create a customized bridge on the Docker host
|
||||
|
||||
**Docker containers** connect to the Docker host network via a network bridge. To run xCAT in Docker, you should create a customized bridge according to the cluster network plan, instead of the default bridge "docker0".
|
||||
|
||||
As an example, you create a bridge "br0" and attach the network interface "eth0" to it ::
|
||||
As an example, create a bridge "br0" and attach the network interface "eth0" to it ::
|
||||
|
||||
brctl addbr br0
|
||||
brctl setfd br0 0
|
||||
@ -81,28 +81,28 @@ Create the Docker container
|
||||
|
||||
Now create the xCAT Docker container with the Docker image "xcat/xcat-ubuntu-x86_64" ::
|
||||
|
||||
[root@dockerhost1 ~]# sudo docker create -it --privileged=true --dns=10.5.106.1 --dns-search=clusters.com --hostname=xcat2-11mn --name=xcat2-11mn --add-host=xcat2-11mn:10.5.106.101 --add-host c910f05c01bc06:10.5.106.1 --net=none xcat/xcat-ubuntu-x86_64:2.11
|
||||
[root@dockerhost1 ~]# sudo docker create -it --privileged=true --dns=10.5.106.1 --dns-search=clusters.com --hostname=xcatmn --name=xcatmn --add-host=xcatmn:10.5.106.101 --add-host c910f05c01bc06:10.5.106.1 --net=none xcat/xcat-ubuntu-x86_64:2.11
|
||||
|
||||
* use ``--privileged=true`` to give extended privileges to this container
|
||||
* use ``--dns`` and ``--dns-search`` to specify the name server and dns domain for the container,which will be written to ``/etc/resolv.conf`` of the container
|
||||
* use ``--dns`` and ``--dns-search`` to specify the name server and dns domain for the container, which will be written to ``/etc/resolv.conf`` of the container
|
||||
* use ``--hostname`` to specify the hostname of the container, which is available inside the container
|
||||
* use ``--name`` to assign a name to the container, this name can be used to manipulate the container on Docker host
|
||||
* use ``--add-host`` to write the ``/etc/hosts`` entries of Docker host and Docker container to ``/etc/hosts`` in the container
|
||||
* use ``--net=none`` not to create networking for the container
|
||||
* use ``--net=none`` to create no networking for the container
|
||||
|
||||
|
||||
Start the Docker container
|
||||
--------------------------
|
||||
|
||||
Start the pre-created container "xcat2-11mn" with ::
|
||||
Start the pre-created container "xcatmn" with ::
|
||||
|
||||
sudo docker start xcat2-11mn
|
||||
sudo docker start xcatmn
|
||||
|
||||
|
||||
Setup the network for the Docker container
|
||||
------------------------------------------
|
||||
|
||||
Now you need to assign a static IP address for Docker container and attach it to the customized network bridge.Since Docker does not provide native support on this, `pipeworks <https://github.com/jpetazzo/pipework>`_ can be used to simplify the work.
|
||||
Now you need to assign a static IP address for Docker container and attach it to the customized network bridge. Since Docker does not provide native support for this, `pipeworks <https://github.com/jpetazzo/pipework>`_ can be used to simplify the work.
|
||||
|
||||
First, download the "pipework" ::
|
||||
|
||||
@ -118,7 +118,7 @@ Assign a static IP address for Docker container and attach it to the customized
|
||||
|
||||
As an example, run ::
|
||||
|
||||
pipework br0 xcat2-11mn 10.5.106.101/24@10.5.106.1
|
||||
pipework br0 xcatmn 10.5.106.101/24@10.5.106.1
|
||||
|
||||
|
||||
Attach to the Docker container
|
||||
@ -126,9 +126,9 @@ Attach to the Docker container
|
||||
|
||||
You can attach to the container ::
|
||||
|
||||
sudo docker attach xcat2-11mn
|
||||
sudo docker attach xcatmn
|
||||
|
||||
Besides the terminal opened by ``docker attach``, you can also enable the ssh inside the container and login the Docker container via "ssh". For ubuntu, you can enable the ssh by:
|
||||
Besides the terminal opened by ``docker attach``, you can also enable the ssh inside the container and login to the Docker container via "ssh". For Ubuntu, you can enable the ssh by:
|
||||
|
||||
* change the "PermitRootLogin" to "yes" in "/etc/ssh/sshd_config"
|
||||
* set the password for "root" with ``passwd root``
|
||||
@ -150,9 +150,9 @@ Due to the features of Docker container, there are some differences from the xCA
|
||||
Known Issues
|
||||
------------
|
||||
|
||||
Since Docker is still in the maturing process, there are some issues which cause some problem for xCAT :
|
||||
Since Docker is still in the maturing process, there are some issues with xCAT:
|
||||
|
||||
* copycds might hang due to all the loop devices(/dev/loop1,/dev/loop2) in the Docker host are busy. You can run ``losetup -f`` to get the first available loop device, if it fails, you might need to add several loop devices with ::
|
||||
* copycds might hang when all the loop devices(/dev/loop1,/dev/loop2) in the Docker host are busy. You can run ``losetup -f`` to get the first available loop device, if it fails, you might need to add several loop devices with ::
|
||||
|
||||
mknod /dev/loop3 -m0660 b 7 3
|
||||
mknod /dev/loop4 -m0660 b 7 4
|
||||
|
Loading…
x
Reference in New Issue
Block a user