简体   繁体   中英

Mesos Slave - Docker compose

Am using mesos version 1.0.3. Just installed mesos thru

docker pull mesosphere/mesos-master:1.0.3
docker pull mesosphere/mesos-salve:1.0.3

Using docker-compose to start mesos-master and mesos-slave.

docker-compose file,

services:
  #
  # Zookeeper must be provided externally
  #

  #
  # Mesos
  #
  mesos-master:
    image: mesosphere/mesos-master:1.0.3
    restart: always
    privileged: true
    network_mode: host
    volumes:
      - ~/mesos-data/master:/tmp/mesos
    environment:
      MESOS_CLUSTER: "mesos-cluster"
      MESOS_QUORUM: "1"
      MESOS_ZK: "zk://localhost:2181/mesos"
      MESOS_PORT: 5000
      MESOS_REGISTRY_FETCH_TIMEOUT: "2mins"
      MESOS_EXECUTOR_REGISTRATION_TIMEOUT: "2mins"
      MESOS_LOGGING_LEVEL: INFO
      MESOS_INITIALIZE_DRIVER_LOGGING: "false"

  mesos-slave1:
    image: mesosphere/mesos-slave:1.0.3
    depends_on: [ mesos-master ]
    restart: always
    privileged: true
    network_mode: host
    volumes:
      - ~/mesos-data/slave-1:/tmp/mesos
      - /sys/fs/cgroup:/sys/fs/cgroup
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      MESOS_CONTAINERIZERS: docker
      MESOS_MASTER: "zk://localhost:2181/mesos"
      MESOS_PORT: 5051
      MESOS_WORK_DIR: "/var/lib/mesos/slave-1"
      MESOS_LOGGING_LEVEL: WARNING
      MESOS_INITIALIZE_DRIVER_LOGGING: "false"

Mesos master runs fine without any issues. But the slave is not starting with the below error. Not sure, what else is missing here.

I0811 21:38:28.952507     1 main.cpp:243] Build: 2017-02-13 08:10:42 by ubuntu
I0811 21:38:28.952599     1 main.cpp:244] Version: 1.0.3
I0811 21:38:28.952601     1 main.cpp:247] Git tag: 1.0.3
I0811 21:38:28.952603     1 main.cpp:251] Git SHA: c673fdd00e7f93ab7844965435d57fd691fb4d8d
SELinux:  Could not open policy file <= /etc/selinux/targeted/policy/policy.29:  No such file or directory
2017-08-11 21:38:29,062:1(0x7f4f78d0d700):ZOO_INFO@log_env@726: Client environment:zookeeper.version=zookeeper C client 3.4.8
2017-08-11 21:38:29,062:1(0x7f4f78d0d700):ZOO_INFO@log_env@730: Client environment:host.name=<HOST_NAME>
2017-08-11 21:38:29,062:1(0x7f4f78d0d700):ZOO_INFO@log_env@737: Client environment:os.name=Linux
2017-08-11 21:38:29,062:1(0x7f4f78d0d700):ZOO_INFO@log_env@738: Client environment:os.arch=3.8.13-98.7.1.el7uek.x86_64
2017-08-11 21:38:29,062:1(0x7f4f78d0d700):ZOO_INFO@log_env@739: Client environment:os.version=#2 SMP Wed Nov 25 13:51:41 PST 2015
2017-08-11 21:38:29,063:1(0x7f4f78d0d700):ZOO_INFO@log_env@747: Client environment:user.name=(null)
2017-08-11 21:38:29,063:1(0x7f4f78d0d700):ZOO_INFO@log_env@755: Client environment:user.home=/root
2017-08-11 21:38:29,063:1(0x7f4f78d0d700):ZOO_INFO@log_env@767: Client environment:user.dir=/
2017-08-11 21:38:29,063:1(0x7f4f78d0d700):ZOO_INFO@zookeeper_init@800: Initiating client connection, host=localhost:2181 sessionTimeout=10000 watcher=0x7f4f82265e50 sessionId=0 sessionPasswd=<null> context=0x7f4f5c000930 flags=0
2017-08-11 21:38:29,064:1(0x7f4f74ccb700):ZOO_INFO@check_events@1728: initiated connection to server [127.0.0.1:2181]
2017-08-11 21:38:29,067:1(0x7f4f74ccb700):ZOO_INFO@check_events@1775: session establishment complete on server [127.0.0.1:2181], sessionId=0x15dc8b48c6d0155, negotiated timeout=10000
Failed to perform recovery: Failed to run 'docker -H unix:///var/run/docker.sock ps -a': exited with status 1; stderr='Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.22)
'
To remedy this do as follows:
Step 1: rm -f /var/lib/mesos/slave-1/meta/slaves/latest
        This ensures agent doesn't recover old live executors.

The below command returns same version for docker client API and docker server API. Not sure what is wrong with the setup.

docker -H unix:///var/run/docker.sock version

Client:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:18:46 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:18:46 2016
 OS/Arch:      linux/amd64

Meoss slave was using the client version 1.24.

This is working after setting the environment variable for the mesos slave.

DOCKER_API_VERSION = 1.22

The combination of the release version and API version of Docker is as follows:

https://docs.docker.com/engine/api/v1.26/#section/Versioning

The other option is to update the docker version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM