Giter VIP home page Giter VIP logo

hazelcast-mesos's Introduction


โš ๏ธ REMARK:

Dear community members,

Thanks for your interest in hazelcast-mesos! This project has become a Hazelcast Community project.

Hazelcast Inc. gives this project to the developers community in the hope you can benefit from it. It comes without any maintenance guarantee by the original developers but their goodwill (and time!). We encourage you to use this project however you see fit, including any type of contribution in the form of a pull request or an issue.

Feel free to visit our Slack Community for any help and feedback.


Hazelcast Mesos

This module gives you the ability to deploy Hazelcast on the Mesos cluster.

Warning

This is an early version of Hazelcast Mesos integration. Anything in this project may change without notice and/or break older installations.

Prerequisites

  • A running Mesos cluster to deploy Hazelcast on it. For information on installing and running Apache Mesos, please refer to http://mesos.apache.org/gettingstarted/.
  • Java needs to be installed and configured on the Mesos slaves.

Running Hazelcast Mesos via Command Line

You can deploy Hazelcast on Mesos via command line by running the Hazelcast Scheduler. Please perform the following steps:

  • Download the Hazelcast Mesos package from https://s3.amazonaws.com/hazelcast/mesos/hazelcast-mesos-0.1.tar.gz.
  • Extract the archive:
tar -zxvf hazelcast-mesos-0.1.tar.gz
  • Navigate to hazelcast-mesos-0.1:
cd hazelcast-mesos-0.1
  • Open the start.sh in the text editor and edit the configuration parameters according to your needs:
#!/usr/bin/env bash

export HAZELCAST_VERSION=3.6
export HOST="localhost"
export PORT="8090"
export MESOS_ZK="zk://localhost:2181/mesos"
export MIN_HEAP="1g"
export MAX_HEAP="1g"
export CPU_PER_NODE=1.0
export MEMORY_PER_NODE=1024.0
export NUMBER_OF_NODES=1

java -cp hazelcast-mesos-scheduler.jar HazelcastMain
  • Run the scheduler:
sh start.sh
  • Open the Mesos UI at http://localhost:5050. You should see the Hazelcast tasks with state RUNNING .

The scheduler will pull the Hazelcast binaries from web and distribute it to Mesos slaves and start the Hazelcast nodes. Hazelcast Scheduler will place only one Hazelcast member per Mesos slave.

You can control the cluster size of Hazelcast via the REST API it provides. For example, to scale Hazelcast cluster to 5 nodes, run the following command:

curl -X POST http://localhost:8090/nodes?nodeCount=5

Running Hazelcast Mesos via Marathon

You can deploy Hazelcast on Mesos via Marathon.

For information on installing Marathon, please refer to https://docs.mesosphere.com/getting-started/datacenter/install/.

After you install Marathon, please perform the following steps:

  • Save the following JSON as hazelcast.json:
{
  "id": "/hazelcast",
  "instances": 1,
  "cpus": 1,
  "mem": 1024,
  "ports": [
    0
  ],
  "env": {
    "HAZELCAST_VERSION": "3.6",
    "HOST": "localhost",
    "PORT": "8090",
    "MESOS_ZK": "zk://localhost:2181/mesos",
    "MIN_HEAP": "1g",
    "MAX_HEAP": "1g",
    "CPU_PER_NODE": "1.0",
    "MEMORY_PER_NODE": "1024.0",
    "NUMBER_OF_NODES": "3"
  },
  "cmd": "cd hazelcast-mesos-0.1 && java -cp hazelcast-mesos-scheduler.jar HazelcastMain",
  "uris": [
    "https://s3.amazonaws.com/hazelcast/mesos/hazelcast-mesos-0.1.tar.gz"
  ]
}
  • Initiate a POST request to Marathon REST API:
curl -X POST http://localhost:8080/v2/apps -d @hazelcast.json -H "Content-type: application/json"
  • Open the Marathon UI at http://localhost:8080. You should see the hazelcast application with state Running:

Marathon

  • Open the Mesos UI at http://localhost:5050. You should see the Hazelcast tasks with state RUNNING:

Mesos

  • Click the Sandbox link to see the working directory of task:

Sandbox

  • You can have a look at the logs of Hazelcast by clicking on the hazelcast.log or hazelcast.err.log links.

Logs

Configuration

You can pass environment variables to configure Hazelcast Mesos integration. You can pass those environment variables either in the Marathon recipe or in the start.sh.

Variable Name Default Value Description
HAZELCAST_VERSION 3.6 To be deployed distribution version of hazelcast.
HOST localhost Internal web server host which Hazelcast Scheduler uses for file distribution to Mesos Slaves.
PORT 8090 Internal web server port which Hazelcast Scheduler uses for file distribution to Mesos Slaves.
MESOS_ZK zk://localhost:2181/mesos ZooKeeper address which Mesos Master uses for coordination
MIN_HEAP 1g Java minimum heap size for the JVM which Hazelcast instance lives on the Mesos Slave.
MAX_HEAP 1g Java maximum heap size for the JVM which Hazelcast instance lives on the Mesos Slave.
CPU_PER_NODE 1.0 Number of CPU units to be used for each Hazelcast instance deployment on the Mesos Slaves.
MEMORY_PER_NODE 1024.0 Amount of Memory units to be used for each Hazelcast instance deployment on the Mesos Slaves.
NUMBER_OF_NODES 1 Size of the Hazelcast cluster.

