Hazelcast Notes

Install

Docker(2 container)

1
2
3
docker run -d -it -p 5701:5701 -e MANCENTER_URL='http://172.16.18.143:8200/hazelcast-mancenter' -e JAVA_OPTS='-Dhazelcast.local.publicAddress=172.16.18.143:5701 -Dhazelcast.rest.enabled=true' hazelcast/hazelcast:3.12.4

docker run -d -it -p 5702:5701 -e MANCENTER_URL='http://172.16.18.143:8200/hazelcast-mancenter' -e JAVA_OPTS='-Dhazelcast.local.publicAddress=172.16.18.143:5702 -Dhazelcast.rest.enabled=true' hazelcast/hazelcast:3.12.4
  • -Dhazelcast.rest.enabled=true启用 REST API

Management

Docker Run

1
docker run -dit -p 8200:8080 hazelcast/management-center:latest

Visit

1
http://192.168.11.10:8200/hazelcast-mancenter

Client

REST

  • Put Key-Value to Map
1
curl -v -X POST -H "Content-Type: text/plain" -d "bar" http://127.0.0.1:5701/hazelcast/rest/maps/mapName/foo
  • Get Value From Map By Key
1
curl -X GET http://127.0.0.1:5701/hazelcast/rest/maps/mapName/foo