eclipse远程连接hbase错误

来源:互联网 发布:汕头澄海有淘宝代运营 编辑:程序博客网 时间:2024/04/30 08:36

java.net.ConnectException: Connection refused: no further information

java.net.UnknownHostException: unknown host: iZ25yj2xxi1Z

解决办法:查看linux主机名字  hostname知linux主机名字为iZ25yj2xxi1Z

修改win7 C:\Windows\System32\drivers\etc下hosts文件,添加xx.xx.xx.xx  iZ25yj2xxi1Z #linux的ip和对应的主机名

又出现错误

java.net.ConnectException: Connection refused: no further information 
org.apache.hadoop.hbase.ipc.HBaseClient$FailedServerException: This server is in the failed servers list: iZ25yj2xxi1Z /xxxxx:60000

查看linux进程 netstat -nlp | grep java

发现60000端口的ip并不是linux主机的ip(我在hbase-site.xml里面配置的hbase.master为主机ip:60000)

查看/etc/hosts文件发现iZ25yj2xxi1Z对应ip并非本机IP,将其更改为本机ip

重启hbase发现bin/stop-hbase.sh无法停止,可能是因为修改了什么文件的缘故,强制将其停止,jps查看hbase对应几个进程的进程号(HMaster,HQuorumPeer,HRegionServer),kill -9 xx

重新尝试连接,成功

感觉hostname太难看,想修改hostname

查看用hostname命令

1,暂时修改使用hostname new_name

2,需重启的修改在/etc/hostname里面修改成new_name

两者结合即可永久修改

重启network   /etc/init.d/networking restart


远程ubuntu连接服务器,两端都需下载ssh,命令  apt-get install openssh-clientopenssh-server

/etc/init.d/ssh start启动ssh,停止和重启命令是/etc/init.d/ssh stop , /etc/init.d/ssh restart

ssh的配置文件位于/etc/ssh/sshd_config  修改完了记得重启一下sshd服务才能生效

---------------------------------------------------------

设置完后,可以用一下命令来访问,

通过IP访问:sshusername@192.168.1.112 

通过域名访问:ssh username@xxx.com

其中,username为192.168.1.112/xxx.com 机器上的用户,

之后会提示你输入密码,密码输入正确后,登录成功。






0 0