linux centos7安装elasticsearch

慢慢写,慢慢加油

下载es连接

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.3-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.3-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-7.16.3-linux-x86_64.tar.gz.sha512 
tar -xzf elasticsearch-7.16.3-linux-x86_64.tar.gz

如果shasum命令找不到,请下载,

yum install perl-Digest-SHA

更改配置文件

es目录里的config里的jvm.options

-Xms256m
-Xmx256m

启动es

当启动es的bin里的
在这里插入图片描述
会报错

java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:107)
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)

elasticsearch不能在root下执行
因此

创建es组,并把elasticsearch-7.16.3文件夹加入如权限

[root@localhost bin]# groupadd es
[root@localhost bin]# useradd es -g es
[root@localhost bin]# passwd es
[root@localhost bin]# chown -R es:es elasticsearch-7.16.3

切换es用户,到es的bin目录,进行启动

[root@localhost bin]# su es
[root@localhost bin]# ./elasticsearch

可启动成功了,访问

curl localhost:9200
[root@localhost ~]# curl localhost:9200
{
  "name" : "localhost.localdomain",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "vndxxZbCSIO58HZw8K3P1Q",
  "version" : {
    "number" : "7.16.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "4e6e4eab2297e949ec994e688dad46290d018022",
    "build_date" : "2022-01-06T23:43:02.825887787Z",
    "build_snapshot" : false,
    "lucene_version" : "8.10.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

参考资料

centos 解决 -bash: shasum: command not found
elasticsearch之can not run elasticsearch as root

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值