ElasticSearch2.3.1 environment to build what not known pits

Source: Internet
Author: User
Tags logstash

First of all, it is best not to use any of the early adopters version, with a stable version of the better, or trouble constantly, another problem, it is best to go to the official website, or Google search, because such a reliable, or now many are low version of, 1.4 of what, the results in accordance with the installation, how many cases have such a problem.

Solemnly declare that this article ElasticSearch2.3.1 the latest version of the installation, the other version please set up their own Google, the best not Baidu, Baidu is generally old articles, some version of the problem a lot, blind toss

ElasticSearch Installation Configuration

This is a bit old-fashioned, specific people go to the official website: https://www.elastic.co/guide/en/sense/current/installing.html

Following the steps in the above blog, I installed the elasticsearch-2.3.1 version of the Java 1.8 version, but I do not know why not run up

Exception in thread "main" Java.lang.RuntimeException:don ' t run Elasticsearch as root.
At Org.elasticsearch.bootstrap.Bootstrap.initializeNatives (bootstrap.java:93)
At Org.elasticsearch.bootstrap.Bootstrap.setup (bootstrap.java:144)
At Org.elasticsearch.bootstrap.Bootstrap.init (bootstrap.java:270)
At Org.elasticsearch.bootstrap.Elasticsearch.main (elasticsearch.java:35)

Web Site A search, environmental variables, but the results of three times in and out of it is no, go to the official website to search, settlement amount./bin/elasticsearch-des.insecure.allow.root=true

Specific problems can be reserved. This is because of permissions, group issues, you can give the ES user group permissions and so on specific issues can be Baidu other

Marvel installation Please refer to the official website

Https://www.elastic.co/guide/en/marvel/current/installing-marvel.html

/usr/share/Elasticsearchsudo bin/plugin install Licensesudo bin/plugin Install Marvel-agent          

Now is: http://localhost:9200/_plugin/marvel/is blank, or do not know what the reason, forget, the database data into the first to come in again

                                                                                                                                                                                          

Recommendation: Elasticsearch Primer Chinese version http://es.xiaoleilu.com/010_Intro/00_README.htm

Https://www.gitbook.com/book/looly/elasticsearch-the-definitive-guide-cn/details

Import data from MySQL into Elasticsearch

The question in the above article, which will explain

Since the ES website stopped the import plugin for river, the original Elasticsearch-jdbc-river changed to ELASTICSEARCH-JDBC and became a standalone import tool. The official mention of the same type of tools and Logstash, personally think Logstash in the database synchronization is not very useful, there are too many pits to fill.

Currently more than 2.0 version does not support the Windows environment, so students do not try, Windows under the highest support to 1.7.3. (2015.12.9)

So you see

[PHP]View PlainCopy 
    1. ./bin/plugin--install river-jdbc--url http://xbib.org/repository/org/xbib/elasticsearch/plugin/ Elasticsearch-river-jdbc/1.5.0.5/elasticsearch-river-jdbc-1.5.0.5-plugin.zip</span>

Such a command so is the pit, because the official does not let install, because this problem, I toss for a long time

The specific approach is

[PHP]View PlainCopy 
    1. $ wget http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.3.1.0/ Elasticsearch-jdbc-2.3.1.0-dist.zip
    2. $ unzip Elasticsearch-jdbc-2.3.1.0-dist.zip
Edit Vim import.sh

The following database is my MySQL DB name

Table is the name of my MySQL watch

[PHP]View PlainCopy 
    1. "Index": "Test",
Index is the data structure in ES, and you can think of it as a library in MySQL. [PHP]View PlainCopy 
    1. "Type": "Stdutent"
Type is similar to a table in MySQL
[PHP]View PlainCopy 
  1. Bin=/root/elasticsearch-2.3.1/elasticsearch-jdbc-2.3.1.0/bin
  2. Lib=/root/elasticsearch-2.3.1/elasticsearch-jdbc-2.3.1.0/lib
  3. Echo ' {
  4. "Type": "jdbc",
  5. "JDBC": {
  6. "url":"Jdbc:mysql://localhost:3306/database",
  7. "User":"root",
  8. "Password":"root",
  9. "SQL":"select * from table",
  10. "Index": "Test",
  11. "Type": "Stdutent"
  12. }
  13. } ' | Java \
  14. -CP "${lib}/*" \
  15. -dlog4j.configurationfile=${bin}/log4j2.xml \
  16. Org.xbib.tools.Runner \
  17. Org.xbib.tools.JDBCImporter

chmod +x import.sh The import may be slow depending on the database reason

After running./import.sh
Down

[PHP]View PlainCopy 
    1. [[email protected] elasticsearch-jdbc-2.3.1.0]# Curl ' http://localhost:9200/test/student/_search?pretty&q= * '

If there is data, the import is successful

Anything regardless of environmental factors, then a lot of pit, JDBC specific installation can refer to this may be a perfect method, I can only import a table file

For a detailed JDBC installation, refer to the following article

http://bluereader.org/article/122422454



Official plugin Https://github.com/jprante/elasticsearch-jdbc

To understand the concept, the following JDBC installation is no longer applicable

https://github.com/leotse90/blogs/blob/master/ElasticSearch%E4%B8%8EMySQL%E6%95%B0%E6%8D%AE%E5%90%8C%E6%AD%A5% E4%bb%a5%e5%8f%8a%e4%bf%ae%e6%94%b9%e8%a1%a8%e7%bb%93%e6%9e%84.md

ElasticSearch2.3.1 environment to build what not known pits

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.