# /etc/hosts
127.0.0.1 localhost myhostname
::1 localhost
这种情况下,
inet:gethostname(). = myhostname
inet_db:gethostname(). = localhost
但是我看了 inet_db:set_hostname 源码,db 的 hostname 也是通过 inet_config 模块调用 inet:get_hostname 实现的,后面我手动调用得到的值也是 myhostname ,并非 localhost
----------------
然后只要我把 /etc/hosts 文件改成
127.0.0.1 localhost
::1 localhost
结果就是对的了:
inet:gethostname(). = myhostname
inet_db:gethostname(). = myhostname
实在是困惑,请各位大佬解惑。十分感谢!
127.0.0.1 localhost myhostname
::1 localhost
这种情况下,
inet:gethostname(). = myhostname
inet_db:gethostname(). = localhost
但是我看了 inet_db:set_hostname 源码,db 的 hostname 也是通过 inet_config 模块调用 inet:get_hostname 实现的,后面我手动调用得到的值也是 myhostname ,并非 localhost
----------------
然后只要我把 /etc/hosts 文件改成
127.0.0.1 localhost
::1 localhost
结果就是对的了:
inet:gethostname(). = myhostname
inet_db:gethostname(). = myhostname
实在是困惑,请各位大佬解惑。十分感谢!