Elastic Search 7.0 添加数据提示 提示503错误

Elastic Search成功安装完毕。

 

测试数据添加出现

{
    "error": {
        "root_cause": [
            {
                "type": "cluster_block_exception",
                "reason": "blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/2/no master];",
                "suppressed": [
                    {
                        "type": "master_not_discovered_exception",
                        "reason": null
                    }
                ]
            }
        ],
        "type": "cluster_block_exception",
        "reason": "blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/2/no master];",
        "suppressed": [
            {
                "type": "master_not_discovered_exception",
                "reason": null
            }
        ]
    },
    "status": 503
}

 

 

Elastic Search 日志:

[2019-05-23T23:07:10,500][WARN ][o.e.c.c.ClusterFormationFailureHelper] [wei] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [node-1] to bootstrap a cluster: have discovered []; discovery will continue using [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304] from hosts providers and [{wei}{PRIUiwNlS3iosprI-SrhAg}{y4smTin2RZipIaDS7cc6qQ}{172.21.0.11}{172.21.0.11:9300}{ml.machine_memory=1928081408, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

 

##################################################################################################

解决办法:

1、先关闭Elastic,【只有一个java服务,所以直接killall 】

killall java

2、释放下内存,查看内存是否释放成功

echo 3 > /proc/sys/vm/drop_caches
 
free -m

3、找到elastic的config 目录

 mv elasticsearch.yml elasticsearch.yml.bak

4、尝试启动一下Elastic Search,启动完成之后看下9200和9300是否占用

bin/elasticsearch &

5、然后再把Elastic Search关闭  【:捂脸】

killall java

 

6、再把备份的文件还原一下【:捂脸】

cp elasticsearch.yml.bak elasticsearch.yml

7、尝试重新启动一下【:捂脸】

bin/elasticsearch & 

8、查看端口是否启用,浏览器输入 ip:9200,在使用postman测试一下,成功添加

{
    "_index": "shopuser",
    "_type": "_doc",
    "_id": "1",
    "_version": 1,
    "result": "created",
    "_shards": {
        "total": 2,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 0,
    "_primary_term": 1
}

####################################################################################################

具体没有找到,这样走了一遍,问题解决了,感觉可能是缓存导致的,需要下次在验证一下

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

奇葩也是花

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

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

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

打赏作者

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

抵扣说明:

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

余额充值