SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
ElasticSearch



Friday, March 8, 13
Links


                      • https://bitbucket.org/lsdr/es/overview
                      • https://confluence.abril.com.br/x/J5I_AQ


Friday, March 8, 13
Instalação

                      • Mac OSX:
                       •   brew install elasticsearch

                      • CentOS 6.x:
                       •   não tem RPM oficial :-(

                       •   https://gist.github.com/lsdr/5117589




Friday, March 8, 13
Setup

                 cluster.name: buffalo
                 node.name:    "Bruce Smith"

                 path.data:    /usr/local/var/elasticsearch/
                 path.logs:    /usr/local/var/log/elasticsearch/
                 path.plugins: /usr/local/var/lib/elasticsearch/plugins

                 network.host: 127.0.0.1




                          suficiente para subir um server local!

Friday, March 8, 13
Setup++
                      • Configuração de um nó:
                                                                    Master
                                                           TRUE              FALSE
                                         TRUE            Development        Workhorse
                         Data
                                         FALSE           Coordinator       Load Balancer


                          http://elasticsearch.org/guide/reference/modules/node.html


Friday, March 8, 13
Setup++
                      • # shards e # replicas
                        •   possível aumentar replicas em runtime, shards
                            não

                      • Plugins “obrigatórios”
                        •   só inicia nó se estiverem presentes

                      • Tunning JVM
                      • Outros módulos: Thrift, JMX
Friday, March 8, 13
“Hello World!”


                      $ curl -XGET 'localhost:9200/world'


                      No handler found for uri [/world] and method [GET]




Friday, March 8, 13
“Hello World!”

                      curl -XPOST "localhost:9200/world/hello" -d
                      '{
                         "text": "hello world",
                         "lang": "en"
                      }'




Friday, March 8, 13
“Hello World!”

                      {
                          "ok": true,
                          "_index": "world",
                          "_type": "hello",
                          "_id": "A5HX8IhTR0CzMNWHBPhEqA",
                          "_version": 1
                      }




                                POST: id automágico | PUT: id “manual”


Friday, March 8, 13
“Hello World!”
                      $ curl -XGET 'localhost:9200/world/_count’


                      {
                          "count":1,
                          "_shards":
                            {
                              "total": 3,
                              "successful": 3,
                              "failed":0
                            }
                      }




Friday, March 8, 13
“Hello World!”
                      $ curl -XGET 'localhost:9200/world/_search’


                      "hits" [
                        {
                          "_index": "world",
                          "_type": "hello",
                          "_id": "A5HX8IhTR0CzMNWHBPhEqA",
                          "_score": 1.0,
                          "_source": {"text": "hello world", "lang": "en"}
                        }
                      ]




Friday, March 8, 13
“Hello World!”
                      $ curl -XGET 'localhost:9200/world/hello/_mapping’
                      {
                          "hello": {
                            "properties": {
                              "lang": {
                                 "type": "string"
                              },
                              "text": {
                                 "type": "string"
                              }
                            }
                          }
                      }


Friday, March 8, 13
Mapping

            Mapping is the process of defining how a document
             should be mapped to the Search Engine, including
             its searchable characteristics such as which fields
               are searchable and if/how they are tokenized.

                      http://elasticsearch.org/guide/reference/mapping/




Friday, March 8, 13
Querying
                      • URI Request
                       •   Não expõe todos os features do ES

                       •   /guide/reference/api/search/uri-request.html

                      • Query DSL
                       •   POST-based (no cache!)

                       •   /guide/reference/query-dsl/



Friday, March 8, 13
Querying

                      • Brincar de fazer queries em matérias!

                      • Queries simples funcionam, mas...
                        •   facets quebram?




Friday, March 8, 13
Mapping

              By default, there isn’t a need to define an explicit
              mapping, (...) Only when the defaults need to be
             overridden must a mapping definition be provided.


                      http://elasticsearch.org/guide/reference/mapping/




