Docker Compose raise an AccessDeniedExpcetion - elasticsearch

I'm trying to compose the ELK architecture by using docker compose. The following is the compose file:
version: '2'
services:
elasticsearch_assets:
image: elasticsearch
volumes:
- ./elasticsearch/config:/usr/share/elasticsearch/config
- ./elasticsearch/data:/usr/share/elasticsearch/data
- ./elasticsearch/logs:/usr/share/elasticsearch/logs
command: /bin/true
elasticsearch:
image: elasticsearch
volumes_from:
- elasticsearch_assets:rw
depends_on:
- elasticsearch_assets
And here folliwing a screenshot of the project structure:
When I run docker-compose up I get the following error:
Starting elkdocker_elasticsearch_assets_1
Starting elkdocker_elasticsearch_1
Attaching to elkdocker_elasticsearch_assets_1, elkdocker_elasticsearch_1
elkdocker_elasticsearch_assets_1 exited with code 0
elasticsearch_1 | [2016-03-22 01:28:59,939][WARN ][bootstrap ] unable to install syscall filter: seccomp unavailable: your kernel is buggy and you should upgrade
elasticsearch_1 | Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.scripts' (/usr/share/elasticsearch/config/scripts)
elasticsearch_1 | Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/config/scripts
elasticsearch_1 | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
elasticsearch_1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
elasticsearch_1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
elasticsearch_1 | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
elasticsearch_1 | at java.nio.file.Files.createDirectory(Files.java:674)
elasticsearch_1 | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
elasticsearch_1 | at java.nio.file.Files.createDirectories(Files.java:767)
elasticsearch_1 | at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
elasticsearch_1 | at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
elasticsearch_1 | at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:248)
elasticsearch_1 | at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
elasticsearch_1 | at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
elasticsearch_1 | Refer to the log for complete error details.
elkdocker_elasticsearch_1 exited with code 1
Do you have any idea why?

regarding this error
Unable to access 'path.scripts' error
just create a sub folder called scripts under the config folder
it will fix the error
./elasticsearch/config ==> mkdir ./elasticsearch/config/scripts

Change the docker compose to something like this
-v /elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
instead of pointing to empty directory

Related

Run "apereo/cas" docker image prints "Failed to start connector" error

