GithubHelp home page GithubHelp logo

Comments (1)

spodila avatar spodila commented on August 18, 2024

The "SlaveID" value is more ephemeral than the "hostname" field. That is, there could be multiple "slaveId" values for the same physical host, for example when the mesos agent times out its pings and then later reconnects with the master. OTOH, a new host could take on the same hostname as one that was decommissioned before. In practice this is less frequent than changes to slaveId of the same host.

This also affects other aspects in the system. For example, cluster autoscaling. If a new slaveId is treated as a new host, a scale down can trigger on the old slaveId since it does not have any running tasks. The scaling actions implementation you provide will have to remember the slaveId values used for a host name, or use some other similar technique to ensure scale down does not terminate a host that is running tasks with a different slaveId at the moment.

Additional thoughts welcome.

To offer a workaround/hack for you: If your framework does not need to use the cluster autoscaling feature (now or in the future), it is likely that you could always use the slaveId as the hostname when interfacing with Fenzo. That is, you will pass the offer's slaveId as the hostname. From then on, you can use slaveid as the hostname for calls to the taskUnassigner and taskAssigner, for example. I have not tested this though.

For this hack, you will need to use a VMLeaseObject that returns slaveId when asked for hostname. You can use the following sample object to wrap the offers that are input into Fenzo.

import com.netflix.fenzo.plugins.VMLeaseObject;
import org.apache.mesos.Protos;

public class MyVMLeaseObject extends VMLeaseObject {

    private final String slaveId;

    public MyVMLeaseObject(Protos.Offer offer) {
        super(offer);
        this.slaveId = offer.getSlaveId().getValue();
    }

    @Override
    public String hostname() {
        return slaveId;
    }
}

from fenzo.

Related Issues (20)

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.