Friday, March 8, 13
Mapping

                      • Override não é trivial
                      • Possivelmente envolve reindexação
                      • Esse é o trabalho do time
                       •   “massagistas de dados”




Friday, March 8, 13
Analyzer


             curl -XGET 'localhost:9200/_analyze?analyzer=standard' -d
             'Esporte::Futebol'


             curl -XGET 'localhost:9200/_analyze?analyzer=keyword' -d
             'Esporte::Futebol'




Friday, March 8, 13
River




Friday, March 8, 13
River
                      • Cria índices/mappings se não existir
                        •   lembrar limitações

                      • Pulling
                      • elasticsearch-river-mongo
                        •   Explode se o mongo estiver fora

                        •   Demora (se perde?) quando voltar



Friday, March 8, 13
River

                      • Instalar River (plugin)
                      • Criar River
                      • mongorestore


Friday, March 8, 13
River

             $ES_HOME/bin/plugin	
  -­‐install	
  elasticsearch/elasticsearch-­‐mapper-­‐
             attachments/1.6.0

             $ES_HOME/bin/plugin	
  -­‐url	
  https://github.com/downloads/
             richardwilly98/elasticsearch-­‐river-­‐mongodb/elasticsearch-­‐river-­‐
             mongodb-­‐1.6.1.zip	
  -­‐install	
  river-­‐mongodb




Friday, March 8, 13
River
                      curl -XPUT "localhost:9200/_river/v/_meta" -d '{
                         "type": "mongodb",
                         "mongodb": {
                            "db": "alx_midia",
                            "collection": "videos",
                            "servers": [
                              { "host": "localhost", "port": "27017" }
                            ]
                         },
                         "index": {
                            "name": "videos",
                            "type": "documents"
                         }
                      }'

                                        origem - destino
Friday, March 8, 13
River
                      curl -XGET "localhost:9200/_river/v/_meta"
                      {
                          "_index": "_river",
                          "_id": "_meta",
                          "exists": true,
                          "_source": {
                              "type": "mongodb",
                              "mongodb": {
                                  "db": "alx_midia",
                                  "collection": "videos",
                                  "servers": [
                                       { "host": "localhost", "port": "27017" }
                                  ]
                              },
                              "index": {
                                  "name": "videos",
                                  "type": "documents"
                              }
                          }
                      }


Friday, March 8, 13
River


                      $ mongorestore --host localhost --port 27017
                      --noIndexRestore alx_midia




Friday, March 8, 13
River

           [videos] creating index, cause [api], shards [3]/[1], mappings []
           [_river] update_mapping [v] (dynamic)
           [mongodb][v] No known previous slurping time for this collection
           [_river] update_mapping [v] (dynamic)
           [videos] update_mapping [documents] (dynamic)
           Indexed 100 insertions 0, updates, 0 deletions, 100 documents per second
           Indexed 100 insertions 0, updates, 0 deletions, 100 documents per second
           Indexed 81 insertions 0, updates, 0 deletions, 81 documents per second
           Indexed 100 insertions 0, updates, 0 deletions, 100 documents per second
           Indexed 15 insertions 0, updates, 0 deletions, 15 documents per second




Friday, March 8, 13
River

                      • Na operação padrão, não vai ter
                        “restore” em caso de falha
                      • Necessário pensar em uma solução de
                        “recrawling”




Friday, March 8, 13

Más contenido relacionado

La actualidad más candente

Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Oleksiy Panchenko
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logsSmartLogic
 
Logstash family introduction
Logstash family introductionLogstash family introduction
Logstash family introductionOwen Wu
 
Introduction to ELK
Introduction to ELKIntroduction to ELK
Introduction to ELKYuHsuan Chen
 
Mobile Analytics mit Elasticsearch und Kibana
Mobile Analytics mit Elasticsearch und KibanaMobile Analytics mit Elasticsearch und Kibana
Mobile Analytics mit Elasticsearch und Kibanainovex GmbH
 
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupLogstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupStartit
 
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and SolrSide by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and SolrSematext Group, Inc.
 
