Unable to access Cassandra NoSQL DB after installation - cassandra

I installed Cassandra stable version in My Ubuntu 20.04. Java JDK 11 is my default version.
When I run the below code I am getting the following error.
(base) vijee#vijee-Lenovo-IdeaPad-S510p:~$ sudo nodetool status
ERROR 13:18:40,031 Cannot initialize un-mmaper. (Are you using a non-Oracle JVM?) Compacted data files will not be removed promptly. Consider using an Oracle JVM or using standard disk access mode
java.lang.NoSuchMethodError: 'sun.misc.Cleaner sun.nio.ch.DirectBuffer.cleaner()'
at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:75) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56) ~[apache-cassandra-3.11.9.jar:3.11.9]
error: null
-- StackTrace --
java.lang.NullPointerException
at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1975)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:81)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56)
I have Below Java versions available in my system.
(base) vijee#vijee-Lenovo-IdeaPad-S510p:~/Downloads/youtubevideos$ sudo update-alternatives --config java
There are 2 choices for alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
I know Cassandra will support only JDK 8. In some blogs, they say we can assign Java 8 as JAVA_HOME for Cassandra. Where should I do the change of JAVA_HOME for Cassandra?
Already in .bashrc I have set JAVA_HOME as JDK 8 for Hadoop installation.
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH="$PATH:$JAVA_HOME/bin"
export PATH="/home/vijee/anaconda3/bin:$PATH"
export HADOOP_HOME=/home/vijee/hadoop-2.7.7
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH="$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin"
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native"
In the blog, everybody gave different solutions? I am largely confused with that.
What changes should I do to access Cassandra? or
Can I install Cassandra 4(beta)?

I encountered the same issue in Ubuntu 20.04 with Debian installation of Cassandra 3.11. Here's my environment path settings:
I resolved it by setting my default JVM to Java 8 via sudo update-alternatives. Then after I executed sudo systemctl restart cassandra, I was able to connect successfully.
If you will check the content of cassandra-env.sh, looks like it's pointing to the JVM version returned by java -version. So if it returns version 11, your Cassandra won't run.

install guide for ubuntu18 guide
os: ubuntu18
after install Cassandra 3.11 by apt, then exec
nodetool status
ERROR 14:58:47,350 Cannot initialize un-mmaper. (Are you using a non-Oracle JVM?) Compacted data files will not be removed promptly. Consider using an Oracle JVM or using standard disk access mode
java.lang.NoSuchMethodError: 'sun.misc.Cleaner sun.nio.ch.DirectBuffer.cleaner()'
at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:75)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56)
error: null
-- StackTrace --
java.lang.NullPointerException
at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:2001)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:81)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56)
Fix steps
sudo apt install openjdk-8-jdk
sudo update-alternatives --config java
input Selection Number
like
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
java -version
openjdk version "1.8.0_312" ...
sudo systemctl restart cassandra
nodetool status

Assuming Cassandra is already running, check two files:
CASSANDRA_HOME/bin/nodetool
CASSANDRA_HOME/conf/cassandra-env.sh
Check out the program flow from within nodetool. I think it checks whether or not a JAVA_HOME is defined before pulling in vars from cassandra-env.sh.
And you can certainly try Cassandra 4, which should work just fine with Java 11. Just be aware that it is in beta.

Related

how can I fix this Cassandra-related issue when I run the command: $ nodetool status [duplicate]

