美文网首页
Elasticsearch工具

Elasticsearch工具

作者: 诺之林 | 来源:发表于2020-02-28 16:51 被阅读0次

目录

Elasticsearch

为表述方便 下述密码都为"123456"

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.3.zip

unzip elasticsearch-6.8.3.zip

cd elasticsearch-6.8.3

sudo sysctl -w vm.max_map_count=262144

./bin/elasticsearch-keystore create
# Created elasticsearch keystore in /path/to/elasticsearch-6.8.3/config
vim ./config/elasticsearch.yml
# xpack.security.enabled: true
# xpack.security.transport.ssl.enabled

./bin/elasticsearch -d

./bin/elasticsearch-setup-passwords interactive

kill -9 `lsof -t -i:9200`

./bin/elasticsearch -d

curl --basic -u elastic:123456 http://localhost:9200/?pretty

Elasticsearch Head

image.png
  • 方法2 => 下载本地使用
git clone git://github.com/mobz/elasticsearch-head.git

cd elasticsearch-head

cnpm install

cnpm run start
# Started connect web server on http://localhost:9100

通过浏览器访问 还需要设置ES的CORS跨域限制

vim ./config/elasticsearch.yml
# http.cors.enabled: true
# http.cors.allow-origin: "*"
# http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
# http.cors.allow-credentials: true

kill -9 `lsof -t -i:9200`

./bin/elasticsearch -d

最后连接如下http://localhost:9200/?auth_user=elastic&auth_password=123456

Dejavu

docker run --name "es-dejavu" -p 1358:1358 -d appbaseio/dejavu
# Started connect web server on http://localhost:1358

最后连接如下http://elastic:123456@localhost:9200

image.png

Kibana

wget https://artifacts.elastic.co/downloads/kibana/kibana-6.8.3-darwin-x86_64.tar.gz

tar xf kibana-6.8.3-darwin-x86_64.tar.gz

cd kibana-6.8.3-darwin-x86_64
vim ./config/kibana.yml
# elasticsearch.username: "elastic"
# elasticsearch.password: "123456"

./bin/kibana

最后连接如下http://localhost:5601 账号"kibana" 密码"123456"

image.png

参考

相关文章

网友评论

      本文标题:Elasticsearch工具

      本文链接:https://www.haomeiwen.com/subject/vwicqhtx.html