Skip to content

Instantly share code, notes, and snippets.

View selcukusta's full-sized avatar

Selçuk Usta selcukusta

View GitHub Profile

Make these changes in the cassandra.yaml config file:

start_rpc: true

rpc_address: 0.0.0.0

broadcast_rpc_address: [node-ip]

listen_address: [node-ip]

---
- name: Install Docker and Docker-Compose
hosts: swarm_all
tasks:
- name: Add Docker's official GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
{
"query": {
"bool": {
"must": [
{
"term": {
"event": {
"value": true
}
}
import tornado.ioloop
import tornado.web
import socket
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello world!")
def data_received(self, data):
pass
#!/bin/sh
tee /etc/redis/sentinel.conf <<EOF
port 26379
daemonize yes
logfile "/var/log/sentinel.log"
pidfile "var/run/sentinel.pid"
dir "/var/lib/redis/sentinel"
sentinel monitor docker-cluster $MASTER_HOST 6379 $SENTINEL_QUORUM
sentinel down-after-milliseconds docker-cluster $SENTINEL_DOWN_AFTER
version: '2.3'
services:
es:
container_name: elasticsearch
build:
context: ./elasticsearch
dockerfile: Dockerfile
networks:
- testnetwork
FROM docker.elastic.co/elasticsearch/elasticsearch:6.2.2
RUN useradd -r -g elasticsearch 1000
ADD ./scripts/init.sh /utils/init.sh
ADD ./json-files/create-index.json /utils/data/create-index.json
ADD ./json-files/bulk-insert.json /utils/data/bulk-insert.json
ADD ./scripts/wait-for-it.sh /utils/wait-for-it.sh
USER elasticsearch
PUT /icu_index HTTP/1.1
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"default": {
"filter": [
"lowercase",
POST /first_index/city/_search?filter_path=hits.hits._source.name HTTP/1.1
{
"from": 0,
"size": 10,
"sort": {
"name.sortable": {
"order": "asc"
}
}
}
POST /first_index/_bulk HTTP/1.1
{"index":{"_index":"first_index", "_type":"city", "_id" : 1}}
{ "name" : "Çanakkale" }
{"index":{"_index":"first_index", "_type":"city", "_id" : 2}}
{ "name" : "İstanbul" }
{"index":{"_index":"first_index", "_type":"city", "_id" : 3}}
{ "name" : "Bursa" }
{"index":{"_index":"first_index", "_type":"city", "_id" : 4}}
{ "name" : "Hatay" }
{"index":{"_index":"first_index", "_type":"city", "_id" : 5}}