My goal is to run CAS to replace ADFS. I thought starting with the docker image is a good place to begin.
I've tried running two different versions of apereo/cas and both have the same error.
Here's what I tried.
command
docker run -p 8080:8080 -p 8443:8443 apereo/cas:v5.3.2
output
__ ____ _ ____ __
/ / / ___| / \ / ___| \ \
| | | | / _ \ \___ \ | |
| | | |___ / ___ \ ___) | | |
| | \____| /_/ \_\ |____/ | |
\_\ /_/
CAS Version: 5.3.2
CAS Commit Id: 145d8c3dd5e27333dd05f5cc10987df4656fba5e
CAS Build Date/Time: 2018-07-30T21:09:46Z
Spring Boot Version: 1.5.14.RELEASE
Spring Version: 4.3.18.RELEASE
Java Home: /opt/zulu8.30.0.1-jdk8.0.172-linux_x64/jre
Java Vendor: Azul Systems, Inc.
Java Version: 1.8.0_172
JVM Free Memory: 24 MB
JVM Maximum Memory: 539 MB
JVM Total Memory: 52 MB
JCE Installed: Yes
Node Version: N/A
NPM Version: N/A
OS Architecture: amd64
OS Name: Linux
OS Version: 4.9.87-linuxkit-aufs
OS Date/Time: 2018-08-30T13:18:59.269
OS Temp Directory: /tmp
------------------------------------------------------------
Apache Tomcat Version: Apache Tomcat/8.5.32
------------------------------------------------------------
2018-08-30 13:18:59,416 INFO [org.apereo.cas.configuration.DefaultCasConfigurationPropertiesSourceLocator] - <Configuration directory [/etc/cas/config] is not a directory or cannot be found at the specific path>
2018-08-30 13:18:59,470 INFO [org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration] - <Located property source: CompositePropertySource [name='casCompositePropertySource', propertySources=[PropertiesPropertySource {name='embeddedYamlOverriddenProperties'}]]>
2018-08-30 13:18:59,500 INFO [org.apereo.cas.web.CasWebApplication] - <The following profiles are active: standalone>
2018-08-30 13:18:59,674 INFO [org.apereo.cas.web.CasWebApplicationContext] - <Refreshing CasWebApplicationContext()>
2018-08-30 13:19:09,553 WARN [org.apereo.cas.config.CasCoreTicketsConfiguration] - <Runtime memory is used as the persistence storage for retrieving and managing tickets. Tickets that are issued during runtime will be LOST when the web server is restarted. This MAY impact SSO functionality.>
2018-08-30 13:19:09,557 INFO [org.apereo.cas.util.CoreTicketUtils] - <Ticket registry encryption/signing is turned off. This MAY NOT be safe in a clustered production environment. Consider using other choices to handle encryption, signing and verification of ticket registry tickets, and verify the chosen ticket registry does support this behavior.>
2018-08-30 13:19:36,081 INFO [org.apereo.cas.config.CasConfigurationSupportUtilitiesConfiguration] - <CAS is configured to NOT watch configuration directory [/etc/cas/config]. Changes require manual reloads/restarts.>
2018-08-30 13:19:37,111 WARN [org.apereo.cas.config.support.authentication.AcceptUsersAuthenticationEventExecutionPlanConfiguration] - <>
2018-08-30 13:19:37,128 WARN [org.apereo.cas.config.support.authentication.AcceptUsersAuthenticationEventExecutionPlanConfiguration] - <
____ _____ ___ ____ _
/ ___| |_ _| / _ \ | _ \ | |
\___ \ | | | | | | | |_) | | |
___) | | | | |_| | | __/ |_|
|____/ |_| \___/ |_| (_)
CAS is configured to accept a static list of credentials for authentication. While this is generally useful for demo purposes, it is STRONGLY recommended that you DISABLE this authentication method (by setting 'cas.authn.accept.users' to a blank value) and switch to a mode that is more suitable for production.>
2018-08-30 13:19:37,129 WARN [org.apereo.cas.config.support.authentication.AcceptUsersAuthenticationEventExecutionPlanConfiguration] - <>
2018-08-30 13:19:50,183 INFO [org.apereo.cas.support.events.listener.CasConfigurationEventListener] - <Refreshing CAS configuration. Stand by...>
2018-08-30 13:19:51,182 WARN [org.apereo.cas.config.CasCoreServicesConfiguration] - <Runtime memory is used as the persistence storage for retrieving and persisting service definitions. Changes that are made to service definitions during runtime WILL be LOST when the web server is restarted. Ideally for production, you need to choose a storage option (JDBC, etc) to store and track service definitions.>
2018-08-30 13:19:51,278 INFO [org.apereo.cas.services.AbstractServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
2018-08-30 13:19:51,931 WARN [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Secret key for encryption is not defined for [Ticket-granting Cookie]; CAS will attempt to auto-generate the encryption key>
2018-08-30 13:19:51,956 WARN [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Generated encryption key [eTqXF8ggwLZtTQEZCskBylE0S4px3iBbGcverLvO2Fs] of size [256] for [Ticket-granting Cookie]. The generated key MUST be added to CAS settings under setting [cas.tgc.crypto.encryption.key].>
2018-08-30 13:19:51,961 WARN [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Secret key for signing is not defined for [Ticket-granting Cookie]. CAS will attempt to auto-generate the signing key>
2018-08-30 13:19:51,973 WARN [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Generated signing key [ZJNEO4PuSX3og9E923KKcp6bVVHb7bajkqkP1B4_35ytg4rW5CPqRvFYuxzmBTHAvsaTnBRvKqe53F_4ulg5Rw] of size [512] for [Ticket-granting Cookie]. The generated key MUST be added to CAS settings under setting [cas.tgc.crypto.signing.key].>
2018-08-30 13:19:53,293 WARN [org.apereo.cas.util.cipher.BaseBinaryCipherExecutor] - <Secret key for signing is not defined under [cas.webflow.crypto.signing.key]. CAS will attempt to auto-generate the signing key>
2018-08-30 13:19:53,295 WARN [org.apereo.cas.util.cipher.BaseBinaryCipherExecutor] - <Generated signing key [txKypaRUGM0NyMfI9reKAPzMCEuTDO4xWh9J-G16rmp5l-ZWpqBR7bge1wPvAx0FdYw2j__4aI_6Q9qANFe5ng] of size [512]. The generated key MUST be added to CAS settings under setting [cas.webflow.crypto.signing.key].>
2018-08-30 13:19:53,297 WARN [org.apereo.cas.util.cipher.BaseBinaryCipherExecutor] - <Secret key for encryption is not defined under [cas.webflow.crypto.encryption.key]. CAS will attempt to auto-generate the encryption key>
2018-08-30 13:19:53,300 WARN [org.apereo.cas.util.cipher.BaseBinaryCipherExecutor] - <Generated encryption key [xUiptRY2-RuCvAFV39UJlg] of size [16]. The generated key MUST be added to CAS settings under setting [cas.webflow.crypto.encryption.key].>
2018-08-30 13:19:53,867 ERROR [org.apache.catalina.core.StandardService] - <Failed to start connector [Connector[HTTP/1.1-8443]]>
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8443]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:265) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:208) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) ~[spring-boot-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.apereo.cas.web.CasWebApplication.main(CasWebApplication.java:71) ~[cas-server-webapp-init-5.3.2.jar!/:5.3.2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[cas.war:?]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[cas.war:?]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[cas.war:?]
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59) ~[cas.war:?]
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1020) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
... 20 more
Caused by: java.lang.IllegalArgumentException: No aliases for private keys found in key store
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:116) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:87) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:225) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
... 20 more
Caused by: java.io.IOException: No aliases for private keys found in key store
at org.apache.tomcat.util.net.jsse.JSSEUtil.getKeyManagers(JSSEUtil.java:233) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:114) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:87) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:225) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591) ~[tomcat-coyote-8.5.32.jar!/:8.5.32]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-catalina-8.5.32.jar!/:8.5.32]
... 20 more
I also tried a different version with no luck.
docker run -p 8080:8080 -p 8443:8443 apereo/cas:v5.2.2
This appears to be a problem with missing keys that I (think) need to be generated but I'm not sure if/where I need to mount a volume or what to do next.
FILE: /etc/cas/config/
keytool -genkeypair -alias cas -keyalg RSA \
-keypass changeit -storepass changeit \
-keystore $AP_HOME/etc/cas/thekeystore \
-dname "CN=localhost.xxx.com.tw,OU=xxx,OU=xxx,C=TW" \
-ext SAN="dns:localhost,ip:127.0.0.1,dns:`hostname`"
copy this file into container docker:
docker cp /etc/cas/thekeystore *container_name*:/etc/cas
I'd like to map the etc outside container, but maintains in container.
~/etc/cas/theKeystore
~/etc/cas/config/application.properties
~/etc/cas/config/cas.properties
~/etc/cas/config/log4j2.xml
~/cas-overlay: clone from github.
Try this
docker --name ...
-p 8443:8443 -p ...
-v ~/etc/cas:/etc/cas
-v ~/cas-overlay:/cas-overlay
...
I also maintain my project out of container.
such as modifing ~/etc/cas/config/application.properties, ...
and/or rebuilding cas.war, in ~/cas-overlay/mvnm package.
then restart this container dokcer.

