Difference between revisions of "ElasticSearch"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) m Tag: visualeditor |
Rafahsolis (talk | contribs) m Tag: visualeditor |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | [https://github.com/elasticsearch GitHub] | + | [https://github.com/elastic/elasticsearch GitHub] [https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html Docker] |
| − | ===Plugins | + | ==Install== |
| + | |||
| + | *Install Java <syntaxhighlight lang="bash"> | ||
| + | sudo apt install openjdk-7-jre-headless | ||
| + | </syntaxhighlight><br /> | ||
| + | |||
| + | Download Debian package from [https://www.elastic.co/downloads/elasticsearch elastic.co]<syntaxhighlight lang="bash"> | ||
| + | sudo dpkg -i elasticsearch-X.X.X.deb | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ==API== | ||
| + | Get status<syntaxhighlight lang="bash"> | ||
| + | curl -X GET "http://localhost:9200" | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ==Configuration== | ||
| + | cluster.name | ||
| + | |||
| + | node.name | ||
| + | |||
| + | index.number_of_shards | ||
| + | |||
| + | index.number_of_replicas | ||
| + | |||
| + | node.master | ||
| + | |||
| + | node.data | ||
| + | |||
| + | ===Paths=== | ||
| + | {| class="wikitable" | ||
| + | |+ | ||
| + | !Type | ||
| + | !Description | ||
| + | !Location (Debian) | ||
| + | |- | ||
| + | |Home | ||
| + | |Home of Elastic Search Installation | ||
| + | |/usr/share/elasticsearch | ||
| + | |- | ||
| + | |Bin | ||
| + | |Binary scripts including elasticsearch to start a node | ||
| + | |/usr/share/elasticsearch/bin | ||
| + | |- | ||
| + | |Conf | ||
| + | |Configuration file elasticsearch.yml | ||
| + | |/etc/elasticsearch | ||
| + | |- | ||
| + | |data | ||
| + | |The location of the data files of each index or shard allocated on the node | ||
| + | |/etc/elasticsearch | ||
| + | |- | ||
| + | |logs | ||
| + | |Log file location | ||
| + | |/var/log/elasticsearch | ||
| + | |- | ||
| + | |plugins | ||
| + | |Plugin directories location | ||
| + | |/usr/share/elasticsearch/plugins | ||
| + | |} | ||
| + | |||
| + | ==Plugins== | ||
====Site Plugins==== | ====Site Plugins==== | ||
| Line 12: | Line 72: | ||
*SmartCN: Analyze Chinese text | *SmartCN: Analyze Chinese text | ||
| + | |||
| + | QueryDSL vs RDMBS | ||
| + | {| class="wikitable" | ||
| + | |+ | ||
| + | !Elastic Search | ||
| + | !RDMBS | ||
| + | |- | ||
| + | |Index | ||
| + | |Database | ||
| + | |- | ||
| + | |Type | ||
| + | |Table | ||
| + | |- | ||
| + | |Document | ||
| + | |Row | ||
| + | |- | ||
| + | |Field | ||
| + | |Column | ||
| + | |- | ||
| + | |Mapping | ||
| + | |Schema | ||
| + | |- | ||
| + | |Query DSL | ||
| + | |SQL | ||
| + | |- | ||
| + | |Get API | ||
| + | |Select * FROM | ||
| + | |- | ||
| + | |POST API | ||
| + | |UPDATE <nowiki><TABLE> SET</nowiki> | ||
| + | |- | ||
| + | |PUT API | ||
| + | |INSERT INTO <nowiki><TABLE></nowiki> | ||
| + | |- | ||
| + | |Everything is indexed | ||
| + | |Index on demand | ||
| + | |- | ||
| + | |Aggregation | ||
| + | |SELECT <FIELD>, COUNT (*) FROM <nowiki><TABLE></nowiki> | ||
| + | |} | ||
Latest revision as of 08:20, 15 April 2019
Install[edit]
- Install Java
sudo apt install openjdk-7-jre-headless
Download Debian package from elastic.co
sudo dpkg -i elasticsearch-X.X.X.deb
API[edit]
Get status
curl -X GET "http://localhost:9200"
Configuration[edit]
cluster.name
node.name
index.number_of_shards
index.number_of_replicas
node.master
node.data
Paths[edit]
| Type | Description | Location (Debian) |
|---|---|---|
| Home | Home of Elastic Search Installation | /usr/share/elasticsearch |
| Bin | Binary scripts including elasticsearch to start a node | /usr/share/elasticsearch/bin |
| Conf | Configuration file elasticsearch.yml | /etc/elasticsearch |
| data | The location of the data files of each index or shard allocated on the node | /etc/elasticsearch |
| logs | Log file location | /var/log/elasticsearch |
| plugins | Plugin directories location | /usr/share/elasticsearch/plugins |
Plugins[edit]
Site Plugins[edit]
- Head: Swiss Army Knife for ElasticSearch cluster topology & cluster status, table views & API frontend views
- BigDesk: Statistics, charts
- Kopf: Cluster administration & query tool
Analysis Plugins[edit]
- SmartCN: Analyze Chinese text
QueryDSL vs RDMBS
| Elastic Search | RDMBS |
|---|---|
| Index | Database |
| Type | Table |
| Document | Row |
| Field | Column |
| Mapping | Schema |
| Query DSL | SQL |
| Get API | Select * FROM |
| POST API | UPDATE <TABLE> SET |
| PUT API | INSERT INTO <TABLE> |
| Everything is indexed | Index on demand |
| Aggregation | SELECT <FIELD>, COUNT (*) FROM <TABLE> |