so that data can be stored and searched. As we described earlier, the document is uniquely identified by its _ index, _ type, and _ id, the previous _ index and _ type need to be defined by ourselves, while _ id can be defined by ourselves or we can use index api to generate a default for us. The index creation syntax is:
Curl-XPUT 'HTTP: // 192.168.37.htm: 9200/{index}/{type}/{id }? Pretty '-d '{
"Field": "value"
}'
A.1 from the syntax, we can see p
test.confShowTo prove that Logstash has been activated.Enter Hello WorldBecause we configured the content to be, the console outputs the log content, so displaying the above format is a success.2, Installation ElasticsearchTo download the installation package:wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.0/ Elasticsearch-2.4.0.tar.gzUnzip and configure:TAR-XZVF elasticsearch-2.4.0.tar.gzCD #{dir}/elasticsearch-2.4.0Vim Config/elastic
-caskVagrant and VirtualBox Installation:Brew Cask Install VirtualBox brew Cask Install vagrantVagrant fileA vagrant file to describe the needs of a virtual machine environment using Ruby DSL. When describing a Docker container, vagrant makes each container appear to be using its own unique virtual machine. In fact, this is an illusion, because each Docker container is actually allowed on a variety of proxy virtual machines.Therefore, two vagrant files are very necessary, one file is used to def
Installation Rpm-ivh elasticsearch-5.5.0.rpmConfigurationFind the installation directory Whereis elasticsearch//Enter the installation directory cd/etc/elasticsearch//edit the Profile VI elasticsearch.ymlMain configuration network.host (native IP) and http.port (default 9200) (current single-node mode, other parameters refer to official documentation)Start the serviceOpen port 9200firewall-cmd--add-port=9200
remember to view the JDK version. The JDK installed with root will not take effect until Source/etc/profile is performed in user mode.
If you want to run in daemon mode in the background, add the-D parameter.
Second, verify
[Liuxun@localhost server]$ Curl ' Http://localhost:9200/?pretty '
{'
name ': ' Chaos ',
' cluster_name ': ' Elasticsearch ",
" version ": {
" number ":" 2.3.2 ",
" Build_hash ":" B9e4a6acad4008027e4038f6abed7f7dba346
unsuccessful.Check for error messages with two articles
[1]: Max file descriptors [4096] for elasticsearch process are too low, increase to at least [65536]
[2]: Max virtual m Emory areas Vm.max_map_count [65530] is too low, increase to at least [262144]
The first error check indicates that the default value of the maximum file descriptor for the Elk User boot Elasticsearch is 4096 too small and needs to be adjusted to 65536.We modify the/etc/security/limits.conf file and add it at the end
El
Recently, the project is ready to use elasticsearch, first need to make clear the concept of elasticsearch, found this article on the Internet is good, in plain language to understand the concept of mapping.
Default Mapping
Elasticsearch (hereinafter referred to as ES) is not a schema, when we execute the following command:
Curl-xput HTTP://LOCALHOST:9200/TEST/ITEM/1-d ' {' name ': ' Zach ', ' description ': ' A pretty cool guy. '} '
ES can be ver
Filebeat is a lightweight, open source shipper for log file data. As the next-generation Logstash forwarder, filebeat tails logs and quickly sends this information to Logstash fo R further parsing and enrichment or to Elasticsearch for centralized storage and analysis.
Filebeat than Logstash seems better, is the next generation of log collectors, ELK (Elastic +logstash + Kibana) later estimated to be renamed EFK.
Filebeat How to use:
1, download the latest filebeat
Address: Https://www.elastic.
1. Create Elk users
You must create a elk user, and if you do not create a dedicated user, the following steps will cause an error when the Elk component is turned on by the root user. 2. Switch Elk User, download the Elk component in the Elk folder below home 2.1. Download Elasticsearch
[Root@localhost elk]# su Elk
[elk@localhost ~]$ pwd
/home/elk
[elk@localhost ~]$ wget https:// Artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.3.tar.gz
Unzip the tar package
[Elk@localhost ~]$ T
elasticsearch-2.4.0 sudo chgrp-r guest elasticsearch-2.4.0 2, create an account specifically for ES, and then switch the folder to the newly created user, and then start with this user. The Create user groups and user commands are as follows Groupadd elsearch useradd elsearch-g elsearch-p elasticsearch When setting permissions, you need to switch to root. Account is created, change the Elasticsearch folder and internal files to the user and group of elsearch:elsearch Input command: Ch
, modify the Vm.max_map_count parameters
1) Temporary modification method:
Sysctl-w vm.max_map_count=262144
Sysctl-p
To view parameter directives:
sysctl-a | grep "Vm.max_map_count"
Note: After the host restarts, the parameters are restored.
2) Permanent modification method:
vim/etc/sysctl.conf add vm.max_map_count=262144, Save and execute sysctl-p.
This setting parameter corresponds to the following ES startup error:
Max virtual Memory Areas Vm.max_map_count [65530] likely too low, increase to
I. Installation of Elasticsearchelasticsearch Download Address: http://www.elasticsearch.org/download/• Download direct decompression, into the directory under the bin, under the cmd run Elasticsearch.bat can start Elasticsearch• Browser access: Http://localhost:9200/, if the following results appear similar to the installation success:
{
"name": "Benedict kine",
"cluster_name": "Elasticsearch",
"version": {
"number": "2.2.0",
" Build_has
background:
A given sequence of text files needs to be searched based on the given keyword. project design:
Es+pythonThe use of ES to establish full-text text search, according to the given search keyword directly to find ES services to build
Download ElasticsearchExtract directly, run the./bin/elasticsearch-d in the bin directory to start the service in the backend.If the hint is that the Java version is not up to date, you need to update.Elasticsearch requires at least Java 8 but your Java ve
between the corresponding versions of them.
Spring Boot Version (x)
Spring Data elasticsearch Version (y)
elasticsearch Version (z)
X
Y
Z
X >= 1.4.x
2.0.0
2.0.0
The springboot version We use here is 1.5.9, and theelasticsearch version is 2.3.5.
Using springboot to consolidate elasticsearchis typically encapsulated using springdata , and then the DAO layer interface inherits Elasticsearchrepository class, which imp
environment support, because the client is using the Filebeat software, it does not rely on the Java environment, so do not need to install
Second, Elk service-side Operation1. Installing JDK8 and Elasticsearch
RPM-IVH jdk-8u102-linux-x64.rpm
Yum Localinstall elasticsearch-2.3.3.rpm-y
Start the service
Service Elasticsearch Start
Chkconfig Elasticsearch on
Check Service
RPM-QC Elasticsearch
/etc/elasticsearch/elasticsearch.yml
/etc/elasticsearch/logging.yml
/etc/init.d/elasticsear
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.