我最近在rhel上安装了elasticsearch,并在配置文件中设置了节点名。后来,我用 sudo systemctl start elasticsearch.service
服务似乎正在按照status命令运行
sudo systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2020-11-25 14:59:13 CET; 2h 37min ago
Docs: https://www.elastic.co
Main PID: 6565 (java)
CGroup: /system.slice/elasticsearch.service
├─6565 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=t...
└─6754 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
Nov 25 14:59:05 hdm18 systemd[1]: Starting Elasticsearch...
Nov 25 14:59:13 hdm18 systemd[1]: Started Elasticsearch.
但是get的输出是返回一个html页面而不是json消息
curl -X GET "localhost:9200/?pretty"
<!-- IE friendly error message walkround.
if error message from server is less than
512 bytes IE v5+ will use its own error
message instead of the one returned by
server. -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta
enter code here
知道我做错什么了吗?
3条答案
按热度按时间nhhxz33t1#
您使用的是kibana dev console语法,而您似乎在尝试使用curl。查看教程时请检查curl语法。
对您来说,最简单的方法可能是使用kibana中的dev控制台。
nwlls2ji2#
我相信您从这个官方链接复制了您的命令,但是如果您复制curl命令
curl -X GET "localhost:9200/?pretty".
上面和下面将打印正确的输出。kzipqqlq3#
通过使用