Determine the location of the data store in the elk-and increase the cluster node

Source: Internet
Author: User
Tags kibana egrep

Visible by configuration file Path.data decision


[Email protected] etc]# Cat/usr/local/elasticsearch/config/elasticsearch.yml | Egrep-v "^$|^#"

Path.data:/tmp/elasticsearch/data

Path.logs:/tmp/elasticsearch/logs

network.host:192.168.100.10

network.port:9200



[Email protected] etc]# du-s/tmp/elasticsearch/data/

4384/tmp/elasticsearch/data/

[Email protected] etc]# du-s/tmp/elasticsearch/data/

8716/tmp/elasticsearch/data/


If RPM is installed Elasticsearch (abbreviation) can be set in/etc/init.d/elasticsearch: Location of data and log

Es_user= "Elasticsearch" es_group= "Elasticsearch" Notoginseng es_home= "/usr/share/elasticsearch" max_map_count=262144 log_dir= "/data2/elk/elasticsearch/log/elasticsearch" data_dir= "/data2/elk/ Elasticsearch/data/elasticsearch "conf_dir="/etc/elasticsearch "43


Configure the cluster:

when there is no cluster , the default data directory structure is:


[Email protected] etc]# ls/tmp/elasticsearch/data/elasticsearch/

Nodes


"Prerequisites for configuring the cluster hosts resolution"


The master node and the slave node are capable of parsing each other

[[email protected] httpd]# Ping Master

PING www.elk.com (192.168.100.10) bytes of data.

Bytes from www.elk.com (192.168.100.10): icmp_seq=1 ttl=64 time=0.073 ms

^c

---www.elk.com ping statistics---

1 packets transmitted, 1 received, 0% packet loss, time 675ms

RTT Min/avg/max/mdev = 0.073/0.073/0.073/0.000 ms

[[email protected] httpd]# Ping slave

PING slave (192.168.100.13) bytes of data.

Bytes from slave (192.168.100.13): icmp_seq=1 ttl=64 time=1.18 ms


"Configure cluster"

Configuration on the master node (node one) 192.168.100.10:

#----------------------------------Cluster-----------------------------------

Cluster.name:elasticsearch-cluster


#------------------------------------Node------------------------------------


Node.name:master


#---------------------------------Discovery----------------------------------

#

# Elasticsearch nodes would find each of the other via unicast, by default.

#

# Pass An initial list of hosts to perform discovery if new node is started:

# The default list of hosts is ["127.0.0.1", "[:: 1]"]

#

# discovery.zen.ping.unicast.hosts: ["host1", "Host2"]

Discovery.zen.ping.unicast.hosts: ["Master", "Slave"]





Configuration on Salve node (node II) 192.168.100.13: installation Elasticsearch (same as Elasticsearch installation)


[Email protected] elasticsearch]# egrep-v "^$|^#" config/elasticsearch.yml

Cluster.name:elasticsearch-clusternode.name:slavediscovery.zen.ping.unicast.hosts: ["Master", "Slave"]path.data: /tmp/elasticsearch/datapath.logs:/tmp/elasticsearch/logsnetwork.host:0.0.0.0network.port:9200



Slave Start Elasticsearch

[email protected] elasticsearch]# sudo su-elasticsearch/usr/local/elasticsearch/bin/elasticsearch



Authentication

Access Plugin View cluster status


http://192.168.100.10:9200/_plugin/head/


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/80/19/wKioL1c4DX6g5bzcAAEhgCkyikc920.png "title=" Elk2.png "alt=" Wkiol1c4dx6g5bzcaaehgckyikc920.png "/>



or use:

API Check

[Email protected] etc]# Curl 192.168.100.10:9200/_cluster/health?pretty
{"Cluster_Name": "Elasticsearch", "status": "Yellow", "timed_out": false, "number_of_nodes": 1, "Number_of_data_ Nodes ": 1," active_primary_shards ": +," active_shards ": +," Relocating_shards ": 0," Initializing_shards ": 0," Unassigned_shards ": +," Delayed_unassigned_shards ": 0," Number_of_pending_tasks ": 0," Number_of_in_flight_fetch ": 0, "Task_max_waiting_in_queue_millis": 0, "Active_shards_percent_as_number": 50.0}



Status significance

Green All primary shards and slave shards are available

Yellow All primary shards are available, but there are no usable slave shards

Red exists major shards that are not available

In the following chapters, we will learn what are major shards (primary shard) and from Shards (replica shard), and explain the meaning of these states in the real world.




"For the reason that yellow is not green."

My Master node configuration file modified, the wood has a reboot, after restart is normal



Results


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/80/1A/wKioL1c4ESKSPf1oAABzPyAeJnw515.png "title=" Elk3.png "alt=" Wkiol1c4eskspf1oaabzpyaejnw515.png "/>



After that, the storage path of the data becomes the Elasticsearch-cluster directory.

/tmp/elasticsearch/data/elasticsearch-cluster



Of course before the data of a node is of course no, so reopen Kibana will want to create a new index


You can only see today's index in the data catalog.

[Email protected] tls]# ls/tmp/elasticsearch/data/elasticsearch-cluster/nodes/0/indices/

. kibana/ logstash-2016.05.15/



650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/80/1D/wKiom1c4Ea2BlrqEAAC2uF0tc_A870.png "title=" Elk5.png "alt=" Wkiom1c4ea2blrqeaac2uf0tc_a870.png "/>




"See Data Increase"

To add some data to it.

[[email protected] httpd]# for i in {1..100000}; Do echo "Mesaage $i" >>/var/log/messages;d One


Look at the results:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/80/1A/wKioL1c4FYbzalq8AACEKyox56Y785.png "title=" Elk6.png "alt=" Wkiol1c4fybzalq8aacekyox56y785.png "/>



650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/80/1A/wKioL1c4FdWiX5kYAADG7u00HRM394.png "title=" Elk7.png "alt=" Wkiol1c4fdwix5kyaadg7u00hrm394.png "/>







This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1773571

Determine the location of the data store in the elk-and increase the cluster node

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.