Elasticsearch in Docker Container - "failed to write in data directory" after simple restart

some weeks ago I created an elk stack (elasticsearch, logstash, kibana) to handle the load of logfiles better.
It all worked perfectly. Today I invoked some new Patterns into logstash and for some reason, I restarted via docker-compose down && docker-compose up -d.
Now elasticsearch doesn't start up anymore.
root#xyz:/srv/elk# docker-compose logs elasticsearch
Attaching to elk_elasticsearch_1
elasticsearch_1 | [2017-07-01T07:34:36,859][INFO ][o.e.n.Node ] [lw-e01] initializing ...
elasticsearch_1 | [2017-07-01T07:34:36,999][INFO ][o.e.e.NodeEnvironment ] [lw-e01] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/mapper/HDD-ELK)]], net usable_space [19.1gb], net total_space [49gb], spins? [possibly], types [ext4]
elasticsearch_1 | [2017-07-01T07:34:36,999][INFO ][o.e.e.NodeEnvironment ] [lw-e01] heap size [3.9gb], compressed ordinary object pointers [true]
elasticsearch_1 | [2017-07-01T07:34:37,635][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [lw-e01] uncaught exception in thread [main]
elasticsearch_1 | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | Caused by: java.lang.IllegalStateException: Failed to created node environment
elasticsearch_1 | at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | ... 6 more
elasticsearch_1 | Caused by: java.io.IOException: failed to write in data directory [/usr/share/elasticsearch/data/nodes/0/indices/a94kXbSER2CE97qdPhgVLA/_state] write permission is required
elasticsearch_1 | at org.elasticsearch.env.NodeEnvironment.tryWriteTempFile(NodeEnvironment.java:1075) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.env.NodeEnvironment.assertCanWrite(NodeEnvironment.java:1047) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:277) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.node.Node.<init>(Node.java:262) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | ... 6 more
elasticsearch_1 | Caused by: java.nio.file.FileAlreadyExistsException: /usr/share/elasticsearch/data/nodes/0/indices/a94kXbSER2CE97qdPhgVLA/_state/.es_temp_file
elasticsearch_1 | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88) ~[?:?]
elasticsearch_1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
elasticsearch_1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
elasticsearch_1 | at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:?]
elasticsearch_1 | at java.nio.file.Files.newByteChannel(Files.java:361) ~[?:1.8.0_131]
elasticsearch_1 | at java.nio.file.Files.createFile(Files.java:632) ~[?:1.8.0_131]
elasticsearch_1 | at org.elasticsearch.env.NodeEnvironment.tryWriteTempFile(NodeEnvironment.java:1072) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.env.NodeEnvironment.assertCanWrite(NodeEnvironment.java:1047) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:277) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.node.Node.<init>(Node.java:262) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.4.0.jar:5.4.0]
elasticsearch_1 | ... 6 more
OK it Looks like a simple permissions, Problem, but also after a chown -R 1000.1000 elasticsearch/it crashes (AND set other ownerships).
The Setup: I Setup a Server with an LVM for the docker-compose Project. In the docker-compose.yml I described the three Services.
version: '3'
services:
elasticsearch:
image: my/elasticsearch/image:5.4.0
volumes:
- ./elasticsearch/data:/usr/share/elasticsearch/data
- ./elasticsearch/config:/usr/share/elasticsearch/config
- /etc/localtime:/etc/localtime:ro
environment:
ES_JAVA_OPTS: "-Xmx4g -Xms1g"
ulimits:
memlock:
soft: -1
hard: -1
networks:
- nginx_net
logstash:
image: my/logstash/image:5.4.0
command: ["logstash", "-f", "/etc/logstash.conf"]
volumes:
- ./logstash.conf:/etc/logstash.conf:ro
- ./logstash.yml:/etc/logstash/logstash.yml:ro
- ./GeoDb/GeoLite2-City.mmdb:/GeoLite2-City.mmdb:ro
- ./patterns:/etc/logstash/patterns:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "5044:5044"
environment:
LS_JAVA_OPTS: "-Xmx1g -Xms512m"
depends_on:
- elasticsearch
networks:
- nginx_net
kibana:
image: my/kibana/image:5.4.0
volumes:
- ./kibana/config/:/usr/share/kibana/config
- ./kibana/config/kibana.yml:/etc/kibana/kibana.yml
- /etc/localtime:/etc/localtime:ro
depends_on:
- elasticsearch
networks:
- nginx_net
networks:
nginx_net:
external: true
As you can see, I do not use the official Images directly, I install (at the Moment) XPack too, all three Images looking like this
FROM elasticsearch:5.4.0
RUN bin/elasticsearch-plugin install x-pack --batch
The scond thing I do different is I didn't use named volumes. That's because I like to have one folder containing the whole Project, also better for my LVM Management.
root#xyz:/srv/elk# ls -l
insgesamt 43488
-rw-r--r-- 1 root root 1514 Jul 1 09:34 docker-compose.yml
drwxr-xr-x 4 1000 1000 4096 Mai 18 17:43 elasticsearch
drwxr-xr-x 3 root root 4096 Mai 21 12:49 GeoDb
-rw-r--r-- 1 root root 25398754 Mai 21 12:49 GeoLite2-City.tar.gz
-rw-r--r-- 1 root root 19074950 Mai 21 12:03 GeoLiteCity.dat
drwxr-xr-x 3 root root 4096 Mai 14 16:20 kibana
-rw-r--r-- 1 root root 5523 Jul 1 09:02 logstash.conf
-rw-r--r-- 1 root root 4708 Jun 3 11:25 logstash.yml
drwx------ 2 root root 16384 Mai 17 23:40 lost+found
drwxr-xr-x 2 root root 4096 Jun 7 22:08 patterns
-rwxr-xr-x 1 root root 168 Mai 21 12:49 update-geoip.sh
root#xyz:/srv/elk# du -hs elasticsearch/
28G elasticsearch/
I read about plugins like local-persist to use named volumes but also specify the DIR to save the files to. But also I read, that docker recommends to not use plugins in production.
I would be pretty happy for any idea / link.
OK simple: run (in my case) rm elasticsearch/data/nodes/0/indices/a94kXbSER2CE97qdPhgVLA/_s‌​tate/.es_temp_file in main Folder of docker-compose Project helped me start EL again...
To figure out the exactly path look at the java.nio.file.FileAlreadyExistsException
The above answer didn't work for me. It ended up being a memory issue with Docker. Boosting Docker's memory allotment resolved it.

