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
@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
GET /logstash-2015.04.30/_search
{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"term": {
"type": "iis6"
@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
#!/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" : {
# Delete index
curl -s -X DELETE "http://$host:$port/multi_field_facetting" 2>&1 > /dev/null
# Create index
curl -s -X POST "http://$host:$port/multi_field_facetting" -d '
{
"settings" : {
"index": {
"analysis" : {
"filter" : {
curl -XDELETE 'http://localhost:9200/logstash-2013.12.20/'; echo
curl -XPOST 'http://localhost:9200/logstash-2013.12.20/cloudtest' -d '
{
"responseElements": {
"instancesSet": {
"items": [
{
"instanceId": "i-1bbb1111",
"currentState": {
curl -XDELETE "http://localhost:9200/test"; echo
curl -XPUT "http://localhost:9200/test" -d'
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
@dadoonet
dadoonet / gist:6113034
Last active December 20, 2015 10:08 — forked from anonymous/gist:6109593
echo "Deleting old ElasticSearch index..."
curl -XDELETE 'localhost:9200/arrtest'; echo
echo "Creating new ElasticSearch index..."
curl -XPUT 'localhost:9200/arrtest/?pretty=1' -d '
{
"mappings" : {
"cust2" : {
"properties" : {
"firstName" : {
@dadoonet
dadoonet / test_locale.sh
Last active December 19, 2015 05:09 — forked from anonymous/gist:5900949
Test locale with multiple formats
curl -XPUT http://localhost:9200/test/ticket/_mappinq? -d '{
"ticket" : {
"properties" : {
"DOC_CREATION_DATE" : {
"type" : "date",
"format" : "yyyy-MM-dd || yyyy-MM-dd HH:mm:ss",
"locale" : "FR"
}
}
}
// app.js
angular.module('cs_demo', [
'controllers',
'elasticjs.service',
'ui.bootstrap'
]);