Skip to content

Instantly share code, notes, and snippets.

View dadoonet's full-sized avatar
🇪🇺
From Europe with ❤️

David Pilato dadoonet

🇪🇺
From Europe with ❤️
View GitHub Profile
#!/usr/bin/env bash
echo "\n Delete old index"
curl -X DELETE 'http://localhost:9200/bands'
echo "\n Create Index Mapping"
curl -X POST 'http://localhost:9200/bands/' -d '{
"mappings" : {
"documents" : {
"properties" : {
@dadoonet
dadoonet / 8823-demo.sh
Last active August 29, 2015 14:11 — forked from grantr/8823-demo.sh
#!/bin/bash
pkill -f 'elasticsearch.*cluster.name=8823'
rm -rf data/8823
bin/elasticsearch -Des.node.master=true -Des.cluster.name=8823 -Des.node.name=master 2>&1 >/dev/null &
sleep 1
bin/elasticsearch -Des.node.master=false -Des.cluster.name=8823 -Des.node.name=data1 2>&1 >/dev/null &
sleep 1
GET /logstash-2015.04.30/_search
{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"term": {
"type": "iis6"
@dadoonet
dadoonet / commands.sh
Created February 11, 2022 17:24 — forked from xeraa/commands.sh
Elastic 8.0 security by default: Minimal setup with Docker for a 3 node cluster + Kibana
// Start the first node and keep the generated security credentials handy
docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Check if the node has started correctly
curl --insecure --user elastic https://localhost:9200/
// Add your second node
docker run -e ENROLLMENT_TOKEN="..." -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Check if it has joined the cluster