97-centos 中 elasticsearch的安装和使用
  zLwy6mYxHxmB 2023年11月02日 47 0

安装和启动:

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.1.tar.gz
tar -xvf elasticsearch-6.0.1.tar.gz
cd elasticsearch-6.0.1/bin
./elasticsearch

在这里可能报错:

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

那就创建一个用户:

adduser es   #(userdel es)
passwd es  #(12345678)
chown -R es /home/res/elasticsearch-6.0.1
su es
./elasticsearch -d #(后台启动)

查看状态:

curl -X GET "localhost:9200/_cat/health?v&pretty"

新增:

curl -X PUT "localhost:9200/customer?pretty&pretty"

添加文档:

curl -X PUT "localhost:9200/customer/doc/1?pretty&pretty" -H 'Content-Type: application/json' -d'
{
  "name": "John Doe"
}
'

更多的操作参见官网文档了: https://www.elastic.co/guide/index.html

在“Docs in Your Native Tongue”有语言的选择。
中文的好像是文档不是最新的。
不过够用就行了。

中文的文档:
https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  sX9JkgY3DY86   2023年11月13日   43   0   0 idesedImage
  b1UHV4WKBb2S   2023年11月13日   40   0   0 ide抗锯齿
  b1UHV4WKBb2S   2023年11月13日   37   0   0 裁剪ideflutter
  zSWNgACtCQuP   2023年11月13日   32   0   0 ide
zLwy6mYxHxmB