---
title: Configuring resource offers on Mesos
description: The other day I was working on Mesos Elasticsearch and encountered a problem while running the framework. The framework did not accept any offers from slaves because I had not properly configured the resources.
image: http://cdn2.hubspot.net/hubfs/2668666/All-InOne-2016/Image/bg-img.jpg
---

Check out our **[Cloud Native Services](https://www.container-solutions.com/services) **and** **book a call with one of our experts today! 

[![Container Solutions](https://blog.container-solutions.com/hubfs/CS_blog/logo-main.svg "Container Solutions")](http://container-solutions.com)

- share:
- [**](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fblog.container-solutions.com%2Fconfiguring-resource-offers-on-mesos)
- [**](https://www.twitter.com/share?url=https%3A%2F%2Fblog.container-solutions.com%2Fconfiguring-resource-offers-on-mesos)
- [**](http://www.linkedin.com/shareArticle?mini=true&url=https://blog.container-solutions.com/configuring-resource-offers-on-mesos)
- [**](https://blog.container-solutions.com/configuring-resource-offers-on-mesos#)

[![](http://cdn2.hubspot.net/hubfs/2668666/All-InOne-2016/Image/bg-img.jpg) ](https://blog.container-solutions.com/configuring-resource-offers-on-mesos)

[Cloud native](https://blog.container-solutions.com/tag/cloud-native), [Microservices](https://blog.container-solutions.com/tag/microservices), [News](https://blog.container-solutions.com/tag/news)

# Configuring resource offers on Mesos

[Frank Scholten](https://blog.container-solutions.com/author/frank-scholten)

![Frank Scholten](https://blog.container-solutions.com/hubfs/frank.jpg)

 May 13, 2015

 2 minutes Read

[![Configuring resource offers on Mesos](https://blog.container-solutions.com/hs-fs/hubfs/Imported_Blog_Media/mesos1-1.png?width=128&name=mesos1-1.png)](https://blog.container-solutions.com/hubfs/Imported_Blog_Media/mesos1-1.png)

The other day I was working on [Mesos Elasticsearch](https://github.com/mesos/elasticsearch) and encountered a problem while running the framework. The framework did not accept any offers from slaves because I had not properly configured the resources. Right now the Elasticsearch framework requires ports 9200 and 9300 but by default the slaves offer a port range 31000 to 32000. The default slave resources offers are defined in **src/slave/constants.cpp**. See the snippet below.

`const double DEFAULT_CPUS = 1; const Bytes DEFAULT_MEM = Gigabytes(1); const Bytes DEFAULT_DISK = Gigabytes(10); const std::string DEFAULT_PORTS = "[31000-32000]";`

There are two ways to configure the slaves to offer the correct resources. The first is to add a **resources** parameter to the **mesos-slave** command like this:

`$ /usr/local/sbin/mesos-slave --resources='ports:[9200-9200,9300-9300]' ...`

The resource string is a comma-separated string consisting of scalar, ranges and sets. Checkout the [Mesos resources documentation](http://mesos.apache.org/documentation/attributes-resources/) to see how to create valid resources expressions. The other way to configure resources is to create a *file* under **/etc/mesos-slave** called **resources** whose contents is the resource string.

`$ cat /etc/mesos-slave/resources ports:[9200-9200,9300-9300] $`

Note that any type of configuration can be expressed this way. This is really useful when provisioning a cluster. For instance with [Terraform](http://container-solutions.com/2015/04/how-to-set-up-mesos-on-google-cloud-with-terraform/). For more information about configuration checkout the [Mesos configuration documentation](http://mesos.apache.org/documentation/latest/configuration/).

[### Terraform Deployments (Almost) in Real-Time

](https://blog.container-solutions.com/terraform-deployment-almost-in-real-time)

[![prev-arrow](https://cdn2.hubspot.net/hubfs/3842749/Wow%202019/Images/left-arrow.png) Previous article](https://blog.container-solutions.com/terraform-deployment-almost-in-real-time)

[ Next article ![next-arrow](https://cdn2.hubspot.net/hubfs/3842749/Wow%202019/Images/right-arrow.png) ](https://blog.container-solutions.com/pulling-from-a-private-docker-repository-with-marathon)

[

### Pulling from a Private Docker Repository with Marathon

](https://blog.container-solutions.com/pulling-from-a-private-docker-repository-with-marathon)

Comments

Leave your Comment

![cs-logo-white](https://blog.container-solutions.com/hs-fs/hubfs/cs-logo-white.png?width=150&height=61&name=cs-logo-white.png "cs-logo-white")

#### **Talk to sales**

[info@container-solutions.com](mailto:info@container-Solutions.com)

#### Stay In Touch

- [**](https://www.linkedin.com/company/container-solutions/)
- [**](https://twitter.com/containersoluti)

© 2024 Container Solutions