如何在centos 6.5 下利用docker里部署elasticsearch
2017-10-20 09:02
357 查看
安装docker
[root@localhost ~]# uname -r
2.6.32-431.el6.x86_64
[root@localhost ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
注意其他的源可能导致你的内核和docker的版本不一致,需要升级内核至3.x。
安装:
[root@localhost ~]# rpm -ivh http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.JN76fI: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@localhost ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
yum -y install epel-release
yum -y install docker-io
service docker start
chkconfig docker on
注意其他的源可能导致你的内核和docker的版本不一致,需要升级内核至3.x。
yum install device-mapper-event-libs
下载镜像
docker pull elasticsearch:2
mkdir -p /es/{data01,data02,logs,elasticsearch}
chown elasticsearch.elasticsearch -R /es
docker cp es/ es:/etc/elasticsearch/ docker里配置cp到主机,之后修改配置文件
docker exec -it es bash
[root@bogon ~]# cd /es/elasticsearch/
[root@bogon elasticsearch]# ls
elasticsearch.yml logging.yml scripts
[root@bogon elasticsearch]#
chmod 777 -R /es/
由于本机还有一个ES,怕端口冲突,因此端口做了下更改如下
[root@bogon elasticsearch]# cat elasticsearch.yml
network.host: 0.0.0.0
path.data: /data01,/data02
path.logs: /logs
http.port: 9292
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["10.80.1.11","10.80.1.12","10.80.1.13","10.80.1.14","10.80.1.15"]
transport.tcp.port: 9393
启动ES
docker run --net=host -d -p 9292:9292 -p 9393:9393 --name es -v /es/elasticsearch:/usr/share/elasticsearch/config -v /es/data01:/data01 -v /es/data02:/data02 -v /es/logs:/logs -u root b4c7b5ea84aa
time="2017-10-20T15:26:08+08:00" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
time="2017-10-20T15:26:08+08:00" level="info" msg="WARNING: You are running linux kernel version 2.6.32-431.el6.x86_64, which might be unstable running docker. Please u
pgrade your kernel to 3.8.0.
time="2017-0-20T15:26:08+08:00" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)"
/usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time r
eference
解决办法:
执行:yum upgrade device-mapper-libs
[root@localhost ~]# uname -r
2.6.32-431.el6.x86_64
[root@localhost ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
注意其他的源可能导致你的内核和docker的版本不一致,需要升级内核至3.x。
安装:
[root@localhost ~]# rpm -ivh http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.JN76fI: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@localhost ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
yum -y install epel-release
yum -y install docker-io
service docker start
chkconfig docker on
注意其他的源可能导致你的内核和docker的版本不一致,需要升级内核至3.x。
yum install device-mapper-event-libs
下载镜像
docker pull elasticsearch:2
mkdir -p /es/{data01,data02,logs,elasticsearch}
chown elasticsearch.elasticsearch -R /es
docker cp es/ es:/etc/elasticsearch/ docker里配置cp到主机,之后修改配置文件
docker exec -it es bash
[root@bogon ~]# cd /es/elasticsearch/
[root@bogon elasticsearch]# ls
elasticsearch.yml logging.yml scripts
[root@bogon elasticsearch]#
chmod 777 -R /es/
由于本机还有一个ES,怕端口冲突,因此端口做了下更改如下
[root@bogon elasticsearch]# cat elasticsearch.yml
network.host: 0.0.0.0
path.data: /data01,/data02
path.logs: /logs
http.port: 9292
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["10.80.1.11","10.80.1.12","10.80.1.13","10.80.1.14","10.80.1.15"]
transport.tcp.port: 9393
启动ES
docker run --net=host -d -p 9292:9292 -p 9393:9393 --name es -v /es/elasticsearch:/usr/share/elasticsearch/config -v /es/data01:/data01 -v /es/data02:/data02 -v /es/logs:/logs -u root b4c7b5ea84aa
time="2017-10-20T15:26:08+08:00" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
time="2017-10-20T15:26:08+08:00" level="info" msg="WARNING: You are running linux kernel version 2.6.32-431.el6.x86_64, which might be unstable running docker. Please u
pgrade your kernel to 3.8.0.
time="2017-0-20T15:26:08+08:00" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)"
/usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time r
eference
解决办法:
执行:yum upgrade device-mapper-libs
相关文章推荐
- 在centos docker中利用nginx部署静态网站
- centos7 在docker swarm中运行Jenkins,利用gitlab的webhook触发自动部署脚本
- 如何利用docker 构建golang线上部署环境
- centos 6.5以下chrome healess,部署,用docker的方式
- 关于如何在docker中利用tomcat和MySQL容器部署java web应用的详细步骤
- Centos6.5:Docker下部署Ceph
- Centos6.5利用RubyGems的fpm制作zabbix_agent的rpm包,并使用ansible批量部署
- Centos6.5利用RubyGems的fpm制作zabbix_agent的rpm包,并使用ansible批量部署 推荐
- centos6.5下 docker下gitlab的部署安装
- AWS EC2 CentOS release 6.5 部署zookeeper、kafka、dubbo
- centos6.5系统下如何修改时区
- Docker部署Elasticsearch集群
- 利用Spring Cloud和Docker构建微服务以及如何构建起自我修复型分布式系统
- CentOS 6.5 安装部署zabbix(Agent客户端篇)
- centos6.5安装docker
- centos6.5安装docker
- CentOS6.5安装部署zabbix
- centOS6.5如何从启动界面直接进入命令行界面
- zookeeper3.4.6分布式数据一致性服务集群在CentOS6.5上部署(何志雄)
- 利用docker来部署web应用