Docker with ElasticSearch none-root permission issue

I am trying to run ElasticSearch on Docker through docker-compose up. Whenever I try to start up my containers, I am getting this error:
Running as non-root...
elasticsearch | 2017-01-06 00:08:23,861 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
elasticsearch | at java.security.AccessControlContext.checkPermission(AccessControlContext.jav a:472)
elasticsearch | at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
elasticsearch | at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
elasticsearch | at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Default MBeanServerInterceptor.java:322)
elasticsearch | at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
elasticsearch | at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
elasticsearch | at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
elasticsearch | at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
elasticsearch | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:541)
elasticsearch | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:258)
elasticsearch | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)
elasticsearch | at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:220)
elasticsearch | at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)
elasticsearch | at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:125)
elasticsearch | at org.elasticsearch.common.logging.LogConfigurator.configureWithoutConfig(LogConfigurator.java:67)
elasticsearch | at org.elasticsearch.cli.Command.main(Command.java:59)
elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89)
elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82)
elasticsearch |
elasticsearch | 2017-01-06 00:08:25,813 main ERROR RollingFileManager (/data/elasticsearch.log) java.io.FileNotFoundException: /data/elasticsearch.log (Permission denied) java.io.FileNotFoundException: /data/elasticsearch.log (Permission denied)
This is my docker-compose.yml file:
elasticsearch:
container_name: elasticsearch
image: "itzg/elasticsearch:5.1.1"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- "./data/elasticsearch/:/data"

