neo4j-contrib / neo4j-helm

Helm Charts for running Neo4j on Kubernetes [DEPRECATED]
https://neo4j-contrib.github.io/neo4j-helm/user-guide/USER-GUIDE.html
Apache License 2.0
88 stars 81 forks source link

suppress jvm startup message in memrec #216

Closed dullaertd closed 3 years ago

dullaertd commented 3 years ago

The first line outputted by the script /var/lib/neo4j/bin/neo4j-admin memrec is a startup message from the JVM itself like:

Selecting JVM - Version:11.0.12, Name:OpenJDK 64-Bit Server VM, Vendor:Oracle Corporation

This interferes with the subsequent for loop in the init-script, as it will try to set all of these strings as a NEO4J_ env variable. The init script is still functional, but the error messages are confusing and are polluting the log files:

Calling neo4j-admin memrec to suggest memory settings:
Selecting
JVM
-
Version:11.0.12,
Name:OpenJDK
64-Bit
Server
VM,
Vendor:Oracle
Corporation
dbms.memory.heap.initial_size=4600m
dbms.memory.heap.max_size=4600m
dbms.memory.pagecache.size=4g
dbms.jvm.additional=-XX:+ExitOnOutOfMemoryError
/var/lib/neo4j/conf/memory-recommendations.sh: line 4: export: `NEO4J_-': not a valid identifier
/var/lib/neo4j/conf/memory-recommendations.sh: line 5: export: `NEO4J_Version:11_0_12,': not a valid identifier
/var/lib/neo4j/conf/memory-recommendations.sh: line 6: export: `NEO4J_Name:OpenJDK': not a valid identifier
/var/lib/neo4j/conf/memory-recommendations.sh: line 7: export: `NEO4J_64-Bit': not a valid identifier
/var/lib/neo4j/conf/memory-recommendations.sh: line 9: export: `NEO4J_VM,': not a valid identifier
/var/lib/neo4j/conf/memory-recommendations.sh: line 10: export: `NEO4J_Vendor:Oracle': not a valid identifier

Added an additional grep statement to excluded any lines starting with Selecting JVM, to overcome this issue.