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
@drewr
drewr / tribe-localhost-unicast.md
Last active August 29, 2015 13:57
Three-node tribe using localhost/unicast.

Three-node dev tribe on a single host

Setup

drewr1

% bin/elasticsearch \
    -Des.cluster.name=drewr1 \
    -Des.network.host=127.0.0.1 \

-Des.discovery.zen.ping.unicast.hosts=127.0.0.1 \

@seang-es
seang-es / esdiagdump.sh-DEPRECATED
Last active August 29, 2015 14:01
esdiagdump.sh - create log bundle for ES support
#!/bin/bash
#
# esdiagdump
#
# Usage: esdiagdump [-h <hostname/IP>:<port>] [-o <output filename>]
# hostname defaults to localhost
# output file defaults to current directory/esdiagdump.out.<timestamp>
#
# This version is no longer being maintained. The current version lives in the elasticsearch/dev/shared/tools repository.
@dadoonet
dadoonet / test.sh
Created May 27, 2014 16:07
Using git bisect to find origin of an issue
#!/usr/bin/env bash
# To use this script, copy and paste it in elasticsearch git root dir
# launch
# git bisect start {bad revision} {good revision}
# git bisect run ./test.sh
echo " -> starting a new test"
echo "$(git show --quiet)"
#!/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
@spinscale
spinscale / install-elasticsearch.sh
Created April 8, 2013 12:13
Create an elasticsearch specific versioned instance quickly
#!/bin/bash
set -e
if [ "x$1" == "x-h" ] ; then
echo "Usage: $0 version destdir plugins"
exit
fi
CURRENT="0.90.0.RC1"
@dadoonet
dadoonet / test-suggest.sh
Last active December 21, 2015 09:49
Trying Suggest API on multifields
curl -XDELETE "http://localhost:9200/test?pretty"
curl -XPOST "http://localhost:9200/test?pretty" -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis":{
"analyzer":{
"suggest":{
"type": "custom",
@jpountz
jpountz / Recover.java
Last active December 22, 2015 10:48
File to restore a corrupted segment if the stored fields are not corrupted.
// Set codec, dir and segmentName accordingly to the segment you are trying to restore
Codec codec = new Lucene42Codec();
Directory dir = FSDirectory.open(new File("/tmp/test"));
String segmentName = "_0";
IOContext ioContext = new IOContext();
SegmentInfo segmentInfos = codec.segmentInfoFormat().getSegmentInfoReader().read(dir, segmentName, ioContext);
Directory segmentDir;
if (segmentInfos.getUseCompoundFile()) {
segmentDir = new CompoundFileDirectory(dir, IndexFileNames.segmentFileName(segmentName, "", IndexFileNames.COMPOUND_FILE_EXTENSION), ioContext, false);
@karmi
karmi / download.elasticsearch.conf
Created September 20, 2013 16:00
Create a local Nginx-based proxy for <http://download.elasticsearch.org> for demos at conferences, meetups, etc
# Create a local proxy for <http://download.elasticsearch.org>
# ============================================================
#
# This setup and Nginx configuration provides a local webserver which intercepts requests
# to <http://download.elasticsearch.org> and serves a local file instead,
# facilitating and speeding up demonstrations at conferences, meetups, etc.
#
#
# 1. Create directories for Nginx:
#
curl -XPUT "http://localhost:9200/index2" -d'
{
"mappings": {
"child" : {
"_parent": {
"type": "child"
}
}
}
}'
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share