conf/cassandra-env.sh: line 91: /opt/jre/bin/java: not found
bash-4.3# which java
/opt/jre/bin/bundled/java
vi Dockerfile
RUN sed -i 's/\"$JAVA_HOME\"\/bin\/java/\"$JAVA_HOME\"\/bin\/bundled\/java/g' /opt/cassandra/bin/cassandra
/opt/cassandra/bin/cassandra
./cassandra: line 165: getopt: not found
vi /opt/cassandra/bin/cassandra
#args=`getopt vfhp:bD:H:E: "$@"`
#eval set -- "$args"
classname="org.apache.cassandra.service.CassandraDaemon"
#while true; do
.
.
.
foreground="yes"
properties="-XX:ErrorFile=/etc/cassandra -XX:HeapDumpPath=/etc/cassandra"
launch_service "$foreground" "$properties" "$classname"
/opt/cassandra/bin/cassandra
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 8380219392 bytes for committing reserved memory.
modify cassandra-env.sh
add
MAX_HEAP_SIZE=1000M
before
JVM_OPTS="$JVM_OPTS -Xms${MAX_HEAP_SIZE}"
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: cassandra-host: cassandra-host
import java.net.Inet4Address;
import java.net.UnknownHostException;
public class Test {
public static void main(String[] args) throws UnknownHostException {
System.setProperty("java.net.preferIPv4Stack" , "true");
System.out.println(Inet4Address.getLocalHost());
}
}
bash-4.3# java Test
Exception in thread "main" java.net.UnknownHostException: 30b91803e12d: 30b91803e12d
at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
at Test.main(Test.java:8)
Caused by: java.net.UnknownHostException: 30b91803e12d
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
... 1 more
following libs were lost in jre/lib
+libnss_dns-2.19.so
+libnss_files-2.19.so
libnss_dns.so.2