ElasticSearch failed to load plugins (License Module)

I have to load ElasticSearch plugins with the offline instructions but it looks like I am getting a permissions error even when I open up permissions to the files completely and running as root! I've removed and reinstalled as well but this error is consistent.
[root#ip-10-94-146-130 bin]# ./plugin install file:///home/jmblnvr/shield/license-2.1.0.zip
-> Installing from file:/home/jmblnvr/shield/license-2.1.0.zip...
Trying file:/home/jmblnvr/shield/license-2.1.0.zip ...
Downloading .DONE
Verifying file:/home/jmblnvr/shield/license-2.1.0.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed license into /usr/share/elasticsearch/plugins/license
[root#ip-10-94-146-130 bin]# service elasticsearch restart
Stopping elasticsearch: [FAILED]
Starting elasticsearch: Exception in thread "main" java.lang.IllegalStateException: Unable to initialize plugins
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/license/plugin-descriptor.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:302)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:108)
at org.elasticsearch.node.Node.<init>(Node.java:148)
at org.elasticsearch.node.Node.<init>(Node.java:129)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
[FAILED]
From /var/log:
[root#ip-10-94-146-130 elasticsearch]# cat elasticsearch.log
[2015-12-15 11:44:24,525][INFO ][node ] [Valtorr] stopping ...
[2015-12-15 11:44:24,639][INFO ][node ] [Valtorr] stopped
[2015-12-15 11:44:24,641][INFO ][node ] [Valtorr] closing ...
[2015-12-15 11:44:24,647][INFO ][node ] [Valtorr] closed
[2015-12-15 11:44:26,097][WARN ][bootstrap ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
[2015-12-15 11:44:26,314][INFO ][node ] [Agon] version[2.1.0], pid[21703], build[72cd1f1/2015-11-18T22:40:03Z]
[2015-12-15 11:44:26,314][INFO ][node ] [Agon] initializing ...
[2015-12-15 11:44:26,318][ERROR][bootstrap ] Exception
java.lang.IllegalStateException: Unable to initialize plugins
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:111)
at org.elasticsearch.node.Node.<init>(Node.java:148)
at org.elasticsearch.node.Node.<init>(Node.java:129)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/license/plugin-descriptor.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:302)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:108)
... 6 more
I was having the same sort of exception but after installing and while loading x-pack plugin on Elasticsearch 5.2.1:
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/x-pack/plugin-descriptor.properties
In my case, I started by adding elasticsearch user to the root group:
usermod -aG root elasticsearch
Afterwards, it was only necessary to modify the ownership of the plugins folder:
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/plugins/
Thanks to Val, simple solution is after installing plugins you need to quickly change ownership/groups if you are using the RPM install of Elastic:
chown -R root:elasticsearch /usr/share/elasticsearch

