1 現象
使用vearch 配置集羣的時候報錯:None of the masters has the same ip address as current local master server’s ip
2原因
由於是在docker中啓動,所以:“容器與宿主機”以及“容器與局域網內其他機器” 直接通訊默認是關閉的。
3 解決辦法
所以,如過想要通過docker運行,就必須加上這個參數:–net=host 來把容器與宿主機的網絡直接等同 ;而且加上這個參數後,就不用-p 映射端口了
nohup docker run --net=host -v $PWD/config2master.toml:/vearch/config.toml vearch:0.2 all &
最後,打開瀏覽器訪問 http://127.0.0.1:8817/_cluster/stats 驗證。
參考:《https://github.com/vearch/vearch/issues/46》 https://github.com/vearch/vearch/issues/46