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)06/01 Report--
This article focuses on "how to install docker on CentOS 6.x". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install docker on CentOS 6.x.
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.
At this point, I believe you have a deeper understanding of "how to install docker on CentOS 6.x". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.