Initial attempt at installing Elasticsearch not going well - Windows Server 2016


#1

Am trying to perform my first install of Elasticsearch; and I can't get the service to start.

We always put our OS and programs on one drive and then the bulk of the data on a second drive. So in this case Windows and Program Files\Elastic\Elasticsearch are on C. And then on E we have Elastic\Elasticsearch\Config; Elastic\Elasticsearch\Data; and Elastic\Elasticsearch\Logs.

Trying to start elasticsearch from the command line returns:
Error opening log file 'logs/gc.log': No such file or directory.

And then I found a bunch of posts talking about not being able to use different drives, but they were quite old. Is this still an issue? Or do I have to change config somewhere?

elasticsearch.yml looks correct:
path.logs: E:\Elastic\Elasticsearch\Logs

Thanks


(Abdon Pijpelink) #2

I have seen this error when trying to run Elasticsearch with a 32 bit JVM. Elasticsearch requires a 64 bit JVM. Make sure you have installed a 64 bit JVM and that the JAVA_HOME environment variable points to that 64 bit JVM. If the JAVA_HOME points to a directory that has (x86) in its name, then you are trying to use a 32 bit JVM.


#3

Hi abdon,

Can't find any trace of 32 bit Java on that server. (It is a brand new one that I created specifically for this purpose.)

Maybe something is not correct with the Java ? Here is the output from elasticsearch.exe --debug-env


Java

Java paths

  • current = C:\Program Files\Java\jdk-11.0.2\bin\java.exe
    Java Candidates (in order of precedence)
  • JavaHomeProcessVariable = C:\Program Files\Java\jdk-11.0.2
  • JavaHomeUserVariable =
  • JavaHomeMachineVariable = C:\Program Files\Java\jdk-11.0.2
  • JdkRegistry64 = C:\Program Files\Java\jdk-11.0.2
  • JreRegistry64 =
  • JdkRegistry32 =
  • JreRegistry32 =
    Java checks
  • Using32BitJava = False
  • JAVA_HOME as machine and user variable = False

(Abdon Pijpelink) #4

I think you are hitting this issue: https://github.com/elastic/windows-installers/issues/249

Can you try configuring GC logging directory in the jvm.options configuration file? There should be a header # JDK 9+ GC logging in the file. Just below that, change the logs in the path logs/gc.log into your log directory.


#5

Well, this file path seems to work
file=/E/Elastic/Elasticsearch/Logs/gc.log

And the error I get now is

[Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
0.005s][error][logging ] Error opening log file '/E/Elastic/Elasticsearch/Logs/gc.log': No such file or directory

Unhandled Exception:
C:\Program Files\Elastic\Elasticsearch\6.5.4\bin>file=/E/Elastic/Elasticsearch/Logs/gc.log

Both the data and logs directories are empty. Is this expected after an install?


(Abdon Pijpelink) #6

Can you try configuring file=E:\Elastic\Elasticsearch\Logs\gc.log instead?


#7

Good morning. Ready to start again? :slight_smile:

file=E:\Elastic\Elasticsearch\Logs\gc.log gives me:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

[0.004s][error][logging Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=E:\Elastic\Elasticsearch\Logs\gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
] Invalid decorator '\Elastic\Elasticsearch\Logs\gc.log'.


(Abdon Pijpelink) #8

Here's one more thing to try: surrounding the path by escaped quotes: \". Like this:

file=\"E:\Elastic\Elasticsearch\Logs\gc.log\"

#9

Delayed response due to the public holiday yesterday.

This is what I get now:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: UseAVX=2 is not supported on this CPU, setting it to UseAVX=1
2019-01-29 13:27:01,991 main ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: MarkedYAMLException[while scanning an alias
in 'reader', line 14, column 27:
*
^
expected alphabetic or numeric character, but found
in 'reader', line 14, column 28:
*
^

at [Source: sun.nio.ch.ChannelInputStream@9ebe38b; line: 14, column: 25]]; nested: ScannerException[while scanning an alias
in 'reader', line 14, column 27:
*
^
expected alphabetic or numeric character, but found
in 'reader', line 14, column 28:
*
^
];
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1216)
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1189)
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:100)
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:95)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86)
Caused by: com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: while scanning an alias
in 'reader', line 14, column 27:
*
^
expected alphabetic or numeric character, but found
in 'reader', line 14, column 28:
*
^

at [Source: sun.nio.ch.ChannelInputStream@9ebe38b; line: 14, column: 25]
at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException.from(MarkedYAMLException.java:27)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:343)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:53)
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:724)
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:699)
at org.elasticsearch.common.settings.Settings.access$500(Settings.java:84)
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1212)
... 8 more
Caused by: while scanning an alias
in 'reader', line 14, column 27:
*
^
expected alphabetic or numeric character, but found
in 'reader', line 14, column 28:
*
^

    at org.yaml.snakeyaml.scanner.ScannerImpl.scanAnchor(ScannerImpl.java:1439)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchAlias(ScannerImpl.java:918)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:366)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:585)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:157)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:167)
    at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:340)
    ... 13 more

(Abdon Pijpelink) #10

Alright - we're making progress. This new error is related to another configuration file: the elasticsearch.yml file. Apparently something is misconfigured on line 14. Can you maybe paste the contents of that file here? (The file should be in E:\Elastic\Elasticsearch\Config)


#11

Here we go:

E:\Elastic\Elasticsearch\Config\elasticsearch.yml contents:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: RNELASTIC
path.data: E:\Elastic\Elasticsearch\Data
path.logs: E:\Elastic\Elasticsearch\Logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: true
action.auto_create_index: *


(Abdon Pijpelink) #12

You can try removing the last line from that file:

action.auto_create_index: *

That should resolve this issue.


#13

Thanks Abdon

That line was there because the documentation called for it to be added if you didn't know how many indexes you would need.

Removing it did seem to do the trick.


(Stuart Cam) #14

As @abdon has mentioned, this looks very much like this issue:

This is being worked on currently, along with merging in this branch: https://github.com/elastic/windows-installers/tree/fix/remove-32bit - which will remove 32bit Java support.


(system) closed #15

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.