永久链接: http://gaojingsong.iteye.com/blog/2359013
预览文章: 【elasticsearch-5X安装步骤(一)】
永久链接: http://gaojingsong.iteye.com/blog/2359103
预览文章: 【elasticsearch-5X安装步骤(二)】
永久链接: http://gaojingsong.iteye.com/blog/2359332
预览文章: 【elasticsearch-5X安装Head插件(四)】
[root@node1 bin]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
[root@node1 bin]# sh /opt/es5.0/init_env.sh
[root@node1 bin]# sh elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/plugins/PluginCli : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
错误原因 :-->环境变量捣的鬼
为了避免用户权限所属组纠纷,还是用非root用户启动,因为ES也需要非Root账号启动
[root@node1 bin]# su - hadoop
[hadoop@node1 ~]$ cd /opt/es5.0/elasticsearch-5.1.2/bin/
[hadoop@node1 bin]$ sh elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip
-> Downloading https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip
[=================================================] 100%
-> Installed sql
[hadoop@node1 bin]$ ./elasticsearch
[2017-02-26T12:41:11,783][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
[2017-02-26T12:41:14,274][INFO ][o.e.n.Node ] [node-1] initializing ...
[2017-02-26T12:41:14,780][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/ (/dev/hdc2)]], net usable_space [7.5gb], net total_space [17.1gb], spins? [possibly], types [ext3]
[2017-02-26T12:41:14,781][INFO ][o.e.e.NodeEnvironment ] [node-1] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-02-26T12:41:14,783][INFO ][o.e.n.Node ] [node-1] node name [node-1], node ID [EdHbn3S_Sxm4Cwz0pMxwRQ]
[2017-02-26T12:41:14,805][INFO ][o.e.n.Node ] [node-1] version[5.1.2], pid[3933], build[c8c4c16/2017-01-11T20:18:39.146Z], OS[Linux/2.6.18-128.el5/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_111/25.111-b14]
[2017-02-26T12:41:22,656][INFO ][o.e.p.PluginsService ] [node-1] loaded module [aggs-matrix-stats]
[2017-02-26T12:41:22,657][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-common]
[2017-02-26T12:41:22,657][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-expression]
[2017-02-26T12:41:22,658][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-groovy]
[2017-02-26T12:41:22,658][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-mustache]
[2017-02-26T12:41:22,659][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-painless]
[2017-02-26T12:41:22,660][INFO ][o.e.p.PluginsService ] [node-1] loaded module [percolator]
[2017-02-26T12:41:22,661][INFO ][o.e.p.PluginsService ] [node-1] loaded module [reindex]
[2017-02-26T12:41:22,661][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty3]
[2017-02-26T12:41:22,661][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty4]
[2017-02-26T12:41:22,663][INFO ][o.e.p.PluginsService ] [node-1] loaded plugin [sql]
[2017-02-26T12:41:38,927][INFO ][o.e.n.Node ] [node-1] initialized
[2017-02-26T12:41:38,927][INFO ][o.e.n.Node ] [node-1] starting ...
[2017-02-26T12:41:40,002][INFO ][o.e.m.j.JvmGcMonitorService] [node-1] [gc][1] overhead, spent [279ms] collecting in the last [1s]
[2017-02-26T12:41:41,364][INFO ][o.e.t.TransportService ] [node-1] publish_address {192.168.1.104:9300}, bound_addresses {192.168.1.104:9300}
[2017-02-26T12:41:41,376][INFO ][o.e.b.BootstrapCheck ] [node-1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-02-26T12:41:44,644][INFO ][o.e.c.s.ClusterService ] [node-1] new_master {node-1}{EdHbn3S_Sxm4Cwz0pMxwRQ}{93Rt968OTIqVGUKMNIIdaw}{192.168.1.104}{192.168.1.104:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-02-26T12:41:44,736][INFO ][o.e.h.HttpServer ] [node-1] publish_address {192.168.1.104:9200}, bound_addresses {192.168.1.104:9200}
[2017-02-26T12:41:44,738][INFO ][o.e.n.Node ] [node-1] started
[2017-02-26T12:41:44,824][INFO ][o.e.g.GatewayService ] [node-1] recovered [0] indices into cluster_state
老路走不通,需要重新开辟道路了,旧版这个访问时OK的,新版本就歇菜了
重新开辟道路,使用Tomcat服务器
[root@node1 ~]# cd /root/
[root@node1 ~]# ls
anaconda-ks.cfg grafana-1.9.1.tar.gz
apache-flume-1.6.0-bin.tar.gz influxdb-0.9.4.2-1.x86_64.rpm
apache-tomcat-7.0.67.zip install.log
collectd-5.5.0 install.log.syslog
collectd-5.5.0.tar.gz jdk-7u67-linux-x64.rpm
Desktop kafka_2.9.1-0.8.2.2.tgz
elasticsearch-2.1.1.rpm kibana-4.3.1-linux-x64.tar.gz
elasticsearch-2.1.1.tar.gz logstash-2.1.1.tar.gz
facette-0.3.0 tomcat7
facette-0.3.0.tar.gz
[root@node1 ~]# cd tomcat7/
[root@node1 tomcat7]# ls
bin lib logs RELEASE-NOTES temp work
conf LICENSE NOTICE RUNNING.txt webapps
[root@node1 tomcat7]# cd webapps/
[root@node1 webapps]# ls
doc docs examples host-manager manager ROOT
[root@node1 webapps]# pwd
/root/tomcat7/webapps
[root@node1 webapps]# cd /opt/es5.0/
[root@node1 es5.0]# ls
elasticsearch-5.1.2 init_env.sh
elasticsearch-5.1.2.zip jdk1.8.0_111
elasticsearch-head-master.zip jdk-8u111-linux-x64.tar.gz
elasticsearch-sql-5.1.2.0.zip s
[root@node1 es5.0]# unzip elasticsearch-sql-5.1.2.0.zip
[root@node1 es5.0]# ls
elasticsearch elasticsearch-5.1.2.zip elasticsearch-sql-5.1.2.0.zip jdk1.8.0_111 s
elasticsearch-5.1.2 elasticsearch-head-master.zip init_env.sh jdk-8u111-linux-x64.tar.gz
[root@node1 es5.0]# cd elasticsearch
[root@node1 elasticsearch]# ls
druid.jar elasticsearch-sql-5.1.2.0.jar elasticsearch-sql-5.1.2.0-sources.jar guava.jar plugin-descriptor.properties _site
[root@node1 elasticsearch]# cd ../
[root@node1 es5.0]# mv elasticsearch /root/tomcat7/webapps/ROOT/
[root@node1 es5.0]# cd /root/tomcat7/bin/
[root@node1 bin]# ./startup.sh
Using CATALINA_BASE: /root/tomcat7
Using CATALINA_HOME: /root/tomcat7
Using CATALINA_TMPDIR: /root/tomcat7/temp
Using JRE_HOME: /usr/java/jdk1.7.0_67
Using CLASSPATH: /root/tomcat7/bin/bootstrap.jar:/root/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[root@node1 bin]# jps
3933 Elasticsearch
4111 Jps
4110 Bootstrap
[root@node1 bin]# ps -ef |grep 4110
root 4110 1 3 12:55 pts/1 00:00:01 /usr/java/jdk1.7.0_67/bin/java -Djava.util.logging.config.file=/root/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/root/tomcat7/endorsed -classpath /root/tomcat7/bin/bootstrap.jar:/root/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/root/tomcat7 -Dcatalina.home=/root/tomcat7 -Djava.io.tmpdir=/root/tomcat7/temp org.apache.catalina.startup.Bootstrap start
[root@node1 bin]# netstat -tnpl |grep java
tcp 0 0 :::8009 :::* LISTEN 4110/java
tcp 0 0 :::8080 :::* LISTEN 4110/java
tcp 0 0 ::ffff:192.168.1.104:9200 :::* LISTEN 3933/java
tcp 0 0 ::ffff:192.168.1.104:9300 :::* LISTEN 3933/java
[root@node1 bin]# curl -XPUT 'http://localhost:9200/users/user/1' -d '{
> "user":kimchy",
> "post_date":"2012-12-12",
> "message":"trying out ElasticSearch!"
> }'
curl: (7) couldn't connect to host
[root@node1 bin]# curl -XPUT 'http://192.168.1.104:9200/users/user/1' -d '{
> "user":kimchy",
> "post_date":"2012-12-12",
> "message":"trying out ElasticSearch!"
> }'
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'kimchy': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@53b549fe; line: 2, column: 17]"}},"status":400}[root@node1 bin]#
[root@node1 bin]#
[root@node1 bin]#
[root@node1 bin]#
[root@node1 bin]# curl -XPUT 'http://192.168.1.104:9200/users/user/1' -d '{
> "user":kimchy",
> "message":"trying out ElasticSearch!"
> }'
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'kimchy': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@26d9b754; line: 2, column: 17]"}},"status":400}[root@node1 bin]#
[root@node1 bin]#
[root@node1 bin]#
[root@node1 bin]# curl -XPUT 'http://192.168.1.104:9200/users/user/1' -d '{
> "user":"kimchy",
> "message":"trying out ElasticSearch!"
> }'
{"_index":"users","_type":"user","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true}[root@node1 bin]#
[root@node1 bin]#
[root@node1 bin]# pwd
/root/tomcat7/bin
[root@node1 bin]# cd ../
还是失败,
查看官方手册
再次替换
[root@node1 tomcat7]# cd /root/tomcat7/webapps
[root@node1 webapps]# ls
doc docs es-sql-site-standalone.zip examples host-manager manager ROOT
[root@node1 webapps]# unzip es-sql-site-standalone.zip
[root@node1 webapps]# ls
doc docs es-sql-site es-sql-site-standalone.zip examples host-manager manager ROOT
[root@node1 webapps]# mv es-sql-site ROOT/
[root@node1 webapps]# ls
doc docs es-sql-site es-sql-site-standalone.zip examples host-manager manager ROOT
再次访问,还是歇菜了
# 增加新的参数,这样插件可以访问es
#http.cors.enabled:
true
#http.cors.allow-origin:
“*"
修改参数重启ES,再次尝试
1)新地址好用,测试ok,都是http.cors惹的祸
2)测试非独立SQL插件,也是好用的,看来不是插件问题而是参数问题
相关推荐
elasticsearch-sql插件,这个是支持1.x版本的es,直接解压到plugins,然后重启一下es即可,访问方式如head插件: http://127.0.0.1:9200/_plugin/sql/
通常,你会找到一个名为`elasticsearch-5.x.x.tar.gz`的文件。 2. **解压**: 使用解压工具(如7-Zip或tar命令)将下载的压缩包解压到你希望安装的目录,例如`/usr/local/`或`C:\Program Files\`。 3. **配置**: ...
若上述命令安装失败,可以下载Elasticsearch-SQL插件的zip压缩包,解压后将文件夹重命名为`sql`,并将其放置于ES安装目录的`plugins`子目录下,例如:`\elasticsearch-6.4.0\plugins\sql`。安装完毕后,请务必重启...
使用X-Pack SQL JDBC驱动,首先需要在Elasticsearch中安装X-Pack插件,然后配置JDBC连接字符串,包括服务器地址、端口、认证信息等。配置完成后,可以在Java应用程序中通过Class.forName()加载驱动,并使用java.sql...
1. **安装插件**:将下载的`elasticsearch-jdbc-2.2.0.0`文件解压,并将包含的JAR文件添加到Elasticsearch的`plugins`目录下。 2. **配置连接**:创建一个配置文件(如`jdbcRiver.json`),设置数据库连接参数(如...
### Elasticsearch 5.4.1 安装及 Head + SQL 插件安装详解 #### 一、环境准备 **1. JDK 1.8 必要条件** - Elasticsearch 5.X 版本开始,官方明确指出需要 JDK 1.8 作为运行环境的基础,以确保系统的稳定性和性能...
Elasticsearch支持插件安装以扩展其功能。你可以通过`bin/elasticsearch-plugin.bat install <plugin-name>`命令来安装插件,比如Kibana、Logstash和Beats等。 **7. 集群管理** Elasticsearch是一个分布式系统,多...
安装X-Pack的步骤包括在每个节点上解压`x-pack`插件,然后在`elasticsearch.yml`中启用它,如`xpack.security.enabled: true`。之后,使用`bin/elasticsearch-setup-passwords interactive`命令初始化默认用户和密码...
Elasticsearch-JDBC是Elasticsearch的一个插件,主要用于将数据从关系型数据库(如MySQL、Oracle等)导入到Elasticsearch中,实现数据的实时同步。2.2.0.0是该插件的一个版本号,代表着在该版本中包含了一些特定的...
在Windows 64位环境下,你需要首先安装Node.js(通过node-v12.18.3-x64.msi文件),然后解压Elasticsearch并启动服务,接着安装并运行Elasticsearch-Head,以便通过浏览器进行管理和监控。这个组合为你提供了一个...
2. SQL支持:Elasticsearch 7.x引入了对SQL查询的全面支持,用户可以通过标准的SQL语法进行搜索和数据分析,这使得对Elasticsearch的使用变得更加直观,特别是对于那些熟悉SQL的开发人员。 3. 安全性增强:此版本...
为了管理和监控Elasticsearch集群,你可以使用Elasticsearch的内置工具,如cat API、监视器插件,或者集成第三方工具如Grafana、Prometheus等。定期检查和优化索引设置、内存使用情况、搜索性能等,确保集群的健康和...
在Windows环境下,Elasticsearch的安装和使用对于开发者和数据分析师来说是至关重要的。这里我们将深入探讨Elasticsearch 6.8.10版本在Windows上的详细知识。 一、Elasticsearch 6.8.10概述 Elasticsearch 6.8.10是...
为了确保Elasticsearch的安全性,可以启用X-Pack插件,它提供了身份验证、授权、加密通信和监控等功能。在8.0.1版本中,可能已经预装了X-Pack,并且默认开启了一些安全特性,以保护您的数据不被未经授权的访问。 在...
4. **SQL支持**:通过Elasticsearch SQL插件,用户可以用SQL查询语言来操作Elasticsearch,为习惯传统数据库的用户提供便利。 5. **映射动态更新**:在7.x版本中,映射的更改不再需要重新索引所有数据,这使得映射...
3. **SQL 支持**:Elasticsearch 6.4.0 引入了对 SQL 查询语法的支持,使得熟悉 SQL 的用户能更容易地与 Elasticsearch 交互,提高了开发效率。 4. **机器学习功能**:该版本进一步增强了内置的机器学习功能,可以...
1. Elasticsearch 8.x版本默认启用了安全性插件,需要进行身份验证才能访问。在`elasticsearch.yml`中配置管理员用户和密码。 2. 防火墙配置:确保对外提供服务的端口(默认9200和9300)在防火墙中开放。 监控和...
5. `modules`:Elasticsearch内置模块的存放地,例如`x-pack`模块提供了安全、监控、警报和管理功能,不过在7.8.1版本中,X-Pack已更名为Elastic Stack的付费版——Elastic Cloud Enterprise。 在7.8.1版本中,...
5. **SQL支持**:Elasticsearch 7.x系列增强了对SQL查询的支持,使得对Elasticsearch的操作更接近传统的关系型数据库。 6. **API更新**:可能引入了新的API或对现有API进行了改进,以提供更好的灵活性和控制。 **...
- 在`bin`目录下,有`elasticsearch-plugin.bat`命令用于安装和管理插件,如Kibana、Logstash和其他社区贡献的插件。 5. **索引与映射**: - 索引是Elasticsearch中的基本数据容器,映射定义了字段的数据类型和...