Application Logging With The ELK Stack
Application Logging With The ELK StackApplication Logging With The ELK Stack
Application Logging With The ELK Stackbenwaine
 
Logging logs with Logstash - Devops MK 10-02-2016
Logging logs with Logstash - Devops MK 10-02-2016Logging logs with Logstash - Devops MK 10-02-2016
Logging logs with Logstash - Devops MK 10-02-2016Steve Howe
 
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...Sematext Group, Inc.
 
Deploying E.L.K stack w Puppet
Deploying E.L.K stack w PuppetDeploying E.L.K stack w Puppet
Deploying E.L.K stack w PuppetColin Brown
 
PySpark with Juypter
PySpark with JuypterPySpark with Juypter
PySpark with JuypterLi Ming Tsai
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...ForgeRock
 

La actualidad más candente (20)

Using Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibanaUsing Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibana
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
 
Elk stack @inbot
Elk stack @inbotElk stack @inbot
Elk stack @inbot
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 
Logstash family introduction
Logstash family introductionLogstash family introduction
Logstash family introduction
 
Introduction to ELK
Introduction to ELKIntroduction to ELK
Introduction to ELK
 
Mobile Analytics mit Elasticsearch und Kibana
Mobile Analytics mit Elasticsearch und KibanaMobile Analytics mit Elasticsearch und Kibana
Mobile Analytics mit Elasticsearch und Kibana
 
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupLogstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
 
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and SolrSide by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and Solr
 
elk_stack_alexander_szalonnas
elk_stack_alexander_szalonnaselk_stack_alexander_szalonnas
elk_stack_alexander_szalonnas
 
Application Logging With The ELK Stack
Application Logging With The ELK StackApplication Logging With The ELK Stack
Application Logging With The ELK Stack
 
Logging logs with Logstash - Devops MK 10-02-2016
Logging logs with Logstash - Devops MK 10-02-2016Logging logs with Logstash - Devops MK 10-02-2016
Logging logs with Logstash - Devops MK 10-02-2016
 
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
Elk scilifelab
Elk scilifelabElk scilifelab
Elk scilifelab
 
Introduction to solr
Introduction to solrIntroduction to solr
Introduction to solr
 
Deploying E.L.K stack w Puppet
Deploying E.L.K stack w PuppetDeploying E.L.K stack w Puppet
Deploying E.L.K stack w Puppet
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
PySpark with Juypter
PySpark with JuypterPySpark with Juypter
PySpark with Juypter
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
 

Destacado

elasticsearchプラグイン入門
elasticsearchプラグイン入門elasticsearchプラグイン入門
elasticsearchプラグイン入門Shinsuke Sugaya
 
Elasticsearch入門 pyfes 201207
Elasticsearch入門 pyfes 201207Elasticsearch入門 pyfes 201207
Elasticsearch入門 pyfes 201207Jun Ohtani
 
Elasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライドElasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライド崇介 藤井
 
リクルート流Elasticsearchの使い方
リクルート流Elasticsearchの使い方リクルート流Elasticsearchの使い方
リクルート流Elasticsearchの使い方Recruit Technologies
 
Elasticsearchのサジェスト機能を使った話
Elasticsearchのサジェスト機能を使った話Elasticsearchのサジェスト機能を使った話
Elasticsearchのサジェスト機能を使った話ktaro_w
 
Elasticsearchで作る形態素解析サーバ
Elasticsearchで作る形態素解析サーバElasticsearchで作る形態素解析サーバ
Elasticsearchで作る形態素解析サーバShinsuke Sugaya
 
Elasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみたElasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみたRyoji Kurosawa
 
Amebaにおけるログ解析基盤Patriotの活用事例
Amebaにおけるログ解析基盤Patriotの活用事例Amebaにおけるログ解析基盤Patriotの活用事例
Amebaにおけるログ解析基盤Patriotの活用事例cyberagent
 
