Alex
Alex

Reputation: 3381

Error to install cassandra

I had installed the version 1.1 of Cassandra, but after I discovered that the last version of Cassandra is 2.1 and I updated my source list, but I am having error to install Cassandra using apt-get:

Setting up cassandra (2.1.0~rc3) ...
vm.max_map_count = 1048575
net.ipv4.tcp_keepalive_time = 300
Cassandra 2.0 and later require Java 7 or later.
invoke-rc.d: initscript cassandra, action "start" failed.
dpkg: error processing cassandra (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for python-support ...
Errors were encountered while processing:
 cassandra
E: Sub-process /usr/bin/dpkg returned an error code (1)

and now I cant use Cassandra anymore, so, how can I solve this?

java -version:

java version "1.6.0_32"
OpenJDK Runtime Environment (IcedTea6 1.13.4) (6b32-1.13.4-1~deb7u1)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

And,

dpkg -l | grep jre

ii  default-jre                           1:1.6-47                           amd64        Standard Java or Java compatible Runtime
ii  default-jre-headless                  1:1.6-47                           amd64        Standard Java or Java compatible Runtime (headless)
ii  icedtea-6-jre-cacao:amd64             6b32-1.13.4-1~deb7u1               amd64        Alternative JVM for OpenJDK, using Cacao
ii  icedtea-6-jre-jamvm:amd64             6b32-1.13.4-1~deb7u1               amd64        Alternative JVM for OpenJDK, using JamVM
ii  icedtea-7-jre-jamvm:amd64             7u65-2.5.1-2~deb7u1                amd64        Alternative JVM for OpenJDK, using JamVM
ii  openjdk-6-jre:amd64                   6b32-1.13.4-1~deb7u1               amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-6-jre-headless:amd64          6b32-1.13.4-1~deb7u1               amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-6-jre-lib                     6b32-1.13.4-1~deb7u1               all          OpenJDK Java runtime (architecture independent libraries)
ii  openjdk-7-jre:amd64                   7u65-2.5.1-2~deb7u1                amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless:amd64          7u65-2.5.1-2~deb7u1                amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                     7u65-2.5.1-2~deb7u1                all          OpenJDK Java runtime (architecture independent libraries)

Upvotes: 1

Views: 1892

Answers (3)

Srikant Patra
Srikant Patra

Reputation: 415

May be below details will help you.Recommended Version. For Apache Cassandra 2.0.x and 2.1.x, the latest version of the Java SE Runtime Environment (JRE) 7 or 8 is required. The JDK is recommended.

For Apache Cassandra 2.2.x, 3.0.x, and 3.x, the latest version of the Java SE Runtime Environment (JRE) 8 is required. The JDK is recommended.

Upvotes: 0

Aaron
Aaron

Reputation: 57748

My suspicions were tipped-off by this line:

Cassandra 2.0 and later require Java 7 or later.

And your response in the comments confirms it:

java version "1.6.0_32" 
OpenJDK Runtime Environment (IcedTea6 1.13.4) (6b32-1.13.4-1~deb7u1) 
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

You will need to install a JRE of version 1.7 or greater. Also, DataStax does not recommend running the OpenJDK with Cassandra. Download and install version 7 (or later) of Oracle's JRE/JDK. Here is a link to DataStax's documentation on installing the Oracle JRE.

Upvotes: 1

mshuler
mshuler

Reputation: 494

If this was a fresh install and you have no data, try purging the installed cassandra package, first, then just install again:

apt-get remove --purge cassandra
apt-get install cassandra

You will need to re-edit any changes you made to /etc/cassandra/cassandra.yaml as purging a package removes everything, including configurations. During the remove, you might also get a warning that /var/lib/cassandra/data won't be removed because of existing data - after purging, recursively remove /var/lib/cassandra, so that you are really starting over fresh, then re-install.

Upvotes: 1

Related Questions