28

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?

Babak Mehrabi
  • 2,155
  • 4
  • 23
  • 24

6 Answers6

57

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

Raedwald
  • 46,613
  • 43
  • 151
  • 237
Dunaril
  • 2,757
  • 5
  • 31
  • 53
16

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

127.0.0.1  testdomain  localhost.localdomain localhost
j0k
  • 22,600
  • 28
  • 79
  • 90
amber_linux
  • 197
  • 1
  • 3
8

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.

Fizer Khan
  • 88,237
  • 28
  • 143
  • 153
5

Go to terminal and just run:

$ hostname localhost

(or whatever is your host name)

GBF_Gabriel
  • 2,636
  • 2
  • 17
  • 15
Alok Adhao
  • 447
  • 5
  • 6
4

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]

Aaron
  • 55,518
  • 11
  • 116
  • 132
rodolk
  • 5,606
  • 3
  • 28
  • 34
  • thanks! I met this issue in MAC, and I followed the 4th : `sudo scutil --set HostName localhost` – Eddy Apr 13 '17 at 10:12
1

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.

D8Sasi
  • 79
  • 6