Flumeを活用したAmebaにおける大規模ログ収集システム
Flumeを活用したAmebaにおける大規模ログ収集システムFlumeを活用したAmebaにおける大規模ログ収集システム
Flumeを活用したAmebaにおける大規模ログ収集システムSatoshi Iijima
 
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAmazon Web Services
 
Elasticsearch+nodejs+dynamodbで作る全社システム基盤
Elasticsearch+nodejs+dynamodbで作る全社システム基盤Elasticsearch+nodejs+dynamodbで作る全社システム基盤
Elasticsearch+nodejs+dynamodbで作る全社システム基盤Recruit Technologies
 
[Black Belt Online Seminar] AWS上でのログ管理
[Black Belt Online Seminar] AWS上でのログ管理[Black Belt Online Seminar] AWS上でのログ管理
[Black Belt Online Seminar] AWS上でのログ管理Amazon Web Services Japan
 
Fluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターンFluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターンKentaro Yoshida
 
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data AnalyticsAmazon Web Services
 

Destacado (14)

elasticsearchプラグイン入門
elasticsearchプラグイン入門elasticsearchプラグイン入門
elasticsearchプラグイン入門
 
Elasticsearch入門 pyfes 201207
Elasticsearch入門 pyfes 201207Elasticsearch入門 pyfes 201207
Elasticsearch入門 pyfes 201207
 
Elasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライドElasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライド
 
リクルート流Elasticsearchの使い方
リクルート流Elasticsearchの使い方リクルート流Elasticsearchの使い方
リクルート流Elasticsearchの使い方
 
Elasticsearchのサジェスト機能を使った話
Elasticsearchのサジェスト機能を使った話Elasticsearchのサジェスト機能を使った話
Elasticsearchのサジェスト機能を使った話
 
Elasticsearchで作る形態素解析サーバ
Elasticsearchで作る形態素解析サーバElasticsearchで作る形態素解析サーバ
Elasticsearchで作る形態素解析サーバ
 
Elasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみたElasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみた
 
Amebaにおけるログ解析基盤Patriotの活用事例
Amebaにおけるログ解析基盤Patriotの活用事例Amebaにおけるログ解析基盤Patriotの活用事例
Amebaにおけるログ解析基盤Patriotの活用事例
 
Flumeを活用したAmebaにおける大規模ログ収集システム
Flumeを活用したAmebaにおける大規模ログ収集システムFlumeを活用したAmebaにおける大規模ログ収集システム
Flumeを活用したAmebaにおける大規模ログ収集システム
 
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
 
Elasticsearch+nodejs+dynamodbで作る全社システム基盤
Elasticsearch+nodejs+dynamodbで作る全社システム基盤Elasticsearch+nodejs+dynamodbで作る全社システム基盤
Elasticsearch+nodejs+dynamodbで作る全社システム基盤
 
[Black Belt Online Seminar] AWS上でのログ管理
[Black Belt Online Seminar] AWS上でのログ管理[Black Belt Online Seminar] AWS上でのログ管理
[Black Belt Online Seminar] AWS上でのログ管理
 
Fluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターンFluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターン
 
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
 

Similar a ElasticSearch

quick intro to elastic search
quick intro to elastic search quick intro to elastic search
quick intro to elastic search medcl
 
Puppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet
 
Elasticsearch in 15 minutes
Elasticsearch in 15 minutesElasticsearch in 15 minutes
Elasticsearch in 15 minutesDavid Pilato
 
Agile analytics applications on hadoop
Agile analytics applications on hadoopAgile analytics applications on hadoop
Agile analytics applications on hadoopRussell Jurney
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshopMathieu Elie
 
Easy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEEasy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEJBUG London
 
WWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesWWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesPablo Mendes
 
Visualizing Web Data Query Results
Visualizing Web Data Query ResultsVisualizing Web Data Query Results
Visualizing Web Data Query ResultsAnja Jentzsch
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Prajal Kulkarni
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Olaf Alders
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationArjen Schoneveld
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with SolrErik Hatcher
 
Objective-C A Beginner's Dive
Objective-C A Beginner's DiveObjective-C A Beginner's Dive
Objective-C A Beginner's DiveAltece
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with SolrErik Hatcher
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on awsEmanuel Calvo
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013 Pablo Godel
 

Similar a ElasticSearch (20)

Caching tips
Caching tipsCaching tips
Caching tips
 
quick intro to elastic search
quick intro to elastic search quick intro to elastic search
quick intro to elastic search
 
Puppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worlds
 
Elasticsearch in 15 minutes
Elasticsearch in 15 minutesElasticsearch in 15 minutes
Elasticsearch in 15 minutes
 
Agile analytics applications on hadoop
Agile analytics applications on hadoopAgile analytics applications on hadoop
Agile analytics applications on hadoop
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshop
 
Easy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEEasy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDE
 
Camel overview
Camel overview Camel overview
Camel overview
 
Rails Intro & Tutorial
Rails Intro & TutorialRails Intro & Tutorial
Rails Intro & Tutorial
 
WWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesWWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL Queries
 
Visualizing Web Data Query Results
Visualizing Web Data Query ResultsVisualizing Web Data Query Results
Visualizing Web Data Query Results
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 Presentation
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Objective-C A Beginner's Dive
Objective-C A Beginner's DiveObjective-C A Beginner's Dive
Objective-C A Beginner's Dive
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on aws
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsZilliz
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your QueriesExploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your QueriesSanjay Willie
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your QueriesExploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 

