apache mesos role

Mesos allocates resources between different frameworks according to the role ( ROLE ). When starting the master , you can specify the role in the system and the weight of each role, for example:

mesos-master --ip=127.0.0.1 --work_dir=/var/lib/mesos --roles=qarole,devrole --weights='qarole=1,devrole=3'

Two roles parole and devrole are specified , with weights 1 and 3, respectively.

You can set the corresponding role when setting FrameworkInfo

 

When the slave starts, it will detect the resources of the current node, including cpu, memory, disk, etc. The slave will reserve 1G (or 50%) of memory and 5G (or 50%) of disk by default to ensure the normal operation of itself and the operating system . , the remaining resources will be reported to the master for scheduling. Of course, you can also manually specify the amount of resources that should be reported, for example,

mesos-slave --master=127.0.0.1:5050 --resources='cpus:4;mem:8192;ports:[1000-5000,31000-32000];'

Slave can also statically set the resource amount of each role, for example:

mesos-slave --master=127.0.0.1:5050 --resources='cpus(prod):1;mem(prod):4096;cpus(qa):2;mem(qa):1024;cpus:13;mem:11264' --attributes='operating_system:ubuntu;cpu_class:haswell;zone:us_east;rack:22'

Among them prod role: 1cpu, 4096 memory

qa role: 2cpu, 1024 memory

Default role: 13cpu, 11264 memory

 

In addition to reporting the resource status of the slave node, you can also mark some attributes of the current node for the scheduler to use, such as whether it is an ssd hard disk, operating system type, etc.

mesos-slave --master=127.0.0.1:5050 --resources='cpus:4;mem:8192;ports:[1000-5000,31000-32000];' --attributes='operating_system:ubuntu;cpu_class:haswell;zone:us_east;rack:22'

 

http://mesos.apache.org/documentation/latest/roles/

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326902759&siteId=291194637