SHARE
TWEET

es-docker-compose.yml

correiabrux Jan 23rd, 2019 (edited) 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $cat docker-compose.yml
  2. version: '3'
  3. services:
  4.   elasticsearch:
  5.     image: elasticsearch:6.5.4
  6.     ports:
  7.       - 9200:9200
  8.       - 9300:9300
  9.  
  10. #Aumentando limite de memória para container
  11. $sudo sysctl -w vm.max_map_count=262144
  12.  
  13. #Subindo ambiente docker-compose em background
  14. $sudo docker-compose up -d
  15.  
  16. #Checando saúde do ElasticSearch
  17. $curl -X GET "localhost:9200/_cluster/health"
  18.  
  19. #Inserindo registro onde o index é twitter, type é _doc e _id é 1
  20. $curl -X PUT "localhost:9200/twitter/_doc/1" -H 'Content-Type: application/json' -d'
  21. {
  22.    "user" : "kimchy",
  23.    "post_date" : "2009-11-15T14:12:12",
  24.    "message" : "trying out Elasticsearch"
  25. }
  26. '
  27.  
  28. #Buscando registro onde o index é twitter, type é _doc e _id é 1  
  29. $curl -X GET "localhost:9200/twitter/_doc/1"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top