ElasticSearch

  • 2. Links • https://bitbucket.org/lsdr/es/overview • https://confluence.abril.com.br/x/J5I_AQ Friday, March 8, 13
  • 3. Instalação • Mac OSX: • brew install elasticsearch • CentOS 6.x: • não tem RPM oficial :-( • https://gist.github.com/lsdr/5117589 Friday, March 8, 13
  • 4. Setup cluster.name: buffalo node.name: "Bruce Smith" path.data: /usr/local/var/elasticsearch/ path.logs: /usr/local/var/log/elasticsearch/ path.plugins: /usr/local/var/lib/elasticsearch/plugins network.host: 127.0.0.1 suficiente para subir um server local! Friday, March 8, 13
  • 5. Setup++ • Configuração de um nó: Master TRUE FALSE TRUE Development Workhorse Data FALSE Coordinator Load Balancer http://elasticsearch.org/guide/reference/modules/node.html Friday, March 8, 13
  • 6. Setup++ • # shards e # replicas • possível aumentar replicas em runtime, shards não • Plugins “obrigatórios” • só inicia nó se estiverem presentes • Tunning JVM • Outros módulos: Thrift, JMX Friday, March 8, 13
  • 7. “Hello World!” $ curl -XGET 'localhost:9200/world' No handler found for uri [/world] and method [GET] Friday, March 8, 13
  • 8. “Hello World!” curl -XPOST "localhost:9200/world/hello" -d '{ "text": "hello world", "lang": "en" }' Friday, March 8, 13
  • 9. “Hello World!” { "ok": true, "_index": "world", "_type": "hello", "_id": "A5HX8IhTR0CzMNWHBPhEqA", "_version": 1 } POST: id automágico | PUT: id “manual” Friday, March 8, 13
  • 10. “Hello World!” $ curl -XGET 'localhost:9200/world/_count’ { "count":1, "_shards": { "total": 3, "successful": 3, "failed":0 } } Friday, March 8, 13
  • 11. “Hello World!” $ curl -XGET 'localhost:9200/world/_search’ "hits" [ { "_index": "world", "_type": "hello", "_id": "A5HX8IhTR0CzMNWHBPhEqA", "_score": 1.0, "_source": {"text": "hello world", "lang": "en"} } ] Friday, March 8, 13
  • 12. “Hello World!” $ curl -XGET 'localhost:9200/world/hello/_mapping’ { "hello": { "properties": { "lang": { "type": "string" }, "text": { "type": "string" } } } } Friday, March 8, 13
  • 13. Mapping Mapping is the process of defining how a document should be mapped to the Search Engine, including its searchable characteristics such as which fields are searchable and if/how they are tokenized. http://elasticsearch.org/guide/reference/mapping/ Friday, March 8, 13
  • 14. Querying • URI Request • Não expõe todos os features do ES • /guide/reference/api/search/uri-request.html • Query DSL • POST-based (no cache!) • /guide/reference/query-dsl/ Friday, March 8, 13
  • 15. Querying • Brincar de fazer queries em matérias! • Queries simples funcionam, mas... • facets quebram? Friday, March 8, 13
  • 16. Mapping By default, there isn’t a need to define an explicit mapping, (...) Only when the defaults need to be overridden must a mapping definition be provided. http://elasticsearch.org/guide/reference/mapping/ Friday, March 8, 13
  • 17. Mapping • Override não é trivial • Possivelmente envolve reindexação • Esse é o trabalho do time • “massagistas de dados” Friday, March 8, 13
  • 18. Analyzer curl -XGET 'localhost:9200/_analyze?analyzer=standard' -d 'Esporte::Futebol' curl -XGET 'localhost:9200/_analyze?analyzer=keyword' -d 'Esporte::Futebol' Friday, March 8, 13
  • 20. River • Cria índices/mappings se não existir • lembrar limitações • Pulling • elasticsearch-river-mongo • Explode se o mongo estiver fora • Demora (se perde?) quando voltar Friday, March 8, 13
  • 21. River • Instalar River (plugin) • Criar River • mongorestore Friday, March 8, 13
  • 22. River $ES_HOME/bin/plugin  -­‐install  elasticsearch/elasticsearch-­‐mapper-­‐ attachments/1.6.0 $ES_HOME/bin/plugin  -­‐url  https://github.com/downloads/ richardwilly98/elasticsearch-­‐river-­‐mongodb/elasticsearch-­‐river-­‐ mongodb-­‐1.6.1.zip  -­‐install  river-­‐mongodb Friday, March 8, 13
  • 23. River curl -XPUT "localhost:9200/_river/v/_meta" -d '{ "type": "mongodb", "mongodb": { "db": "alx_midia", "collection": "videos", "servers": [ { "host": "localhost", "port": "27017" } ] }, "index": { "name": "videos", "type": "documents" } }' origem - destino Friday, March 8, 13
  • 24. River curl -XGET "localhost:9200/_river/v/_meta" { "_index": "_river", "_id": "_meta", "exists": true, "_source": { "type": "mongodb", "mongodb": { "db": "alx_midia", "collection": "videos", "servers": [ { "host": "localhost", "port": "27017" } ] }, "index": { "name": "videos", "type": "documents" } } } Friday, March 8, 13
  • 25. River $ mongorestore --host localhost --port 27017 --noIndexRestore alx_midia Friday, March 8, 13
  • 26. River [videos] creating index, cause [api], shards [3]/[1], mappings [] [_river] update_mapping [v] (dynamic) [mongodb][v] No known previous slurping time for this collection [_river] update_mapping [v] (dynamic) [videos] update_mapping [documents] (dynamic) Indexed 100 insertions 0, updates, 0 deletions, 100 documents per second Indexed 100 insertions 0, updates, 0 deletions, 100 documents per second Indexed 81 insertions 0, updates, 0 deletions, 81 documents per second Indexed 100 insertions 0, updates, 0 deletions, 100 documents per second Indexed 15 insertions 0, updates, 0 deletions, 15 documents per second Friday, March 8, 13
  • 27. River • Na operação padrão, não vai ter “restore” em caso de falha • Necessário pensar em uma solução de “recrawling” Friday, March 8, 13