Linux下安装elasticsearch

安装ElasticSearch

[root@play ~]``# docker pull elasticsearch:7.4.2
7.4.2: Pulling from library``/elasticsearch
d8d02d457314: Pull complete
f26fec8fc1eb: Pull complete
8177ad1fe56d: Pull complete
d8fdf75b73c1: Pull complete
47ac89c1da81: Pull complete
fc8e09b48887: Pull complete
367b97f47d5c: Pull complete
Digest: sha256:543bf7a3d61781bad337d31e6cc5895f16b55aed4da48f40c346352420927f74
Status: Downloaded newer image ``for` `elasticsearch:7.4.2
docker.io``/library/elasticsearch``:7.4.2
[root@play ~]``# free -m
       ``total    used    ``free`   `shared buff``/cache`  `available
Mem:      7821    2802     476     16    4542    4703
Swap:     1639     11    1628
[root@play ~]# mkdir -p /opt/elasticsearch/config
[root@play ~]# mkdir -p /opt/elasticsearch/data
[root@play ~]# echo "http.host: 0.0.0.0" > /opt/elasticsearch/config/elasticsearch.yml
[root@play ~]# cat /opt/elasticsearch/config/elasticsearch.yml
http.host: 0.0.0.0
[root@play ~]# docker run --name elasticsearch -p 9200:9200 -p 9300:9300 --privileged=true \
> -e "discovery.type=single-node"  \
> -e ES_JAVA_OPTS="-Xms64m -Xms512m"  \
> -v    /opt/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml   \
> -v /opt/elasticsearch/data:/usr/share/elasticsearch/data   \
> -v /opt/elasticsearch/plugins:/usr/share/elasticsearch/plugins   \
> -d elasticsearch:7.4.2  
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 --privileged=true \
 -e "discovery.type=single-node"  \
 -e ES_JAVA_OPTS="-Xms64m -Xms512m"  \
 -v /opt/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml   \
 -v /opt/elasticsearch/data:/usr/share/elasticsearch/data   \
 -v /opt/elasticsearch/plugins:/usr/share/elasticsearch/plugins   \
 -d elasticsearch:7.4.2

但是会报错显示权限不足

img

赋予读写执行权限

chmod -R 777 /opt/elasticsearch/

如果是centOS的话,还要配置安全组才能访问

安装kibana

[root@play elasticsearch]# docker pull kibana:7.4.2
7.4.2: Pulling from library/kibana
d8d02d457314: Already exists
bc64069ca967: Pull complete
c7aae8f7d300: Pull complete
8da0971e3b41: Pull complete
58ea4bb2901c: Pull complete
b1e21d4c2a7e: Pull complete
3953eac632cb: Pull complete
5f4406500758: Pull complete
340d85e0d1c7: Pull complete
1768564d16fb: Pull complete
Digest: sha256:355f9c979dc9cdac3ff9a75a817b8b7660575e492bf7dbe796e705168f167efc
Status: Downloaded newer image for kibana:7.4.2
docker.io/library/kibana:7.4.2

[root@play elasticsearch]#docker run --name kibana -e ELASTICSEARCH_HOSTS=http:自己的ip:9200 -p 5601:5601 -d kibana:7.4.2
02569f8df4a2ac8548308661c517eb8979de96ce9345400a58a78a5d1ea7ca2b

kibana:7.4.2
02569f8df4a2ac8548308661c517eb8979de96ce9345400a58a78a5d1ea7ca2b


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值