hazelcast-mesos's People

Contributors

aslanbakirov avatar burakcelebi avatar eminn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hazelcast-mesos's Issues

Provide Java installation on slaves

Mesos slaves should pull the Java binary either from the scheduler file server or the web and install it for the ease of the user experience

Failed to start Grizzly HTTP server

I'm getting the following error using the folowing versions:

Mesos 0.27.1
Marahton 1.1.1

Exception in thread "main" javax.ws.rs.ProcessingException: Failed to start Grizzly HTTP server: Cannot assign requested address
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:302)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:119)
    at HazelcastMain.initializeHttpServer(HazelcastMain.java:41)
    at HazelcastMain.main(HazelcastMain.java:25)
Caused by: java.net.BindException: Cannot assign requested address
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:132)
    at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:88)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:236)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:216)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:207)
    at org.glassfish.grizzly.http.server.NetworkListener.start(NetworkListener.java:680)
    at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:278)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:299)
    ... 3 more

A hazelcast node join to claster

The hazelcst framework contain archive with hazelcast-mesos-0.1 which contains:

mode	nlink	uid	gid	size	mtime		
-rw-r--r--	1	root	root	8 MB	Nov 30 20:17	 hazelcast-3.6.jar	 Download
-rw-r--r--	1	501	games	1 MB	Apr 12 12:05	 hazelcast-mesos-executor.jar	 Download
-rw-r--r--	1	501	games	11 MB	Apr 12 12:05	 hazelcast-mesos-scheduler.jar	 Download
-rw-r--r--	1	501	games	6 MB	Apr 12 12:05	 hazelcast-zookeeper.jar	 Download
-rw-r--r--	1	501	games	3 KB	Apr 12 12:05	 hazelcast.xml	 Download
-rw-r--r--	1	501	games	11 KB	Feb 26 16:11	 LICENSE	 Download
-rw-r--r--	1	501	games	551 B	Apr 07 15:47	 marathon.json	 Download
-rw-r--r--	1	501	games	4 KB	Apr 12 12:04	 README.md	 Download
-rw-r--r--	1	501	games	312 B	Apr 12 12:05	 start.sh	 Download

In this archive we have all of need to start hazelcast, but if you want to change default values, which are contained in hazelcast.xml you need repack this remote archive.

In my case I need change zookeeper host, cause my host not is localhost. I receive below errors:

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Nov 30, 2016 5:19:31 PM com.hazelcast.cluster.impl.DiscoveryJoiner
SEVERE: [172.17.0.1]:5701 [dev] [3.6] Error while talking to ZooKeeper
java.lang.IllegalStateException: Error while talking to ZooKeeper
	at com.hazelcast.zookeeper.ZookeeperDiscoveryStrategy.discoverNodes(ZookeeperDiscoveryStrategy.java:132)
	at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.discoverNodes(DefaultDiscoveryService.java:74)
	at com.hazelcast.cluster.impl.DiscoveryJoiner.getPossibleAddresses(DiscoveryJoiner.java:42)
	at com.hazelcast.cluster.impl.TcpIpJoiner.joinViaPossibleMembers(TcpIpJoiner.java:126)
	at com.hazelcast.cluster.impl.TcpIpJoiner.doJoin(TcpIpJoiner.java:84)
	at com.hazelcast.cluster.impl.AbstractJoiner.join(AbstractJoiner.java:103)
	at com.hazelcast.instance.Node.join(Node.java:581)
	at com.hazelcast.instance.Node.start(Node.java:339)
	at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:131)
	at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:160)
	at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:143)
	at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:111)
	at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)
	at com.hazelcast.core.server.StartServer.main(StartServer.java:36)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /discovery/hazelcast/hazelcast
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1590)
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl$3.call(GetChildrenBuilderImpl.java:214)
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl$3.call(GetChildrenBuilderImpl.java:203)
	at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:107)
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl.pathInForeground(GetChildrenBuilderImpl.java:200)
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:191)
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:38)
	at org.apache.curator.x.discovery.details.ServiceDiscoveryImpl.queryForInstances(ServiceDiscoveryImpl.java:369)
	at org.apache.curator.x.discovery.details.ServiceDiscoveryImpl.queryForInstances(ServiceDiscoveryImpl.java:293)
	at com.hazelcast.zookeeper.ZookeeperDiscoveryStrategy.discoverNodes(ZookeeperDiscoveryStrategy.java:116)
	... 13 more

