运行 Elasticsearch 的迁移 sudowww 'PHP artisan es:migrate' 报错

在Homestead中运行正常
file
但是在阿里云服务器上报错!报错截图如下!
file

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
leo
最佳答案

在服务器执行 $ /usr/share/elasticsearch/bin/elasticsearch-plugin list 看看输出什么,是不是 IK 插件有没有正确安装

5年前 评论
讨论数量: 18
leo

在服务器执行 $ /usr/share/elasticsearch/bin/elasticsearch-plugin list 看看输出什么,是不是 IK 插件有没有正确安装

5年前 评论

@leo 运行在服务器执行 $ /usr/share/elasticsearch/bin/elasticsearch-plugin list这个命令得到的是空的列表,应该是 IK 插件有没有正确安装,因为现在最新版的elasticsearch是6.4.2版的,但是elasticsearch-analysis-ik 这个插件最新版的是6.4.1的,然后应该是不兼容吧

5年前 评论
leo

@liuyubeyond1121 那需要等 IK 作者出对应的版本之后再手动安装

5年前 评论

@liuyubeyond1121 我的也是一样,请问你解决了吗?

5年前 评论

6.4.2版本的elasticsearch-analysis-ik出来了,10天前出的,可以下了

file

file

5年前 评论

@windtalker 怎么操作啊 兄弟 我这里报错了

正在处理索引 products
索引不存在,准备创建

In Connection.php line 615:

  {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Custom Anal
  yzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]"}],"type":"
  illegal_argument_exception","reason":"Custom Analyzer [ik_smart_synonym] failed to
   find tokenizer under name [ik_smart]"},"status":400}
5年前 评论

@Flourishing 这个就是plugin里面没有elasticsearch-analysis-ik,现在适配版本已经出来了,在自己的服务器上面(这个目录/usr/share/elasticsearch/bin)运行这个
elasticsearch-plugin install https://github.com/medcl/elasticsearch-ana...

5年前 评论

@windtalker elasticsearch-plugin: command not found。怎么回事

5年前 评论

@lianglunzhong 你可以看下你的阿里云服务器下面的这个目录下有没有elasticsearch-plugin这个命令,你也可以把这个bin目录设置到系统的PATH里面,就不用到这个目录下执行这个命令了。

file

5年前 评论
小花儿

@windtalker 你这个命令前面要加个. elasticsearch-plugin install https://github.com/medcl/elasticsearch-ana...

5年前 评论

@yangwb1 为什么我按你说的在命令前面加了. 还是不行

file

5年前 评论
小花儿

@lixiaode ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-ana...
你试试这个命令

5年前 评论

我用上面的方法一直安装不成功,原因是版本的兼容问题,到GitHub上找最新版本下载更新就行https://github.com/medcl/elasticsearch-analysis-ik/releases
安装完成后一定要记得重启
systemctl restart elasticsearch.service

5年前 评论

手动更新对应版本 /usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-ana...

4年前 评论

我这里ik插件安装成功了,也重启了,但是还是报错

file

4年前 评论
DamonYan 3年前

对,是elasticsearch版本和IK版本不对应造成的,选择对应版本的IK进行安装就可以了(步骤7),但是如果elasticsearch版本过高,IK没有对应版本的话就需要对elasticsearch进行降级

1、卸载elasticsearch

sudo apt-get --purge autoremove elasticsearch

2、删除目录:

sudo rm -rf /var/lib/elasticsearch/
sudo rm -rf /etc/elasticsearch

3、下载deb文件
下载地址:elasticsearch.cn/download/
4、安装
选择需要版本的安装文件
sudo dpkg -i elasticsearch-7.10.2.deb
5、启动服务
sudo service elasticsearch start
6、测试:
curl localhost:9200
7、安装Ik

IK版本选择地址:github.com/medcl/elasticsearch-ana...

然后安装对应的IK,

cd  /usr/share/elasticsearch/bin
./elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.2/elasticsearch-analysis-ik-7.4.2.zip

8、重启elasticsearch
systemctl restart elasticsearch.service

2年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!