sonian / elasticsearch-jetty Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
@sonian Is the jetty-minimal.xml supposed to have such an effect? Also is there a mailing list for es-jetty?
If it is , what's the correct configuration?
Hello,
We recently updated to ES 1.4.1 from ES 1.3.4 with the following setting:
"http.type" => "com.sonian.elasticsearch.http.jetty.JettyHttpServerTransport"
However, on testing some ES nodes start and some don't. Following is the stack trace thrown on failed nodes:
WARN [main] o.e.j.x.XmlConfiguration Config error at
127.0.0.16000002
2015-01-13 19:51:34,703 ERROR [main] c.s.e.h.j.JettyHttpServerTransport [host1] Jetty Startup Failed
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_51]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_51]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_51]
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:807) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1141) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1044) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:735) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:400) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:355) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:296) ~[jetty-xml-8.1.14.v20131031.jar:8.1.14.v20131031]
at com.sonian.elasticsearch.http.jetty.JettyHttpServerTransport$1.onPortNumber(JettyHttpServerTransport.java:125) ~[elasticsearch-jetty-1.2.1.jar:na]
at org.elasticsearch.common.transport.PortsRange.iterate(PortsRange.java:58) [elasticsearch-1.4.1.jar:na]
at com.sonian.elasticsearch.http.jetty.JettyHttpServerTransport.doStart(JettyHttpServerTransport.java:100) [elasticsearch-jetty-1.2.1.jar:na]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) [elasticsearch-1.4.1.jar:na]
at org.elasticsearch.http.HttpServer.doStart(HttpServer.java:89) [elasticsearch-1.4.1.jar:na]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) [elasticsearch-1.4.1.jar:na]
at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:255) [elasticsearch-1.4.1.jar:na]
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:122) [elasticsearch-1.4.1.jar:na]
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:206) [elasticsearch-1.4.1.jar:na]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32) [elasticsearch-1.4.1.jar:na]
Caused by: java.lang.NoSuchMethodError: org.eclipse.jetty.server.AbstractConnector: method ()V not found
at org.eclipse.jetty.server.nio.AbstractNIOConnector.(AbstractNIOConnector.java:30) ~[jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.nio.SelectChannelConnector.(SelectChannelConnector.java:82) ~[jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
... 21 common frames omitted
2015-01-13 19:51:34,704 ERROR [main] bootstrap [host1] {1.4.1}: Startup Failed ...
Any pointers to what may be going on here?
elasticsearch-jetty doesn't work with Kibana 3 because it sends an insufficiently broad set of Access-Control-Allow-* headers.
See this commit in elasticsearch core: elastic/elasticsearch@f659cad
We recently pulled in the Jetty ES plugin and noticed that it doesn't copy over custom headers. This is an issue as some of our logic is dependent on setting cookies (in a custom filter we've developed).
The issue looks like it's with JettyHttpServerRestChannel's sendResponse method; the equivalent ES class (NettyHttpChannel) has logic to copy over headers from the ES custom RestResponse class to JBoss', but the Jetty one doesn't copy them into the HttpServletResponse.
I think everywhere in the default policies /_gateway/snapshot should be replaced with /_snapshot for ES 1.X
My server didn't start up until I switched from MD5 to OBF, I'm curious:
447 # Jetty Settings
448 sonian.elasticsearch.http.jetty:
449 port: 9200
450 ssl_port: 9443
451 keystore_password: "OBF:123"
452 #keystore_password: "MD5:123"
453 config: jetty.xml,jetty-ssl.xml
a) Can anyone else reproduce this?
b) Is this a Jetty bug or an elasticsearch-jetty issue?
I've got the plugin working fine on my elasticsearch (v1.0) app running on Openshift.
I'm now trying to apply basic authentication to it.
I've updated elasticsearch.yml
with the following:
path.conf: ${OPENSHIFT_ELASTICSEARCH_DIR}/conf
...
# Replace default netty http transport with jetty http transport (jetty plugin)
#
http.type: com.sonian.elasticsearch.http.jetty.JettyHttpServerTransportModule
sonian.elasticsearch.http.jetty:
bind_host: ${OPENSHIFT_ELASTICSEARCH_IP}
publish_host: ${PUBLISH_HOST}
config: jetty.xml,jetty-hash-auth.xml,jetty-restrict-all.xml
The xml files are all the default ones that were already there.
In app-root/data/elasticsearch-plugins/jetty/config/
I have added my realm.properties
file that contains the following (taken from the readme example for now):
superuser: Adm1n,admin,readwrite
However, when I run
curl --user superuser:Adm1n -vvv http://${OPENSHIFT_ELASTICSEARCH_IP}:${OPENSHIFT_ELASTICSEARCH_PORT}/
I get the following:
* About to connect() to 127.7.99.1 port 9200 (#0)
* Trying 127.7.99.1... connected
* Connected to 127.7.99.1 (127.7.99.1) port 9200 (#0)
* Server auth using Basic with user 'superuser'
> GET / HTTP/1.1
> Authorization: Basic c3VwZXJ1c2VyOkFkbTFu
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: 127.7.99.1:9200
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
* Authentication problem. Ignoring this.
< WWW-Authenticate: basic realm="DefaultRealm"
< Content-Type: text/plain;charset=ISO-8859-1
< Content-Length: 18
< Server: Jetty(8.1.14.v20131031)
<
* Connection #0 to host 127.7.99.1 left intact
* Closing connection #0
Can someone suggest why I am getting this authetication problem?
Hi all,
I try to install SSL on ES.
Jetty Plugin: 1.1.0-beta
Elasticsearch: 1.1.0
So I followed the steps described here: https://github.com/sonian/elasticsearch-jetty.
When I launched ES, I get this:
D:\TESTS\elasticsearch\bin>elasticsearch.bat
...
[2014-06-06 13:31:39,685][INFO ][org.eclipse.jetty.util.ssl.SslContextFactory] [
myCluster.myHost6D] Enabled Protocols [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLS
v1.2] of [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2]
[2014-06-06 13:31:39,688][INFO ][org.eclipse.jetty.server.AbstractConnector] [my
Cluster.myHost6D] Started [email protected]:9443
...
[2014-06-06 13:31:40,048][INFO ][node ] [myCluster.myHost
6D] started
Then, from my web app (https://localhost:9880/head/index.html) which has SSL integrated and the head plugin, when I try to connect to ES by https://localhost:9443/.
I get these errors:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9443/_cluster/health. This can be fixed by moving the resource to the same domain or enabling CORS. health
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9443/_nodes/stats?all=true. This can be fixed by moving the resource to the same domain or enabling CORS. stats
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9443/_nodes. This can be fixed by moving the resource to the same domain or enabling CORS. _nodes
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9443/. This can be fixed by moving the resource to the same domain or enabling CORS.
And in ES i get this error:
[2014-06-06 13:43:36,667][WARN ][org.eclipse.jetty.io.nio ] [myCluster.myHost
6D] javax.net.ssl.SSLException: bad record MAC
Could you help me?
I'm trying to install this plugin on Windows. I installed it successfully with the following command:
bin/plugin -url https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-0.90.12.zip -install elasticsearch-jetty-1.1.1
I can confirm that jetty-1.1.1 folder is under plugins folder. Then, I added the following configuration at the bottom of the config/elasticsearch.yml file:
http.type: com.sonian.elasticsearch.http.jetty.JettyHttpServerTransportModule
However, when I try to start the ES, I'm getting the below error:
C:\Utils\elasticsearch\bin>elasticsearch
[2014-04-18 13:03:00,245][INFO ][node ] [Peter Petruski] ver
sion[1.1.1], pid[5060], build[f1585f0/2014-04-16T14:27:12Z]
[2014-04-18 13:03:00,246][INFO ][node ] [Peter Petruski] ini
tializing ...
[2014-04-18 13:03:00,269][INFO ][plugins ] [Peter Petruski] loa
ded [jetty], sites []
{1.1.1}: Initialization Failed ...
- ExecutionError[java.lang.NoClassDefFoundError: org/elasticsearch/ElasticSearch
Exception]
NoClassDefFoundError[org/elasticsearch/ElasticSearchException]
ClassNotFoundException[org.elasticsearch.ElasticSearchException]
I'm running ES 1.1.1 and I guess my problem could be related to the fact that I'm installing https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-0.90.12.zip. Is that it or something else that I'm doing wrong?
Hi,
The download uri of 1.2.1:
https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-1.2.1.zip
shown "access denied"
I downloaded the 0.90.12 plugin and unzipped into the plugins folder (0.90.2 plugin command is buggy). I ran the plugin -l and elasticsearch-jetty-0.90.12 is installed. I then followed the documentation and enabled http.type but elasticsearch cannot starts and I get this error.
-bash-4.1$sudo ./bin/elasticsearch -f
[...]: initializing ...
[...][INFO ][plugins ] [[Bastion] loaded [], sites []
[....][ERROR][bootstrap ] {0.90.2}: Initialization Failed ...
If I don't enabled the http.type in elasticsearch.yml, elasticsearch runs fine but without jetty.
Any idea what may be happening? I am using CentOS.
i tried both:
/usr/share/elasticsearch/bin/plugin -url https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-1.0.1.zip -install elasticsearch-jetty-1.0.1
which gives:
"Failed to install elasticsearch-jetty-1.0.1, reason: failed to download out of all possible locations..., use -verbose to get detailed information"
and:
/usr/share/elasticsearch/bin/plugin --install sonian/elasticsearch-jetty/1.0.1
which gives:
"-> Installing sonian/elasticsearch-jetty/1.0.1...
Trying http://download.elasticsearch.org/sonian/elasticsearch-jetty/elasticsearch-jetty-1.0.1.zip...
Trying http://search.maven.org/remotecontent?filepath=sonian/elasticsearch-jetty/1.0.1/elasticsearch-jetty-1.0.1.zip...
Trying https://oss.sonatype.org/service/local/repositories/releases/content/sonian/elasticsearch-jetty/1.0.1/elasticsearch-jetty-1.0.1.zip...
Trying https://github.com/sonian/elasticsearch-jetty/archive/v1.0.1.zip...
Trying https://github.com/sonian/elasticsearch-jetty/archive/master.zip...
Downloading ................................................................DONE
Installed sonian/elasticsearch-jetty/1.0.1 into /usr/share/elasticsearch/plugins/jetty
Error while installing plugin, reason: IllegalArgumentException: Plugin installation assumed to be site plugin, but contains source code, aborting installation."
I already install the jetty 1.1.1-beta version, because i want the Authentication function, and put the line "http.type: com.sonian.elasticsearch.http.jetty.JettyHttpServerTransportModule" in my "elasticsearch.yml" but when i run the command curl -I "http://localhost:9200/" i don't get this response:
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Access-Control-Allow-Origin: *
Content-Length: 0
Server: Jetty(8.1.4.v20120524)
instead of that im getting this one:
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
Content-Length: 0
without the server: jetty response @hiredman
Latest plugin version (1.2.1) is not working with elasticsearch 1.4.0. There is an error when elasticsearch starts:
{1.4.0}: Initialization Failed ...
1) IllegalArgumentException[argument type mismatch]
Tested on Windows 7 x64, Java 7 Update 55 x64
Jetty 1.1.1-beta with ES 1.2.0 prevents ES from starting:
[2014-05-26 15:09:04,904][ERROR][bootstrap ] [Iridia] {1.2.0}: Startup Failed ...
Well, first, thanks for this plugin, tried this locally in my dev environment and worked a treat, we're definitely going to use this in production.
However, what would be extra-awesome is if this plugin could allow the requesting client application to pass on a 'requestId' that correlates any ES logs with a unique requestID handle. What we do is when a user interacts with our site, a unique requestId token is generated and bundled as a threadLocal, and use log4j's MDC concept so that all user logs for that requestId have that requestId in them, allowing very simple filtering to find all logs for a given request.
Now when a client app interacts with something like ES, it would be great for the ES api to be able to pass on this requestID in the headers so that the logging on the ES side also has the same thing. This way all ES queries/interactions for a given user base action could be logged and correlated together.
ES has the X-Opaque-Id header which I had planned to look at as part of trying this myself, see elastic/elasticsearch#1202 but maybe this plugin is the best place to do it.
For reference, we're building up to something like Google's Dapper (http://research.google.com/pubs/pub36356.html) where by in a distributed system unique requests can be identified (we're sticking with a single 'span' concept though at this stage).
Love to have your comments, and thanks again for a great plugin.
The installation of plugin v0.90.0 was successful. Starting ES with the default jetty.xml works fine.
Overwriting the default jetty.xml with jetty-restrict-writes.xml and starting the server results in:
[2013-05-08 17:12:00,608][WARN ][bootstrap ] jvm uses the client vm, make sure to run `java` with the server vm for best performance by adding `-server` to the command line
[2013-05-08 17:12:01,358][INFO ][node ] [Leonus] {0.90.0.Beta1}[30540]: initializing ...
[2013-05-08 17:12:01,373][INFO ][plugins ] [Leonus] loaded [lang-python, jetty], sites [head]
[2013-05-08 17:12:04,263][INFO ][node ] [Leonus] {0.90.0.Beta1}[30540]: initialized
[2013-05-08 17:12:04,266][INFO ][node ] [Leonus] {0.90.0.Beta1}[30540]: starting ...
[2013-05-08 17:12:04,334][INFO ][transport ] [Leonus] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.5.55.134:9300]}
[2013-05-08 17:12:07,368][INFO ][cluster.service ] [Leonus] new_master [Leonus][E37fBk-eQd-fG5hDRBmoPg][inet[/10.5.55.134:9300]], reason: zen-disco-join (elected_as_master)
[2013-05-08 17:12:07,379][INFO ][discovery ] [Leonus] elasticsearch/E37fBk-eQd-fG5hDRBmoPg
[2013-05-08 17:12:07,709][WARN ][org.eclipse.jetty.xml.XmlConfiguration] Config error at <Set name="handler"><Ref id="OldHandler"/></Set>
[2013-05-08 17:12:07,709][WARN ][org.eclipse.jetty.xml.XmlConfiguration] Config error at <Set name="handler">
<New class="com.sonian.elasticsearch.http.jetty.security.RestConstraintSecurityHandler" id="DefaultSecurityHandler"><Set name="handler"><Ref id="OldHandler"/></Set><Set name="loginService">
<Ref id="DefaultLoginService"/>
</Set><Set name="realmName">DefaultRealm</Set><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">DELETE</Set><Set name="pathSpec">
/,/_template/{name},/{index},/{index}/_query,/{index}/{type},
/{index}/{type}/_mapping,/{index}/{type}/_query,/{index}/{type}/{id},
/{index}/_warmer,/{index}/_warmer/{name},/{index}/{type}/_warmer/{name}
</Set><Set name="constraint">
<Ref id="ReadWriteSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">GET</Set><Set name="pathSpec">
/
</Set><Set name="constraint">
<Ref id="NoneSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">GET</Set><Set name="pathSpec">
/_count,/_mget,/_search,/_search/scroll,/_search/scroll/{scroll_id},/{index}/_count,
/{index}/_mget,/{index}/_search,/{index}/{type}/_count,/{index}/{type}/_mget,
/{index}/{type}/_percolate,/{index}/{type}/_search,/{index}/{type}/{id},
/{index}/{type}/{id}/_mlt,/_validate/query,/{index}/_validate/query,/{index}/{type}/_validate/query,
/_msearch,/{index}/_msearch,/{index}/{type}/_msearch
</Set><Set name="constraint">
<Ref id="ReadOnlyUserDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">GET</Set><Set name="pathSpec">
/_aliases,/_cluster/*,/_cluster/*/*,/_cluster/*/*/*,/_cluster/*/*/*/*,/_mapping,/_segments,
/_settings,/_stats,/_stats/*,/_stats/*/*,/_status,/_template/{name},/{index}/_aliases,
/_analyze,/{index}/_analyze,/{index}/_mapping,/{index}/_ping/broadcast,/{index}/_ping/replication,
/{index}/_segments,/{index}/_settings,/{index}/_stats,/{index}/_stats/*,/{index}/_stats/*/*,
/{index}/_status,/{index}/{type}/_mapping,/{index}/{type}/{id}/_ping,
/_nodes,/_nodes/*,/_nodes/*/*,/_nodes/*/*/*,/{index}/_warmer,/{index}/_warmer/{name},
/{index}/{type}/_warmer/{name}
</Set><Set name="constraint">
<Ref id="ReadOnlyClusterDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">GET</Set><Set name="pathSpec">
/_cache/clear,/_flush,/_optimize,/_refresh,/{index}/_cache/clear,/{index}/_flush,
/{index}/_optimize,/{index}/_refresh
</Set><Set name="constraint">
<Ref id="ReadWriteSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">HEAD</Set><Set name="pathSpec">
/
</Set><Set name="constraint">
<Ref id="NoneSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">HEAD</Set><Set name="pathSpec">
/{index}
</Set><Set name="constraint">
<Ref id="ReadOnlyClusterDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">HEAD</Set><Set name="pathSpec">
/{index}/{type}/{id}
</Set><Set name="constraint">
<Ref id="ReadOnlyUserDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">POST</Set><Set name="pathSpec">
/_analyze,/{index}/_analyze
</Set><Set name="constraint">
<Ref id="ReadOnlyClusterDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">POST</Set><Set name="pathSpec">
/_count,/_mget,/_search,/_search/scroll,/_search/scroll/{scroll_id},/{index}/_count,
/{index}/_mget,/{index}/_search,/{index}/{type}/_count,/{index}/{type}/_mget,
/{index}/{type}/_percolate,/{index}/{type}/_search,/{index}/{type}/{id}/_mlt,
/_validate/query,/{index}/_validate/query,/{index}/{type}/_validate/query,
/_msearch,/{index}/_msearch,/{index}/{type}/_msearch
</Set><Set name="constraint">
<Ref id="ReadOnlyUserDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">POST</Set><Set name="pathSpec">
/_aliases,/_bulk,/_cache/clear,/_flush,/_gateway/snapshot,/_optimize,/_refresh,
/_template/{name},/{index},/{index}/_cache/clear,/{index}/_close,/{index}/_flush,
/{index}/_gateway/snapshot,/{index}/_mapping,/{index}/_open,/{index}/_optimize,
/{index}/_refresh,/{index}/{type},/{index}/{type}/_mapping,/{index}/{type}/{id},
/{index}/{type}/{id}/_create,/{index}/_bulk,/{index}/{type}/_bulk,/{index}/{type}/{id}/_update
</Set><Set name="constraint">
<Ref id="ReadWriteSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">POST</Set><Set name="pathSpec">
/_cluster/nodes/_restart,/_cluster/nodes/_shutdown,
/_cluster/nodes/{nodeId}/_restart,/_cluster/nodes/{nodeId}/_shutdown,
/_shutdown,/_cluster/reroute
</Set><Set name="constraint">
<Ref id="AdminSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">PUT</Set><Set name="pathSpec">
/_bulk,/_template/{name},/{index},/{index}/_mapping,/{index}/_settings,/{index}/{type}/_mapping,
/{index}/{type}/{id},/{index}/{type}/{id}/_create,/{index}/_bulk,/{index}/{type}/_bulk,
/{index}/_warmer/{name},/{index}/{type}/_warmer/{name}
</Set><Set name="constraint">
<Ref id="ReadWriteSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">PUT</Set><Set name="pathSpec">
/_cluster/settings,/_settings
</Set><Set name="constraint">
<Ref id="AdminSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="method">GET</Set><Set name="pathSpec">
/_plugin/*,/_plugin/*/*,/_plugin/*/*/*,/_plugin/*/*/*/*,/_plugin/*/*/*/*/*,
/_plugin/*/*/*/*/*/*,/_plugin/*/*/*/*/*/*/*,/_plugin/*/*/*/*/*/*/*/*,
/_plugin/*/*/*/*/*/*/*/*/*, /_plugin/*/*/*/*/*/*/*/*/*/*
</Set><Set name="constraint">
<Ref id="ReadOnlyClusterDataSecurityConstraint"/>
</Set></New>
</Arg></Call><Call name="addConstraintMapping"><Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping"><Set name="pathSpec">*</Set><Set name="constraint">
<Ref id="ForbiddenSecurityConstraint"/>
</Set></New>
</Arg></Call></New>
</Set>
[2013-05-08 17:12:07,710][ERROR][com.sonian.elasticsearch.http.jetty.JettyHttpServerTransport] [Leonus] Jetty Startup Failed
java.lang.IllegalStateException: No object for id=OldHandler
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1084)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:997)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:416)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:378)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:780)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1082)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:997)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:416)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:378)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:338)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:291)
at com.sonian.elasticsearch.http.jetty.JettyHttpServerTransport$1.onPortNumber(JettyHttpServerTransport.java:125)
at org.elasticsearch.common.transport.PortsRange.iterate(PortsRange.java:68)
at com.sonian.elasticsearch.http.jetty.JettyHttpServerTransport.doStart(JettyHttpServerTransport.java:100)
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85)
at org.elasticsearch.http.HttpServer.doStart(HttpServer.java:92)
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85)
at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:216)
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:119)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:203)
at org.elasticsearch.bootstrap.ElasticSearch.main(ElasticSearch.java:32)
[2013-05-08 17:12:07,717][ERROR][bootstrap ] [Leonus] {0.90.0.Beta1}: Startup Failed ...
- BindHttpException[Failed to bind to [9200-9300]]
IllegalStateException[No object for id=OldHandler]
Any ideas?
Hello !
Where should I put the realm.properties file ? is it in etc/elasticsearch/config (folder doesn't exist natively ) or in jetty plugin config file ?
Also , does jetty secure the get and post methods as well ?
and finally , should we add the jetty lines in all cluster members ? or just the master ?
thanks
I am pretty new to jetty & java webapps.
I am attempting to deploy an instance of this that is attached to my elasticsearch:
https://github.com/thatcher/rhino-for-webapps
I setup jetty.xml with this:
<Arg>
<New class="org.eclipse.jetty.deployer.WebAppDeployer">
<Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
<Set name="parentLoaderPriority">false</Set>
<Set name="extract">true</Set>
<Set name="allowDuplicates">false</Set>
<Set name="defaultsDescriptor"><Property name="es.config"/>/webdefault.xml</Set>
</New>
</Arg>
</Call>
I get this error:
ClassNotFoundException[org.eclipse.jetty.deployer.WebAppDeployer]```
I download http://download.eclipse.org/jetty/7.4.5.v20110725/dist/jetty-distribution-7.4.5.v20110725.tar.gz
and plop jetty-distribution-7.4.5.v20110725/lib/jetty-deploy-7.4.5.v20110725.jar into elasticsearch/plugins/jetty
I am sure I am missing lots of big points, here. Any hints would be greatly appreciated.
I tried installing various versions of the plugin with my own ElasticSearch running version 0.90.7. Unfortunately, I was never able to use this setting without it producing errors:
sonian.elasticsearch.http.filter:
transport_type: "netty"
This is the error I got when I tried, using elasticsearch-jetty version 0.90.12:
[2014-07-24 14:31:44,395][WARN ][http.netty ] [Shen Kuei] Caught exception while handling client http traffic, closing connection [id: 0xf8df2616, /0:0:0:0:0:0:0:1:59087 => /0:0:0:0:0:0:0:1:9200]
java.lang.IncompatibleClassChangeError: Found interface org.elasticsearch.http.HttpRequest, but class was expected
at com.sonian.elasticsearch.http.filter.logging.LoggingFilterHttpServerAdapter.doFilter(LoggingFilterHttpServerAdapter.java:75)
at com.sonian.elasticsearch.http.filter.FilterChainManager$FilterChainImpl.doFilter(FilterChainManager.java:56)
at com.sonian.elasticsearch.http.filter.FilterChainManager.dispatchRequest(FilterChainManager.java:39)
at org.elasticsearch.http.netty.NettyHttpServerTransport.dispatchRequest(NettyHttpServerTransport.java:290)
at org.elasticsearch.http.netty.HttpRequestHandler.messageReceived(HttpRequestHandler.java:43)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:145)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459)
at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536)
at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:74)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
I also got the following exception with a different version of the plugin (0.90.0), but I expected to get errors from what I think would be incompatible versions:
[2014-07-24 15:47:53,176][WARN ][http.netty ] [Lancer] Caught exception while handling client http traffic, closing connection [id: 0x326d0423, /0:0:0:0:0:0:0:1:60642 => /0:0:0:0:0:0:0:1:9200]
java.lang.ClassCastException: org.elasticsearch.http.netty.NettyHttpRequest cannot be cast to com.sonian.elasticsearch.http.jetty.JettyHttpServerRestRequest
at com.sonian.elasticsearch.http.filter.logging.LoggingFilterHttpServerAdapter$LoggingHttpChannel.<init>(LoggingFilterHttpServerAdapter.java:153)
at com.sonian.elasticsearch.http.filter.logging.LoggingFilterHttpServerAdapter.doFilter(LoggingFilterHttpServerAdapter.java:77)
at com.sonian.elasticsearch.http.filter.FilterChainManager$FilterChainImpl.doFilter(FilterChainManager.java:56)
at com.sonian.elasticsearch.http.filter.FilterChainManager.dispatchRequest(FilterChainManager.java:39)
at org.elasticsearch.http.netty.NettyHttpServerTransport.dispatchRequest(NettyHttpServerTransport.java:291)
at org.elasticsearch.http.netty.HttpRequestHandler.messageReceived(HttpRequestHandler.java:43)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:145)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459)
at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536)
at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:74)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Simply changing the version number to the most recent 1.1.1 does not work, because the file is not available. 1.1.0 is not available, either. Thanks.
I have cloned the Jetty plugin and added some custom logic on top of it. With Java Security Manager enabled in ES, I am facing issues to make Socket connection.
Please suggest how I can move forward. I read some docs here, are they relevant?
Does this plugin support SPDY (http://www.eclipse.org/jetty/documentation/current/spdy.html) out of the box?
If not, how do you set it up?
hi, i upgrade es-jetty 's error from es 1.3.6 to es 1.7,it's happened some errors,such as the following:
IllegalArgumentException[argument type mismatch]
pls help me. thank you.
Trying to use Jetty with ES RC1, and I get the following on startup:
[2014-02-03 17:11:24,674][ERROR][bootstrap ] {1.0.0.RC1}:
Initialization Failed ...
ClassNotFoundException[org.elasticsearch.ElasticSearchException]
The same works with an earlier version. Is there a timeline for 1.x support?
Thanks,
Hans
elasticsearch-jetty plugin is not working with ES 0.90.10 due to this change.
Code update is needed in order to make it work again.
This will be especially helpful for configuring the proper rules for something like /_plugin/head/ etc.
https://groups.google.com/forum/#!msg/elasticsearch-jetty/Pvn6gdVNUbs/DqsTIdHp0RgJ
https://issues.apache.org/jira/browse/WHIRR-261
Whirr enables creation of elasticsearch clusters on multiple clouds with a single shell command. However, it lacks access control of any kind. Adding elasticsearch-jetty will dramatically increase the use of the whirr recipe, and elasticsearch-jetty and elasticsearch itself.
Coordinating with the whirr team to get this done would be awesome!
Maven artifacts are not available for the latest version of the plugin...
Only 0.90.0 is available
http://mvnrepository.com/artifact/com.sonian/elasticsearch-jetty/0.90.0
can some one upload it?
-Samatha
Apologies in advance if this is more of a support issue, but I can not install. Following errors.
[root@localhost /]# elasticsearch/bin/plugin -install elasticsearch/elasticsearch-jetty/0.20.0 -verbose
-> Installing elasticsearch/elasticsearch-jetty/0.20.0...
Trying http://download.elasticsearch.org/elasticsearch/elasticsearch-jetty/elasticsearch-jetty-0.20.0.zip...
Failed: IOException[Can't get http://download.elasticsearch.org/elasticsearch/elasticsearch-jetty/elasticsearch-jetty-0.20.0.zip to /elasticsearch/plugins/jetty.zip]; nested: FileNotFoundException[http://download.elasticsearch.org/elasticsearch/elasticsearch-jetty/elasticsearch-jetty-0.20.0.zip]; nested: FileNotFoundException[http://download.elasticsearch.org/elasticsearch/elasticsearch-jetty/elasticsearch-jetty-0.20.0.zip];
Trying http://search.maven.org/remotecontent?filepath=elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip...
Failed: IOException[Can't get http://search.maven.org/remotecontent?filepath=elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip to /elasticsearch/plugins/jetty.zip]; nested: FileNotFoundException[http://search.maven.org/remotecontent?filepath=elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip]; nested: FileNotFoundException[http://search.maven.org/remotecontent?filepath=elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip];
Trying https://oss.sonatype.org/service/local/repositories/releases/content/elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip...
Failed: IOException[Can't get https://oss.sonatype.org/service/local/repositories/releases/content/elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip to /elasticsearch/plugins/jetty.zip]; nested: FileNotFoundException[https://oss.sonatype.org/service/local/repositories/releases/content/elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip]; nested: FileNotFoundException[https://oss.sonatype.org/service/local/repositories/releases/content/elasticsearch/elasticsearch-jetty/0.20.0/elasticsearch-jetty-0.20.0.zip];
Trying https://github.com/elasticsearch/elasticsearch-jetty/zipball/v0.20.0... (assuming site plugin)
Failed: IOException[Can't get https://github.com/elasticsearch/elasticsearch-jetty/zipball/v0.20.0 to /elasticsearch/plugins/jetty.zip]; nested: FileNotFoundException[https://github.com/elasticsearch/elasticsearch-jetty/zipball/v0.20.0]; nested: FileNotFoundException[https://github.com/elasticsearch/elasticsearch-jetty/zipball/v0.20.0];
Failed to install elasticsearch/elasticsearch-jetty/0.20.0, reason: failed to download out of all possible locations..., use -verbose to get detailed information
I have done all the default configuration given here.
ES server is started but when I access GET https://localhost:8443/_search url in sense UI, it is showing below error:
Request failed to get to the server (status code: 0):.
I provided 8443 port in jetty-ssl.xml config.
Can a tag and downloadable file be added for version 1.0.1 of the plugin? Thanks.
Jetty 8 is now EOL (End of Life)
Upgrade to Jetty 9.
Hi ,
I want to setup my ELS engine to have a support of the SSL.
Can somebody suggest anything for that.
i had already tried the modification with jetty
https://github.com/sonian/elasticsearch-jetty
which is not supporting the latest ELS version 1.4.1.
i tried with nginx also but not able to configure with windows.
Can anybody suggest anything on that.
I'm trying to make jetty work , unfortunately , I don't get the jetty header in response .
When I took a look on the logs , I found this :
[2014-06-13 13:03:55,566][WARN ][org.eclipse.jetty.util.component.AbstractLifeCycle] [Primary node] FAILED [email protected]:9200: java.net.BindException: Address already in use
which means that the port 9200 is already used , which is not odd , because that's elasticsearch's.
Do I have to change ports ? although it's not mentionned in the docs..
Could you maybe also publish the latest 0.90 release of elasticsearch-jetty on maven-central?
Has the current version been tested with the final 0.90 release of elasticsearch?
Wondering if there is a release anywhere to support Elasticsearch 2.x . If not I could work on a pull request for the same.
I see that the last commit here was long time ago and wanted to check if this plugin is abandoned. If so are there any issues with running ES on jetty?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.