生产环境发现有接口调不通,而且集中在两个节点,其他节点都没问题。抓取日志发现报错如下:
Context initialization failed.
org.springframework. beans.factory.BeanCreationException: Error creating bean with name 'datasourse' defined in file [applicationContext-datasourse.xml]: Invocation of initial method failed; nested exception is javax.naming.NamingException: Cannot create PoolableConnectionFactory(Got mins from a read call)
...
很明显数据库连接出错了,后面排查发现是这两个节点的ip地址没有在sqlnet.ora中配置数据库白名单而导致连接失败,需要在该文件中添加类似如下内容:
TCP.INVITED_NODES=(192.168.1.1,192.168.1.2)