【curl/elastic】使用curl訪問有用戶名密碼認證的elasticsearch服務


命令:

 curl -u elastic:123456 -XGET 'localhost:9200/_cat/indices?v'

-u 后跟上用戶名+“:”+密碼,后面就是實際的訪問指令。

示例:

[hy@localhost ~]$ curl -u elastic:123456 -XGET 'localhost:9200/_cat/indices?v'
health status index       uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   .security-7 c3ozcN3FRAyYEgn2V21ypA   1   0          7            0     25.7kb         25.7kb

END


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM