Babak Mehrabi
Babak Mehrabi

Reputation: 2275

problem on starting cassandra

I download apache-cassandra-0.8.5 for ubuntu and extract it.I read the readme file. I try bellow command in shell:

bin/cassandra -f

But it said: Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: node24.nise.local: node24.nise.local

what should I do?

Upvotes: 28

Views: 32017

Answers (6)

D8Sasi
D8Sasi

Reputation: 79

I faced the Same Issue and it is resolved by following steps.
1.Edit the HostNames File in your Ubuntu system
$ sudo nano /etc/hosts
After this add System name or Your System IP in first Name like following.
127.0.0.1 bflesgwks011
(Or)
127.0.0.1 192.168.15.22
2.Save&Exit the file.
3.Restart the Network by using the command.
$ sudo /etc/init.d/networking restart

I hope it Works.
thanks.

Upvotes: 1

Alok Adhao
Alok Adhao

Reputation: 406

Go to terminal and just run:

$ hostname localhost

(or whatever is your host name)

Upvotes: 5

rodolk
rodolk

Reputation: 5907

In AWS EC2, when you install Cassandra you can have this problem because of the initially configured hostname which is set to ip-x-x-x-x being x-x-x-x the EC2 instance private address. The steps to solve it:

  1. Edit network configuration file /etc/sysconfig/network

    HOSTNAME=[myservername]

  2. Edit hosts file:

    sudo vi /etc/hosts

  3. Add hostname entry to /etc/hosts

    127.0.0.1 [myservername]

  4. Set hostname or reboot

    sudo hostname [myservername]

Upvotes: 4

Dunaril
Dunaril

Reputation: 2795

What does your /etc/hosts file contain? Maybe add localhost and node24.nise.local as a name at the 127.0.0.1 line.

Upvotes: 57

Fizer Khan
Fizer Khan

Reputation: 92735

Add following line in the /etc/hosts file

  127.0.0.1  localhost.localdomain localhost node24.nise.local

Replace node24.nise.local with your host name.

Upvotes: 8

amber_linux
amber_linux

Reputation: 307

Yes. It works once you add domain name in local host entry /etc/hosts

127.0.0.1  testdomain  localhost.localdomain localhost

Upvotes: 16

Related Questions