mac 容器化 安装docker & es | redis

brew install docker

安装桌面版 docker-destop 

在桌面端搜索对应的es 版本 

docker 安装elasticsearch 

先确保java 已安装 oracle-jdk17 LTS 版本 

报错:ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch
2024-08-08 09:10:50 bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log

原因:启动方式不对 蛇精病 

修改配置文件 

mdfind elasticsearch.yml     &&  sudo  vim  elasticsearch.yml

# bootstrap.ignore_system_bootstrap_checks: true

#discovery.zen.minimum_master_nodes: 1

network.host: 0.0.0.0
#- _local_
#- _site_
node.name: node-1
network.publish_host: 0.0.0.0
cluster.initial_master_nodes: ["node-1"]

# Enable scripting as described here: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
script.inline: true
script.stored: true
script.file:   true

运行命令   输入对应的容器ID 

docker run -e ES_JAVA_OPTS="-Xms1024m -Xmx1024m" -e "discovery.type=single-node" -d -p 9200:9200 -p 9300:9300 --name elasticsearch ce6def07c368

curl http://localhost:9200 

安装 redis 

在docker desktop 上面搜索对应的redis  版本  

在 docker desktop上面 启动 容器 或者使用命令行的方式指定容器的名称  

docker run --name redis -p6379:6379 -d redis:7.4

连接容器的 redis   因做了地址映射 可以直接在本地连接  

redis-cli  

安装ngrok    docker 容器  

在docker desktop 上搜索 ngrok  

运行容器 

docker run -it--name ngrok  -e NGROK_AUTHTOKEN=token值后台获取  -d ngrok/ngrok http 8888

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

村长在路上

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值