看懂上面的图就好了
当有连接使用SCAN ip访问数据库时,scan listener会将连接转发到local listener上。
这样一来,客户段就只需要知道scan ip就行了,至于后面有多少台节点的listener就不管了
Client should connect to the SCAN name -> scan listener, scan listener will redirect the connection(sometimes beneath) to the node VIP, and all succeeding procedures are same with the previous versions.
至于为什么需要在dns里注册三个,主要是为了尽量提高可用性。
当节点数大于3时,最多也只会有3个SCAN listener,也就是说有的节点上没有scan listener.
如果使用/etc/hosts文件解析scan ip,因为不能做轮训的负载均衡,所以这时候scan ip就只能有一个了。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10037372/viewspace-717466/ ,如需转载,请注明出处,否则将追究法律责任。