I installed Cassandra stable version in My Ubuntu 20.04. Java JDK 11 is my default version.
When I run the below code I am getting the following error.
(base) vijee#vijee-Lenovo-IdeaPad-S510p:~$ sudo nodetool status
ERROR 13:18:40,031 Cannot initialize un-mmaper. (Are you using a non-Oracle JVM?) Compacted data files will not be removed promptly. Consider using an Oracle JVM or using standard disk access mode
java.lang.NoSuchMethodError: 'sun.misc.Cleaner sun.nio.ch.DirectBuffer.cleaner()'
at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:75) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184) ~[apache-cassandra-3.11.9.jar:3.11.9]
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56) ~[apache-cassandra-3.11.9.jar:3.11.9]
error: null
-- StackTrace --
java.lang.NullPointerException
at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1975)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:81)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56)
I have Below Java versions available in my system.
(base) vijee#vijee-Lenovo-IdeaPad-S510p:~/Downloads/youtubevideos$ sudo update-alternatives --config java
There are 2 choices for alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
I know Cassandra will support only JDK 8. In some blogs, they say we can assign Java 8 as JAVA_HOME for Cassandra. Where should I do the change of JAVA_HOME for Cassandra?
Already in .bashrc I have set JAVA_HOME as JDK 8 for Hadoop installation.
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH="$PATH:$JAVA_HOME/bin"
export PATH="/home/vijee/anaconda3/bin:$PATH"
export HADOOP_HOME=/home/vijee/hadoop-2.7.7
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH="$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin"
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native"
In the blog, everybody gave different solutions? I am largely confused with that.
What changes should I do to access Cassandra? or
Can I install Cassandra 4(beta)?
I encountered the same issue in Ubuntu 20.04 with Debian installation of Cassandra 3.11. Here's my environment path settings:
I resolved it by setting my default JVM to Java 8 via sudo update-alternatives. Then after I executed sudo systemctl restart cassandra, I was able to connect successfully.
If you will check the content of cassandra-env.sh, looks like it's pointing to the JVM version returned by java -version. So if it returns version 11, your Cassandra won't run.
install guide for ubuntu18 guide
os: ubuntu18
after install Cassandra 3.11 by apt, then exec
nodetool status
ERROR 14:58:47,350 Cannot initialize un-mmaper. (Are you using a non-Oracle JVM?) Compacted data files will not be removed promptly. Consider using an Oracle JVM or using standard disk access mode
java.lang.NoSuchMethodError: 'sun.misc.Cleaner sun.nio.ch.DirectBuffer.cleaner()'
at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:75)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56)
error: null
-- StackTrace --
java.lang.NullPointerException
at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:2001)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:81)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:880)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:216)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:184)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:56)
Fix steps
sudo apt install openjdk-8-jdk
sudo update-alternatives --config java
input Selection Number
like
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
java -version
openjdk version "1.8.0_312" ...
sudo systemctl restart cassandra
nodetool status
Assuming Cassandra is already running, check two files:
CASSANDRA_HOME/bin/nodetool
CASSANDRA_HOME/conf/cassandra-env.sh
Check out the program flow from within nodetool. I think it checks whether or not a JAVA_HOME is defined before pulling in vars from cassandra-env.sh.
And you can certainly try Cassandra 4, which should work just fine with Java 11. Just be aware that it is in beta.

Oracle database installer in linux [INS-10102] Installer initialization failed

i am trying to install oracle database in red hat enterprise linux
and once i run the installer using:
[oracle#linux database]$ ./runInstaller
the OUI shows the message:
[INS-10102] Installer initialization failed.
Cause - An unexpected error occurred while initializing the Installer.
Action - Contact Oracle Support Services or refer logs Summary
 - [INS-10012] Setup driver initialization failed.  
- no oraInstaller in java.library.path
the log file shows this
ID: oracle.install.commons.util.exception.AbstractErrorAdvisor:8
oracle.install.commons.base.driver.common.InstallerException: [INS-10102] Installer initialization failed.
at oracle.install.commons.base.driver.common.Installer.run(Installer.java:534)
at oracle.install.ivw.common.util.OracleInstaller.run(OracleInstaller.java:133)
at oracle.install.ivw.db.driver.DBInstaller.run(DBInstaller.java:139)
at oracle.install.commons.util.Application.startup(Application.java:1072)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:198)
at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:566)
at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:127)
at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:165)
Caused by: oracle.install.commons.base.driver.common.SetupDriverException: [INS-10012] Setup driver initialization failed.
at oracle.install.driver.oui.OUIInstallDriver.load(OUIInstallDriver.java:431)
at oracle.install.ivw.db.driver.DBSetupDriver.load(DBSetupDriver.java:289)
at oracle.install.commons.base.driver.common.Installer.run(Installer.java:516)
... 8 more
Caused by: java.lang.UnsatisfiedLinkError: no oraInstaller in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:380)
at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:128)
at oracle.sysman.oii.oiic.OiicPullSession.createDuplicateStreamsForLog(OiicPullSession.java:5382)
at oracle.sysman.oii.oiic.OiicPullSession.createDuplicateStreams(OiicPullSession.java:5482)
at oracle.sysman.oii.oiic.OiicAPIInstaller.initInstallEnvironment(OiicAPIInstaller.java:506)
at oracle.install.driver.oui.OUIInstallDriver.load(OUIInstallDriver.java:422)
... 10 more
here is a Screen shot for the error
the problem is solved by installing libnsl.so.1 using :
#dnf install libnsl
i did understand the issue using this site :
https://javarevisited.blogspot.com/2012/03/javalangunsatisfiedlinkerror-no-dll-in.html#axzz5hSglKlPs
I had same problem, In Centos 8 minimial version and Oracle 12c binaries I tried install libnsl package using following yum command:
yum install libnsl
NOTE: during my search I found simplified way in installation Oracle dependencies. According to this link its highly recommended to use oracle pre request installation package in by using following command (in centos):
yum install oracle-rdbms-server-<your-oracle-version>-preinstall
this package helps DBA to install all dependencies before start oracle installation proccess.
I think you try to install oracle DB server in newer version of OS. It fails to perform prerequisite checks on that system. simply hit the command..
root# yum install libnsl*

