Installing, configuring Prometheus and Grafana Below I am continuing, with options on installing Prometheus and Grafana. This is Part 2. in Part 1 I am describing what it takes to install Helm, Tiller as well as SSL/TLS configuration. It has been a while, I didn’t had a chance to complete the Prometheus & Grafana installation […]
Tag: elasticsearch
Deploying Helm / Tiller, Prometheus, AlertManager, Grafana, Elasticsearch On Your kubernetes Cluster
Deploying Helm Charts / Tiller on your kubernetes cluster Below is a continuation to my previous post(S) part 1-7 on how to configure Kubernetes 3 Master Node cluster. In the post below I am going to show you. How to install / configure – Helm / Tiller on your kubernetes cluster. How to install / […]
Collectd , logstash and Elasticsearch
Install Collectd from opencsw
1 2 |
/opt/csw/bin/pkgutil -i collectd /opt/csw/bin/pkgutil -i collectd-utils |
Modify collectd.conf vi /etc/opt/csw/collectd.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Hostname "yourhost" FQDNLookup false LoadPlugin syslog LoadPlugin cpu LoadPlugin df LoadPlugin disk LoadPlugin interface LoadPlugin load LoadPlugin memory LoadPlugin network LoadPlugin rrdtool LoadPlugin zfs_arc <Plugin network> Server "10.10.10.11" "3333" </Plugin> |
Restart or enable collectd
1 |
svcadm enable svc:/network/cswcollectd:default |
forward the logs to elasticsearch with logstash
1 2 3 4 5 6 7 8 9 10 11 |
input { udp { port => 3333 # 25826 matches port specified in collectd.conf buffer_size => 1452 # 1452 is the default buffer size for Collectd codec => collectd { } # specific Collectd codec to invoke type => collectd } } output { stdout { codec => rubydebug } } |
Source Monitoring With Collectd And Kibana Collectd plugins https://collectd.org/wiki/index.php/Table_of_Plugins/
Configuring Elasticsearch betas/topbeats on linux
First, lets Download the beats template.
1 |
curl -O https://raw.githubusercontent.com/elastic/topbeat/master/etc/topbeat.template.json |
Upload to elastic template
1 |
curl -XPUT 'http://elk3.domain.com:9200/_template/topbeat' -d@topbeat.template.json |
Now, lets install topbeat, add elastic beat repo, and run
1 |
yum -y install topbeat |
Modify /etc/topbeat/topbeat.yml, under elasticsearch add elastic (or logstash) hosts
1 |
hosts: ["10.10.3.48:9204", "10.10.3.48:9205", "10.10.3.48:9206"] |
Start the beat service
1 |
systemctl start topbeat |
Install topbeats dashboards
1 2 3 |
curl -L -O https://download.elastic.co/beats/dashboards/beats-dashboards-1.2.0.zip unzip beats-dashboards-1.2.0.zip, and run ./load.sh -url "http://elk3.domain.com:9200" |
Finally, create the kibana index, [topbeat]-YYY.MM.DD in the web UI To verify the […]
Upgrading Elasticsearch To A Newer Version
How to upgrading Elasticsearch To A Newer Version The key is exporting the instance. Disable shard movement
1 2 3 4 5 6 |
curl -XPUT http://elk2.domain.com:9200/_cluster/settings -d ' { "transient": { "cluster.routing.allocation.enable": "none" } }' |
Migrate to new version (on linux)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
export INS=1 alias cp=cp cd /opt /opt/elasticsearch-ins${INS}/bin/start_elastic.sh stop unzip -qq /var/tmp/elasticsearch-2.3.0.zip mv elasticsearch-ins${INS} elasticsearch-ins${INS}-2.2 mv elasticsearch-2.3.0 elasticsearch-ins$INS cd elasticsearch-ins${INS} cp -rp ../elasticsearch-ins${INS}-2.2/current . cp -rp ../elasticsearch-ins${INS}-2.2/config/elasticsearch.yml config/. cp -rp ../elasticsearch-ins${INS}-2.2/bin/start_elastic.sh bin/. chown -R elastic:elastic /opt/elasticsearch-ins${INS} /opt/elasticsearch-ins${INS}/bin/start_elastic.sh start |
Migrate to new version (on solaris)
1 2 3 4 5 6 7 8 9 10 11 12 |
export INS=1 cd /opt svcadm disable -s d${INS}/elasticsearch unzip -qq /var/tmp/elasticsearch-2.3.0.zip mv elasticsearch-d${INS} elasticsearch-d${INS}-2.2 mv elasticsearch-2.3.0 elasticsearch-d$INS cd elasticsearch-d${INS} cp -rp ../elasticsearch-d${INS}-2.2/current . cp -rp ../elasticsearch-d${INS}-2.2/config/elasticsearch.yml config/. chown -R elastic:elastic /opt/elasticsearch-d${INS} svcadm enable -s d${INS}/elasticsearch |
Re-enable shared movement, once the cluster is back up
1 2 3 4 5 6 |
curl -XPUT http://elk2.domain.com:9200/_cluster/settings -d ' { "transient": { "cluster.routing.allocation.enable": "all" } }' |
Solaris Elasticsearch Forwarder(Logstash) Setup
Create elastic data pool
1 |
zpool create data1 c1d1 |
Add elastic user
1 2 |
groupadd elastic useradd -d /export/home/elastic -g elastic -m -s /bin/bash -c "Elastic Search" elastic |
Install elastic binary’s
1 2 3 4 5 6 |
cd /opt;unzip -qq /install/elasticsearch-2.2.0.zip;mv elasticsearch-2.2.0 elasticsearch mkdir /data1 /data1/data /data1/plugins /data1/log mkdir /opt/elasticsearch/current /opt/elasticsearch/current/logs /opt/elasticsearch/current/data /opt/elasticsearch/current/tmp chown -R elastic:elastic /opt/elasticsearch /data1 |
Grant access for elastic user
1 |
echo "elastic::::lock_after_retries=no;defaultpriv=all,file_dac_read;profiles=Primary Administrator,All" >>/etc/user_attr |
Configre system limits for user elastic /etc/project
1 |
elastic:100::::process.max-file-descriptor=(priv,65536,deny);process.max-sem-nsems=(priv,1024,deny);project.max-sem-ids=(priv,256,deny);project.max-shm-memory=(privileged,68719476736,deny) |
add to /opt/elasticsearch/bin/elasticsearch (top)
1 |
ulimit -n unlimited |
Configure startup script
1 |
svccfg import elasticsearch.xml |
Configure elasticsearch.yml for hot warm (SSD) Hot warm config Configure hot template
1 2 3 4 5 6 7 8 9 10 11 |
curl -XPUT http://elk2.domain.com:9200/_template/web-sql-log -d ' { "template": "web-sql-log-*", "settings": { "index.refresh_interval": "5s", "index.routing.allocation.require.box_type": "hot", "number_of_shards" : 3 } } ' {"acknowledged":true} |
Add latter the mappings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
"mappings": { "jmx": { "properties": { "OpenSessions_Count": { "type": "long" }, "PendingUserRequestCount_Count": { "type": "long" }, "Host_Name": { "type": "string", "index": "not_analyzed" }, "@timestamp": { "format": "strict_date_optional_time||epoch_millis", "type": "date" }, "ActiveExecuteThreads_ActvCount": { "type": "integer" }, "ActiveExecuteThreads_MaxCount": { "type": "integer" }, "@version": { "type": "string" }, "host": { "type": "string", "index": "not_analyzed" }, "ActiveConnectionsCount_Count": { "type": "long" }, "message": { "type": "string" }, "type": { "type": "string" }, "command": { "type": "string" } } } |
To […]
Elasticserach templates – SSD Template
Dealing with SSDs in Elasticserach Upload a template for SSD(HOT) disk, so new index’s are placed on SSD.
1 2 3 4 5 6 7 8 9 |
curl -XPUT http://elk1.domain.com:9200/_template/web-sql-log -d ' { "template": "web-sql-log-*", "settings": { "index.refresh_interval": "5s", "index.routing.allocation.require.box_type": "hot", "number_of_shards" : 3 } }' |
Verify new template
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
curl -XGET 'http://elk1.domain.com:9200/_template/web-sql-log?pretty' { "web-sql-log" : { "order" : 0, "template" : "web-sql-log-*", "settings" : { "index" : { "number_of_shards" : "3", "routing" : { "allocation" : { "require" : { "box_type" : "hot" } } }, "refresh_interval" : "5s" } }, "mappings" : { }, "aliases" : { } } } |
How To Configure Elasticsearch(ELK) Hot And Warm Data
Configuring Elasticsearch(ELK) Hot And Warm Data movement Get the current node box status
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
curl 'elk1.domain.com:9200/web-sql-log-2016.02.29/_settings?pretty' { "web-sql-log-2016.02.29" : { "settings" : { "index" : { "routing" : { "allocation" : { "require" : { "box_type" : "hot" } } }, "refresh_interval" : "5s", "number_of_shards" : "3", "creation_date" : "1456738651834", "number_of_replicas" : "1", "uuid" : "p67uw-XhQLe78sjEuDDbpg", "version" : { "created" : "2020099" } } } } } |
Change the allocation to hot
1 2 3 4 5 6 7 |
#!/bin/bash #days="" curl -XPUT "elk1.domain.com:9200/web-sql-log-2016.02.29/_settings" -d ' { "index.routing.allocation.require.box_type":"warm" }' |
To use curator install it with pip Note: Curator was not working for me, therefore I was using simple curl (above)
1 2 |
easy_install pip pip pip install elasticsearch-curator |
Get indices (index) space
1 |
curl 'elk1.domain.com:9200/_cat/indices?v' |
Reference
Installing and Configuring ELK – Part six(6) – General platform tips & tricks
Installing and Configuring ELK – Part one(1) – Install OS (OEL 7.2), Tuning – Part two(2) – Configure KVM, Tuning – Part three(3) – install elasticsearch, configuration – Part four(4) – Install logstash, configuration – Part five(5) – Install Kibana, configuration – Part six(6) – General platform tips & tricks This is Part six(6) – […]
Installing and Configuring ELK – Part five(5) – Install Kibana, configuration
Installing and Configuring ELK – Part one(1) – Install OS (OEL 7.2), Tuning – Part two(2) – Configure KVM, Tuning – Part three(3) – install elasticsearch, configuration – Part four(4) – Install logstash, configuration – Part five(5) – Install Kibana, configuration – Part six(6) – General platform tips & tricks – Part six(7) Solaris logstash […]