In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, the editor will share with you the relevant knowledge points about how to install docker on CentOS6.x. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
Docker container was first fully supported by rhel from the recent centos 7.0. it is officially stated that it can only run on 64-bit architecture platforms with kernel versions of 2.6.32-431 and above (i.e. > = centos 6.5, the actual prompt for running docker is 3.8.0 and above). For kernel upgrade, please refer to centos 6.x Kernel upgrade (2.6.32-> 3.10.58) It should be noted that the installation of centos 6.5 is a little different from 7.0. the installation package of docker on centos-6 is called docker-io and comes from the fedora epel library, this repository maintains a large number of software that is not included in the distribution, so first install epel, while the docker of centos-7 is directly included in the extras repository of the official mirror source (enable=1 is enabled in the [extras] section under centos-base.repo). The premise is that they all need to be connected to the Internet, and the specific installation process is as follows.
1. Disable selinux
# getenforceenforcing# setenforce 0permissive# vi / etc/selinux/configselinux=disabled...
two。 Install fedora epel
The epel-release-6-8.noarch.rpm package is included in the distribution media and can be installed from rpm.
# yum install epel-release-6-8.noarch.rpm// or yum-y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
If there is a problem with gpg key retrieval failed: [errno 14] could not open/read file:///etc/pki/rpm-gpg/rpm-gpg-key-epel-6, install epel online and download the rpm-gpg-key-epel-6 file.
After this step is performed, two files, epel.repo and epel-testing.repo, will be generated under / etc/yum.repos.d/ to download the rpm package from the fedora official website.
3. Check the kernel version
# uname-r2.6.32-431.el6.x86_64# cat / etc/redhat-release centos release 6.5 (final)
Seeing this minimum kernel version, it actually doesn't have much of a problem, and you can upgrade to version 3.10.x.
Alternatively, you can run the script check-config.sh to check that the kernel module characters do not match (there are some missing below, and my docker can still start normally):
[root@sean ~] #. / check-config warning: / proc/config.gz does not exist Searching other paths for kernel config...info: reading kernel config from / boot/config-2.6.32-431.el6.x86_64... generally necessary:- cgroup hierarchy: properly mounted [/ cgroup]-config_namespaces: enabled- config_net_ns: enabled- config_pid_ns: enabled- config_ipc_ns: enabled- config_uts_ns: enabled- config_devpts_multiple_instances: enabled- config_cgroups: enabled- config_cgroup_cpuacct: enabled- config_cgroup_device: enabled- Config_cgroup_freezer: enabled- config_cgroup_sched: enabled- config_macvlan: enabled- config_veth: enabled- config_bridge: enabled- config_nf_nat_ipv4: missing- config_ip_nf_target_masquerade: enabled- config_netfilter_xt_match_addrtype: missing- config_netfilter_xt_match_conntrack: enabled- config_nf_nat: enabled- config_nf_nat_needed: enabledoptional features:- config_memcg_swap: missing- config_resource_counters: enabled- config_cgroup_ Perf: enabled- storage drivers:-"aufs":-config_aufs_fs: missing-config_ext4_fs_posix_acl: enabled- config_ext4_fs_security: enabled- "btrfs":-config_btrfs_fs: enabled- "devicemapper":-config_blk_dev_dm: enabled- config_dm_thin_provisioning: enabled- config_ext4_fs: enabled- config_ext4_fs_posix_acl: enabled- config_ext4_fs_security: enabled
If you are compiling the kernel yourself, pay special attention to a few absolutely indispensable things: dm_thin_provisioning, ip_nf_target_masquerade, nf_nat. (there is no corresponding option for aufs_fs. It is not clear what happened, but it is not necessary.)
4. Install docker-io
# yum install docker-iodependencies resolved= package arch version repository size=installing: docker-io x86'64 1.1.2-1.el6 epel 4.5 minstalling for dependencies: lua-alt-getopt noarch 0.7.0-1.el6 epel 6.9 k lua-filesystem x86'64 1.4.2-1.el6 epel 24 k lua-lxc x86'64 1.0.6-1.el6 epel 15 k lxc X86'64 1.0.6-1.el6 epel 120k lxc-libs x86'64 1.0.6-1.el6 epel 248ktransaction summary=install 6 package (s)
Many documents are introduced here, and the next step is to mount the / cgroup file system. My docker version is 1.1.2, and there are no steps to modify / etc/fstab.
5. Start trial run
# service docker start// or # docker-d
6. Abnormal
During one of my installations, I unfortunately encountered the following problems:
Docker-d starts, or tail-f / var/log/docker views the log
[f32e7d9f] + job initserver () [f32e7d9f.initserver ()] creating server [f32e7d9f] + job serveapi (unix:///var/run/docker.sock) 13:02:45 on 2014-10-22 listening for http on unix (/ var/run/docker.sock) error running devicecreate (createpool) dm_task_run failed [f32e7d9f]-job initserver () = err (1) 2014-10-22 13:02:45 error running devicecreate (createpool) dm_task_run failed\ nwed oct 22 14:35:54 cst 2014\ n
Or service docker restart.
Stopping docker: [ok] starting cgconfig service: error: cannot mount cpuset to / cgroup/cpuset: device or resource busy/sbin/cgconfigparser; error loading / etc/cgconfig.conf: cgroup mounting failedfailed to parse / etc/cgconfig.conf [failed] starting docker: [ok]
Unable to enable network bridge nat: iptables failed: iptables-I postrouting-t nat-s 172.17.42.1 can't initialize iptables table 16!-d 172.17.42.1 can't initialize iptables table 16-j masquerade: iptables v1.4.7: can't initialize iptables table `(do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
The above three exceptions are all caused by the lack of kernel modules, which is also the risk of compiling the kernel to upgrade, so there is sciurus's kernel-ml-aufs rpm package.
These are all the contents of the article "how to install docker on CentOS6.x". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.