https://github.com/jyothsnasrinivas/eta-hazelcast
Hazelcast example in Eta
https://github.com/jyothsnasrinivas/eta-hazelcast
distributed-systems eta haskell hazelcast
Last synced: about 1 month ago
JSON representation
Hazelcast example in Eta
- Host: GitHub
- URL: https://github.com/jyothsnasrinivas/eta-hazelcast
- Owner: Jyothsnasrinivas
- License: bsd-3-clause
- Created: 2018-08-22T18:23:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T13:49:49.000Z (over 6 years ago)
- Last Synced: 2025-02-03T18:55:32.984Z (3 months ago)
- Topics: distributed-systems, eta, haskell, hazelcast
- Language: Haskell
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
Hazelcast example in Eta
**Note that this example is not using the [Direct Java Interop](https://github.com/typelead/eta/issues/647) feature and I've manually written the FFI imports for now. A better example is yet to come ;)**
[Hazelcast](https://hazelcast.org/) is a distributed data system that supports high scalability and data distribution in a clustered environment.
In this example we will create a cluster member, distributed Map to share Map data among the cluster nodes and create a client to connect and query data in the cluster.
**Maven Dependencies**
The maven dependencies for Hazelcast Cluster Member and Hazelcast Java Client are added in the `eta-hazelcast.cabal` file.
```cabal
maven-depends: com.hazelcast:hazelcast:3.10
...
maven-depends: com.hazelcast:hazelcast:3.10, com.hazelcast:hazelcast-client:3.10```
## Running the server
1) Fire up the terminal and enter the commands:
```
$ git clone https://github.com/Jyothsnasrinivas/eta-hazelcast.git
$ cd eta-hazelcast
$ etlas run hazelcast-server
```2) When we start the `hazelcast-server` application, we can see the flowing text in the console.
```bash
Members {size:1, ver:1} [
Member [192.168.0.104]:5701 - 564aa798-70a8-48d8-8ef9-c0590adb853b this
]
```3) To create multiple nodes we can start the multiple instances of `hazelcast-server`. That means open up another terminal instance and run the command `etlas run hazelcast-server` simultaneously with the first instance. You will notice the following log in the console.
```bash
Members {size:2, ver:2} [
Member [192.168.0.104]:5701 - 564aa798-70a8-48d8-8ef9-c0590adb853b this
Member [192.168.0.104]:5702 - e2d32f12-b7af-4991-8c9d-3b8f85f197a9
]
```## Running the client
1) Fire up another terminal instance and enter the command.
```
$ etlas run hazelcast-client
```2) You can try few more instances to see Hazelcast work.
**Credits**
This example is inspired from the [Hazelcast tutorial](https://github.com/eugenp/tutorials/tree/master/hazelcast) by [Eugen](https://github.com/eugenp).