我在使用resty redis的时候,当connect的时候,如果host是一个映射的域名(/etc/hosts),连接出错?难道resty redis不使用/etc/hosts映射么?有没有什么补救的办法?
--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
我在使用resty redis的时候,当connect的时候,如果host是一个映射的域名(/etc/hosts),连接出错?难道resty redis不使用/etc/hosts映射么?有没有什么补救的办法?
--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
2012/12/18 王博:
> 我在使用resty redis的时候,当connect的时候,如果host是一个映射的域名(/etc/hosts),连接出错?难道resty
> redis不使用/etc/hosts映射么?有没有什么补救的办法?
>
lua-resty-redis 使用的是 ngx_lua 模块的 cosocket API,而 cosocket 又是使用的是 Nginx
核心中自己实现的非阻塞的 DNS resolver(注意,不是系统的 resolver),而这个 DNS resolver 目前尚不支持
/etc/hosts.
我其实一直想给 nginx 核心打一个小补丁,以便加上对 /etc/hosts 文件的支持。在此之前,可以考虑 Kindy
同学的建议,自己搭设轻量级的 DNS(代理)服务器。
Best regards,
-agentzh