Cassandra nodetool java.lang.NullPointerException

When I run the command $ nodetool help I get the following error;
java.lang.NullPointerException
at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1877)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:62)
at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:79)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:807)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:199)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:167)
Please let me know if anyone has any tips.
I've got the same error.
I suggest you too use java 7 or 8 (not tested 7), and not java 9 or 10.
$ java -version # java 8
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
$ java --version # java 9
java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
$ nodetool # java 9
error: null
-- StackTrace --
java.lang.NullPointerException
at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1881)
at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:82)
at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:79)
at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:788)
at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:200)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:168)
I assume cassandra code try to parse java version somewhere and don't handle lastest java versions
I could solve it on Ubuntu 18.4 by downgrading the default java version version:
sudo update-alternatives --config java
The output should look like:
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
Now just choose java version 8. You can try if everything worked with java -version.
I got the very same error, but you can workaround it with specifiing the config explictely:
JAVA_HOME="/opt/java/my-java"
PATH="$JAVA_HOME/bin:$PATH"
# run the node tool
CASSANDRA_CONF=/path/tocassandra/conf.d \
JAVA_TOOL_OPTIONS= \
JAVA_HOME=/opt/java/my-java \
./bin/nodetool status
HTH
If you want to run help command then move to the bin directory of Cassandra, then run following command -
./nodetool help

Cassandra Not Starting Up

[root#PPWFMD509 bin]# ./cassandra -f
Unrecognized VM option 'StringTableSize=1000003'
Could not create the Java virtual machine.
running on jdk1.6_11 version.
If it is Cassandra 2 then it needs JDK 1.7.

OpenProj JAVA_EXE error on Linux

I have installed openproj_1.4-2.deb on my ubuntu. and I'm getting the following err while openinig the same.
Your Java vendor is "Oracle Corporation". To run OpenProj, you need the Sun Java implementation.
The auto-detected Java Runtime used is..
I have tried to fix by editing $HOME/.openproj/run.conf file by updating JAVA_EXE variable. But it is not working.
How can I run openproj on my Linux?
Please help, Thanks in advance.
(sorry for unable to create a new tag, openproj)
Open $HOME/.openproj/run.conf and Change
JAVA_OPTS="-Xms128m -Xmx768m"
To
JAVA_OPTS="-Djava.vendor=Sun -Xms128m -Xmx768m"
then run it, It will work fine.
I'm able to fix this by adding -Djava.vendor="Sun Microsystems Inc." for java command in run_openproj() of /usr/bin/openproj script.
here is the updated function after my change:
run_openproj() {
if [ "$LOG_LEVEL" ] && [ "x$LOG_LEVEL" = "xDEBUG" ]; then
"$JAVA_EXE" $JAVA_OPTS -Djava.vendor="Sun Microsystems Inc." -jar "$OPENPROJ_HOME/openproj.jar" $ARGS > "$LOG_FILE"
else
"$JAVA_EXE" $JAVA_OPTS -Djava.vendor="Sun Microsystems Inc." -jar "$OPENPROJ_HOME/openproj.jar" $ARGS > /dev/null 2>&1
fi
}
I solved it by installing IBM java version. Note the installation directory, by default it is: /opt/ibm/java-x86_64-80/.
Once IBM java is installed it should be configured to be used by OpenProj.
In order to do that run the following command (maybe the installation path should be updated, this is: /opt/ibm/java-x86_64-80/jre/bin/java):
sudo update-alternatives --install /usr/bin/java java /opt/ibm/java-x86_64-80/jre/bin/java 20000
Now check that the configuration has been saved properly, else set it manually with:
sudo update-alternatives --config java
Now check java version with:
java -version
You should get something similar to this:
java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 8.0.7.20 - pxa6480sr7fp20-20221020_01(SR7 FP20))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20220929_37824 (JIT enabled, AOT enabled)
OpenJ9 - 02180fe
OMR - 48fc32a
IBM - bf759bf)
JCL - 20220922_01 based on Oracle jdk8u351-b10
Now, OpenProj can be executed properly.
If it fails again you may delete the configuration file:
rm ~/.openproj/run.conf

Resources