Hazelcast single node fast startup for debugging

£可爱£侵袭症+ 提交于 2019-12-22 05:37:09

问题


I'm writing an app that uses Hazelcast. My app is really slow to start because Hazelcast tries to talk to other nodes on the network on startup. This is fine for production, but when I'm doing single-node debugging it really slows down my edit-compile-run-debug cycle.

Is there a Hazelcast setting that tells it that there's only one node so please start quickly and don't bother pinging the rest of the network?


回答1:


You can disable join methods:

    <join>
        <multicast enabled="false">
        </multicast>
        <tcp-ip enabled="false">
        </tcp-ip>
        <aws enabled="false">
        </aws>
    </join>



回答2:


this will save you at least 3 sec while debugging

System.setProperty("hazelcast.local.localAddress", "127.0.0.1");


来源:https://stackoverflow.com/questions/16487337/hazelcast-single-node-fast-startup-for-debugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!