Reputation: 2275
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
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
Reputation: 406
Go to terminal and just run:
$ hostname localhost
(or whatever is your host name)
Upvotes: 5
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:
Edit network configuration file /etc/sysconfig/network
HOSTNAME=[myservername]
Edit hosts file:
sudo vi /etc/hosts
Add hostname entry to /etc/hosts
127.0.0.1 [myservername]
Set hostname or reboot
sudo hostname [myservername]
Upvotes: 4
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
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
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