Logstash – Error – ” Unrecognized VM option ‘UseParNewGC’ “

Background

During my initial evaluation of Logstash ran into an easy to address error.

Reproduce

Invoke

The invocation is straight forward


set "_binfolder=C:\Downloads\Elastic\Logstash\v6.3.2\extract\bin"
set "_configuration=stackOverflow2010.User.conf"

call %_binfolder%\logstashImpl.bat -f %_configuration%

Output

Image

UseParNewGC_20180802_0334PM

Textual


Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Troubleshooting

Java

Java Version

Outline

We can request the version Number for the java runtime executable, java.exe.

Script


java -version

Output

Image

java_version_20180808_0332PM

Textual


java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

Knowledge Base ( KB)

Googled on the the term and got a good hit

  1. [META] Java 10 Support #9345
    • Opened By :- andrewvc
    • Date Opened :- 2018-April-9th
    • Link
      Link
    • Resolution
      • Resolution #1
        • By :- Armin Braun ( original-brownbear )
        • Web Links
        • Workaround :- Currently there is no temporary fix sorry. Switching to Java 8 is the only stable solution for the time being.
      • Resolution #2
        • By :- Josh Daone ( JoshDaone )
        • Web Links
        • Workaround :- @original-brownbear thanks! Switched back to openjdk-8-jre and working properly.

Resolution

Target Specific Java Version

Objective

Rather than rely on Java that is referenced in our path, we will set the environment variable JAVA_HOME to a pre-v10 Version.

Review Installed Java

Launched Windows explorer and access the “C:\Program Files\Java” folder.

Review Java Folders

java_explorer_20180808_0424PM

Code


set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181"

Additional Reading

  1. Andy Luis
    • mpvjava
      • JDK 9 Migration : 5 point checklist for Garbage Collection
        Link
      • About
        Link
  2.  OpenJDK
    • JEP 214: Remove GC Combinations Deprecated in JDK 8
      Link
  3. ORACLE
    • JDK 9 Release Notes – Removed APIs, Features, and Options
      Link

 

Dedicated

Dedicated to Armin Braun ( original-brownbear )
Less Talking … More Coding …

References

  1. Elastic
    • elastic/logstash
      [META] Java 10 Support #9345
      Link

ElasticSearch (v6) – Installation ( on Windows )

Background

Trying to review ElasticSearch.

Our choices is to search the Net for Web Hosting Services that avail it or “Install it locally“.

Installation Material Choices

There are a couple of options for installing ElasticSearch on MS Windows.

ElasticSearch is packaged via zip and MSI.

If you will like to install to run it as a Windows Service and have it registered as a Windows Program, please choose the MSI route.

If you will to simply test things out, please proceed down the ZIP path, extract it, and run it from the command line, please choose the ZIP package.

Installation Material Location

The Install Materials are available here.

Installation Choice

We chose to go down the MSI Package.

Prerequisite

The lone Prerequisite is Java’s JDK.

Java’s JDK

Version

Our targeted ElasticSearch’s Version is 6.

That minimum supported version is JDK 9.  As JDK 10 is now available and supported by ES 6, we chose to go with JDK 10.

Installed Vejava_version_20180729_0123AM.PNGrsion

To determine the Version of Java JDK installed, please launch a command prompt and run java passing along the -version option.

Code


java -version

Output

java_version_20180729_1258AM.PNG

Explanation

We can see that java JDK is not installed.

Download Location

JDK v10 is available here.

installMaterial_20180729_0102AM

Installing

GUI

Welcome

welcome_20180729_0107AM.PNG

Options
Options – Before

optionalFeatures_20180729_0108AM.PNG

Options – After

Changed Install Location from C:\Program Files\Java\jdk-10.0.2\ to E:\Program Files\Java\jdk-10.0.2\

optionalFeatures_20180729_0109AM.PNG

Status
Status -1

status_20180729_0109AM.PNG

Status -2

successfullyInstalled_20180729_0120AM.PNG

Complete

status_20180729_0111AM.PNG

Validate Version

Let us go back and validate that we have the right Java Installed.

Code


java -version

Output

java_version_20180729_0123AM.PNG

Explanation

Confirmed that we Java JDK 10.0.2 installed.

Bitness is 64-Bit.

Install Elastic Search…

GUI

Locations

Locations – Original

locations_20180729_0124AM.PNG

Locations – Create Folder

We don’t want to target the system drive and thus will create folders on another drive; in our case drive E:


setlocal 

set "_base=E:\Program Files\Elastic\Elasticsearch\6.3.2"

if not exist "%_base%\data" mkdir "%_base%\data"

if not exist "%_base%\config" mkdir "%_base%\config"

if not exist "%_base%\logs" mkdir "%_base%\logs"

endlocal
<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;"></span>

Locations – Revised

locations_20180729_0134AM.PNG

 

Services

Revised

Have the following:

  1. Account Information from Local System to Network Service
  2. Chose to have Service start upon completion of Installation
  3. Opted not to have Service automatically during OS Starts

Service_20180729_0135AM.PNG

Configuration

Original

Configuration_20180729_0136AM.PNG

Revised

Have the following:

  1. Changed Memory  from 2 GB to 256 MB
  2. Opted not to have “Lock JVM memory

Configuration_20180729_0137AM.PNG

 

Plugins

Original

plugins_20180729_0138AM.PNG

 

Revised

Chose to enable the following plugins:

  1. Ingest Attachment Processor
  2. Ingest GeoIP Processor
  3. Store SMB
Revised -01
  1. plugins_20180729_0147AM_A.PNG
Revised -02

plugins_20180729_0147AM_B.PNG

XPack

Chose to enable the following plugins:

  1. License :- BASIC

XPack_20180729_0148AM.PNG

 

Installing

Installing – 01

Installing_20180729_0149AM.PNG

 

Installing – “Downloading Plugins….”

Installing_Plugins_20180729_0151AM.PNG

Installing – “Downloading Plugins…store-smb”

Installing_Plugins_StoreSMB_20180729_0151AM.PNG

 

Start Elasticsearch Service

startingService_20180729_0152AM.PNG

 

Installed Successful

ElasticSearchInstalledSuccessfully_20180729_0153AM.PNG

Validation

Launch a browser and access the following URL http://localhost:9200

Image

browser_20180729_0154AM.PNG

Explanation

  1. Version
    • number :- 6.3.2
    • Build Date :- 2018-07-20
  2. Lucene Version
    • 7.3.1

 

References

  1. Elastic
    • Installation
      • Elasticsearch Reference [6.3] » Set up Elasticsearch » Installing Elasticsearch » Install Elasticsearch with Windows MSI Installer
        Link
      • Elasticsearch Reference [2.4] » Getting Started » Installation
        Link
    • Artifacts
      • Download ElasticSearch
        Link
    • Plugin
      • Store SMB
        • Store SMB Plugin
          Link
        • Elasticsearch Plugins and Integrations [6.3] » Store Plugins » Store SMB Plugin » Working around a bug in Windows SMB and Java on windows
          Link
  2. Apache.Org
    • Issues
      • Lucene – CoreLUCENE-6176
        • Modify FSIndexOutput in FSDirectory to open output steam for Write and Read
          Link