解决C3P0在Linux下Failed to get local InetAddress for VMID问题
来源:互联网 发布:图片缩小软件 编辑:程序博客网 时间:2024/06/13 19:48
昨天部署两台机器,同时连接的数据库是第三台机器,其中一台生产机运行是发生异常:
报错代码:
Failed to get local InetAddress for VMID. This is unlikely to matter.
At all. We’ll add some extra randomness java.net.UnknownHostException:
p2p-8-41: p2p-8-41
源码大概是这段:
public final class C3P0ImplUtils {try{ dos.write( InetAddress.getLocalHost().getAddress() ); }catch (Exception e) { if (logger.isLoggable(MLevel.INFO)) logger.log(MLevel.INFO, "Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomness", e); dos.write( srand.nextInt() );}}
那么:p2p-8-41是怎么得来的呢?
[root@p2p-8-41 ~]# cat /etc/sysconfig/networkNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=p2p-8-41
很明确了吧!
解决办法:
搜索谷歌和百度,整合一些资料:
主要是因为系统没有找到主机名p2p-8-41对应的IP,修改Linux的hosts文件即可。具体操作步骤如下:
vi /etc/hosts
在行127.0.0.1 localhost localhost.localdomain 后加上 p2p-8-41保存即可。
Linux查找域名时通常指先查找文件/etc/hosts,找不到时再向DNS服务器请求。
127.0.0.1 localhost.localdomain localhost p2p-8-41
原因分析:
Linux于host相关的几个文件如下:
/etc/host.conf
功能:指定主机名查找方法,通常指先查找文件/etc/hosts,找不到时再向DNS服务器请求。
对于大多数用户不用改动此文件内容。
Linux: /etc/host.conf文件内容
order hosts, bind
multi on
/etc/resolv.conf
文件功能:DNS客户机配置文件,设置DNS服务器的IP地址及DNS域名
相关文件:/etc/host.conf
文件格式:
domainname 域名
search 域名
nameserver Primary_DNS_Server_IP_address
nameserver Second_DNS_Server_IP_address
其中domainname和search可同时存在,也可只有一个;nameserver可指定多个
/etc/hosts
/etc/hosts
文件格式: IPaddress hostname aliases
文件功能: 提供主机名到IP地址的对应关系,建议将自己经常使用的主机
加入此文件中,也可将没有DNS记录的机器加入到此文件中,
这样会方便网络应用
- 解决C3P0在Linux下Failed to get local InetAddress for VMID问题
- 解决C3P0在Linux下Failed to get local InetAddress for VMID问题
- 解决C3P0在Linux下Failed to get local InetAddress for VMID问题
- 解决C3P0在Linux下Failed to get local InetAddress for VMID问题
- 解决C3P0在Linux下Failed to get local InetAddress for VMID
- C3P0在Linux下的Failed to get local InetAddress for VMID解决方法
- Linux环境下C3P0 Failed to get local InetAddress for VMID 解决办法
- Failed to get local InetAddress for VMID
- 解决 Memcached 的 failed to get SockIO obj for...错误
- 解决 Linux下oracle导入(imp)导出(exp)出现"failed to open ...for reader/wirte" 错误
- #解决linux下C3P0数据源UnknownHostException的问题
- Failed to get local hostname java.net.UnknownHostException
- Failed to get local hostname java.net.UnknownHostException
- failed to get the task for process
- 解决error launching remote program failed to get the task for process
- XCode4.5免证书真机调试解决 failed to get the task for process xxx
- Ubuntu执行sudo apt-get update出现Failed to fetch.......的问题的解决
- 解决Eclipse出现failed to get the required adt version from sdkversion问题的方法
- Python3 类包装实现多线程
- 注解@PostConstruct与@PreDestroy详解及实例
- 第三章 授权——跟我学习springmvc shiro mybatis
- Google play内购 Iab
- python2.7基于selenium的web自动化测试项目--customer
- 解决C3P0在Linux下Failed to get local InetAddress for VMID问题
- Word2vec基础介绍(四):CBOW和skip-gram模型
- 机器学习之:决策树(Decision Tree)
- 【修真院“善良”系列之十七】请拿好这支时间之箭
- 水題
- Android SDK platforms build-tools等镜像下载
- struts2_part01
- 关于安装TortoiseSVN. msi 报错 2503 2502错误
- mysql 导入导出数据库