How to configure ActiveMQ with LevelDB JNI driver?

I am having trouble forcing ActiveMQ 5.10.1 on CentOS 6 (64bit) with Oracle JDK 8 to use JNI driver for LevelDB. When I set indexFactory="org.fusesource.leveldbjni.JniDBFactory" - my broker fails to start. When I omit it, it does start, but it uses Pure Java driver.
<persistenceAdapter>
<levelDB directory="${activemq.data}/leveldb" indexFactory="org.fusesource.leveldbjni.JniDBFactory"/>
</persistenceAdapter>
I did install LevelDB rpm on my OS, but after the AMQ start, its log file indicates that it uses the pure java driver:
2015-01-27 05:44:48,172 | INFO | Using Persistence Adapter: LevelDB[/home/roman/amq/DISK1/broker1/data/leveldb] | org.apache.activemq.broker.BrokerService | main
2015-01-27 05:44:48,233 | INFO | Using the pure java LevelDB implementation. | org.apache.activemq.leveldb.LevelDBClient | main
2
I try adding the level-db jni jar file to the classpath, but AMQ fails to find the classes. Here is running broker (note classpath with the leveldbjni-1.8.jar - AMQ docs does not really explain if those optional libs are loaded or not by default?, so I added it by hand):
/home/roman/jdk1.8.0_31/bin/java -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/home/roman/amq/DISK1/broker1/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/home/roman/amq/DISK1/broker1/tmp -Dactivemq.classpath=;/home/roman/amq/DISK1/broker1/conf;/home/roman/apache-activemq-5.10.1/lib/optional/leveldbjni-1.8.jar -Dactivemq.home=/home/roman/apache-activemq-5.10.1 -Dactivemq.base=/home/roman/amq/DISK1/broker1 -Dactivemq.conf=/home/roman/amq/DISK1/broker1/conf -Dactivemq.data=/home/roman/amq/DISK1/broker1/data -jar /home/roman/apache-activemq-5.10.1/bin/activemq.jar start
Here is the error I get in the log file when forcing JNI to be used for LevelDB:
2015-01-28 05:07:34,904 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#6276ae34: startup date [Wed Jan 28 05:07:34 PST 2015]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2015-01-28 05:07:36,139 | INFO | Using Persistence Adapter: LevelDB[/home/roman/amq/DISK1/broker1/data/leveldb] | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,193 | ERROR | Failed to start Apache ActiveMQ ([broker1, null], java.lang.Exception: Could not load any of the index factory classes: org.fusesource.leveldbjni.JniDBFactory) | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,198 | INFO | Apache ActiveMQ 5.10.1 (broker1, null) is shutting down | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,201 | INFO | Connector openwire stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,205 | INFO | Connector amqp stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,208 | INFO | Connector stomp stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,212 | INFO | Connector mqtt stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,215 | INFO | Connector ws stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,229 | INFO | Stopped LevelDB[/home/roman/amq/DISK1/broker1/data/leveldb] | org.apache.activemq.leveldb.LevelDBStore | main
2015-01-28 05:07:36,240 | INFO | Apache ActiveMQ 5.10.1 (broker1, null) uptime 0.135 seconds | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,243 | INFO | Apache ActiveMQ 5.10.1 (broker1, null) is shutdown | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,246 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1#6276ae34: startup date [Wed Jan 28 05:07:34 PST 2015]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2015-01-28 05:07:36,252 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1#6276ae34: startup date [Wed Jan 28 05:07:34 PST 2015]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:809)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:601)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.10.1.jar:5.10.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_31]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_31]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_31]
at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0_31]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.16.jar:3.16]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.16.jar:3.16]
at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.10.1.jar:5.10.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_31]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_31]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_31]
at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0_31]
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.10.1]
at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.10.1]
The AMQ doc does not explain on how to configure LevelDB for JNI to work. Any suggestions?
The reason I want to use JNI driver is because with pure Java driver my AMQ broker performs about ~20% slower than KahaDB in 80 concurrent user / 20 queues test. I am hoping JNI with LevelDB can make AMQ go faster than KahaDB configuration.
I know this is old, but I couldn't find the answer really documented anywhere else. All I needed to do was download the appropriate JNI library to the ActiveMQ lib directory. For example:
wget -O /etc/activemq/apache-activemq-5.13.0/lib/optional/leveldbjni-linux64-1.8.jar http://central.maven.org/maven2/org/fusesource/leveldbjni/leveldbjni-linux64/1.8/leveldbjni-linux64-1.8.jar

Resources