Skip to content

Commit

Permalink
Update Kubernetes resources
Browse files Browse the repository at this point in the history
  • Loading branch information
abregman committed Apr 21, 2020
1 parent 2a9ff5c commit 5d711b4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 31 deletions.
69 changes: 39 additions & 30 deletions resources/elk.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@ Name | Comments

## Elsaticsearch Cheat Sheet

* Test elasticsearch

`curl localhost:9200`

* Check elasticsearch health (also good for checking number of nodes)

`curl -X GET "localhost:9200/_cat/health?v"`

* List indexes

`curl 'localhost:9200/_cat/indices?v'`

* Test elasticsearch: `curl <es_host>:9200`
* List of APIs: `curl <es_host>:9200/_cat`
* List nodes: `curl <es_host>:9200/_cat/nodes`
* List nodes with headers: `curl <es_host>:9200/_cat/nodes?v`
* Check elasticsearch health (also good for checking number of nodes): `curl -X GET "localhost:9200/_cat/health?v"`
* List indexes: `curl 'localhost:9200/_cat/indices?v'`
* Create a new index called "customers" and add a document with the field name

```
Expand All @@ -61,33 +55,48 @@ curl -X PUT "localhost:9200/gamer/_doc/1?pretty" -H 'Content-Type: application/j
'
```

* Add documents from a JSON file

```
curl -H "Content-Type: application/json" -XPOST "localhost:9200/customer/_bulk?pretty&refresh" --data-binary "@customers.json"
```

* Get the document with ID 1

`curl -X GET "localhost:9200/gamer/_doc/1"`

* List all indices

`curl "localhost:9200/_cat/indices?v"`
* Add documents from a JSON file: `curl -H "Content-Type: application/json" -XPOST "localhost:9200/customer/_bulk?pretty&refresh" --data-binary "@customers.json"`
* Get the document with ID 1: `curl -X GET "localhost:9200/gamer/_doc/1"`
* List all indices: `curl "localhost:9200/_cat/indices?v"`

* Increase fields limit

```
PUT test_index/_settings
{
"index.mapping.total_fields.limit": 2000
}
```

* Delete index

```
DELETE /<index_name>
* Delete index: `DELETE /<index_name>`

* Create cluster

```
# On the master node
dnf install -y elasticsearch
systemctl enable elasticsearch
vi /etc/elasticsearch/elasticsearch.yml
set cluster.name
set node.name
set network.host to [_local_, _site_]
set discovery.seed_hosts to master private IP address (or addresses if you are using multiple nodes)
set cluster.inital_master_nodes to master node name(s)
set node.master to true
set node.data to false
set node.ingest to true
set node.ml to false
# On second node (and any additional node)
set cluster.name
set node.name
set network.host to [_local_, _site_]
set discovery.seed_hosts to master private IP address (or addresses if you are using multiple nodes)
set cluster.inital_master_nodes to master node name(s)
set node.master to false
set node.master to true
set node.ingest to false
set node.ml to false
# On all nodes
systemctl start elasticsearch
```

## Logstash Cheat Sheet
Expand Down
9 changes: 8 additions & 1 deletion resources/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ Name | Comments
[Learning Path: Kubernetes](https://developer.ibm.com/series/kubernetes-learning-path/) | From basic to advanced Kubernetes learning series
[Kubernetes 101 - Concepts and Why It Matters](https://www.magalix.com/blog/kubernetes-101-concepts-and-why-it-matters?fbclid=IwAR10FZlZ9Pw5c94tGRlgsCrVZTa1bSV2mbxEP8p4cXZ5T-k4VXF-3OUKkFo) |
[kubernetes-workshop](https://github.com/eon01/kubernetes-workshop) |
[Kubernetes Deployment Tutorial](https://devopscube.com/kubernetes-deployment-tutorial)
[Kubernetes Deployment Tutorial](https://devopscube.com/kubernetes-deployment-tutorial) |
[Katacoda](https://www.katacoda.com/courses/kubernetes) | Learn Kubernetes using Interactive Browser-Based Scenarios

## Kubernetes Deep Dive

Name | Comments
:------ |:--------:
[Kubernetes Networking](https://github.com/nleiva/kubernetes-networking-links) | Kubernetes Networking Resources

## Misc

Expand Down

0 comments on commit 5d711b4

Please sign in to comment.