Nov 30, 2016 5:19:32 PM com.hazelcast.instance.Node
SEVERE: [172.17.0.1]:5701 [dev] [3.6] Could not join cluster in 300000 ms. Shutting down now!
Nov 30, 2016 5:19:32 PM com.hazelcast.core.LifecycleService
INFO: [172.17.0.1]:5701 [dev] [3.6] Address[172.17.0.1]:5701 is SHUTTING_DOWN
Nov 30, 2016 5:19:32 PM com.hazelcast.instance.Node
WARNING: [172.17.0.1]:5701 [dev] [3.6] Terminating forcefully...

How to pass hazelcast management center url to nodes

I have deployed hazelcast on our mesos cluster and all of the nodes are up and running. I would like to use the hazelcast management center to monitor this deployment. How can I pass in the management center URL into the nodes?

Running hazelcast

Hello
I have a problem with starting hazelcast on mesos.
I used marathon manifest, mesos framework was installed successful but task "start hazelcast node" finish unsuccesfull:

node-f55685d2-f125-4c7f-baa0-e54e44179a56-S3	Hazelcast node	FAILED		2016-11-29T16:01:43+0300	ms2	Sandbox

I have run hazelcast framework on one node, but hazelcast node doesn't know node which are has been running and can't find and download hazelcast-3.6.jar

Mesos log:

I1129 13:23:24.493938  8508 fetcher.cpp:498] Fetcher Info: {"cache_directory":"\/tmp\/mesos\/fetch\/slaves\/f55685d2-f125-4c7f-baa0-e54e44179a56-S3\/root","items":[{"action":"BYPASS_CACHE","uri":{"extract":true,"value":"http:\/\/127.0.0.1:8090\/hazelcast-3.6.jar"}},{"action":"BYPASS_CACHE","uri":{"extract":true,"value":"http:\/\/127.0.0.1:8090\/hazelcast-mesos-executor.jar"}},{"action":"BYPASS_CACHE","uri":{"extract":true,"value":"http:\/\/127.0.0.1:8090\/hazelcast-zookeeper.jar"}},{"action":"BYPASS_CACHE","uri":{"extract":true,"value":"http:\/\/127.0.0.1:8090\/hazelcast.xml"}}],"sandbox_directory":"\/data\/mesos\/slaves\/f55685d2-f125-4c7f-baa0-e54e44179a56-S3\/frameworks\/f55685d2-f125-4c7f-baa0-e54e44179a56-0004\/executors\/HazelcastExecutor - 1480425804392\/runs\/1805f251-4996-44c6-b1e1-3e1dbaf315af","user":"root"}
I1129 13:23:24.496654  8508 fetcher.cpp:409] Fetching URI 'http://127.0.0.1:8090/hazelcast-3.6.jar'
I1129 13:23:24.496672  8508 fetcher.cpp:250] Fetching directly into the sandbox directory
I1129 13:23:24.496695  8508 fetcher.cpp:187] Fetching URI 'http://127.0.0.1:8090/hazelcast-3.6.jar'
I1129 13:23:24.496711  8508 fetcher.cpp:134] Downloading resource from 'http://127.0.0.1:8090/hazelcast-3.6.jar' to '/data/mesos/slaves/f55685d2-f125-4c7f-baa0-e54e44179a56-S3/frameworks/f55685d2-f125-4c7f-baa0-e54e44179a56-0004/executors/HazelcastExecutor - 1480425804392/runs/1805f251-4996-44c6-b1e1-3e1dbaf315af/hazelcast-3.6.jar'
Failed to fetch 'http://localhost:8090/hazelcast-3.6.jar': Error downloading resource: Couldn't connect to server

Failed to fetch http://localhost:8090/hazelcast-3.6.jar: Error downloading resource: Couldn't connect to server

My manifest:

{
  "id": "/hazelcast",
  "cmd": "cd hazelcast-mesos-0.1 && java -cp hazelcast-mesos-scheduler.jar HazelcastMain -Djava.net.preferIPv4Stack=true",
  "cpus": 0.01,
  "mem": 1024,
  "disk": 0,
  "instances": 1,
  "env": {
    "MIN_HEAP": "1g",
    "MEMORY_PER_NODE": "1024.0",
    "HOST": "localhost",
    "CPU_PER_NODE": "1.0",
    "HAZELCAST_VERSION": "3.6",
    "MESOS_ZK": "zk://zk1:2181,zk2:2181,zk3:2181/mesos",
    "NUMBER_OF_NODES": "3",
    "PORT": "8090",
    "MAX_HEAP": "1g"
  },
  "portDefinitions": [
    {
      "port": 10000,
      "protocol": "tcp",
      "labels": {}
    }
  ],
  "uris": [
    "https://s3.amazonaws.com/hazelcast/mesos/hazelcast-mesos-0.1.tar.gz"
  ],
  "fetch": [
    {
      "uri": "https://s3.amazonaws.com/hazelcast/mesos/hazelcast-mesos-0.1.tar.gz",
      "extract": true,
      "executable": false,
      "cache": false
    }
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.