ansibleshipyard / ansible-mesos Goto Github PK
View Code? Open in Web Editor NEWMesos Playbook for Ansible
License: Apache License 2.0
Mesos Playbook for Ansible
License: Apache License 2.0
Hi,
First of all, I would like to thank you for your ansible roles. It's really simple to play with them.
The mesos role goes well if I don't use docker as mesos_containerizers.
Unfortunately When using docker (installed with your AnsibleShipyard/ansible-docker role) each time I try to start my mesos-slaves I have the message in my mesos-slave log:
_Failed to create a containerizer: Could not create DockerContainerizer: Failed to execute 'docker version': exited with status 1_
Docker is installed, when I do a sudo docker version
I have this output:
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64
But when I don't do any sudo, I have this output:
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
I'd like to know if someone already faced this issue and can help me with each group/users I need set up to make work docker and mesos together.
This is my configuration for the mesos-slave (all the roles used here are from AnsibleShipyard) :
---
- hosts: [mesos_slaves]
sudo: True
pre_tasks:
- name: Remove require tty
lineinfile: regexp="tty" dest=/etc/sudoers/os_defaults state=absent
tags: ['system']
roles:
- { role: 'ansible-docker', tags: ['docker'] }
- { role: 'ansible-java', tags: ['java'], when: ansible_os_family == 'Debian' }
- { role: 'ansible-mesos', mesos_containerizers: "docker,mesos", zookeeper_hostnames: "{{ groups.mesos_masters | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", mesos_cluster_name: 'oprt', mesos_install_mode: "slave", tags: ['mesos'] }
- { role: 'ansible-consul', consul_conf_start_join: "{{ groups.mesos_masters }}", consul_conf_retry_join: "{{ groups.mesos_masters }}", tags: ['consul'] }
Thanks,
Valentin.
Hi,
I am adjusting playbook for Centos and just hit into mesos init script.
Is handler restarting service working on Debian?
I suppose I will have to add init.d service file which supports start/stop/restart commands else this handlers won't work without init.d script.
The documentation for the installer uses JasonGiedymin.mesos so shouldn't the playbook installer use the same name as the role?
Not a big issue but just a small annoyance when testing this. :)
Looks like at Mesos UI, if you don't pass in publicly accessible --hostname to mesos-slave script, we won't be able to access slave Sandbox from UI.
I'm proposing using a hostname.j2 template with {{inventory_hostname}} as the content since it will be using the real hostname from the inventory file (which should be publicly accessible)
Implementation might be create a mesos-slave.yml file and include it in main.yml only for "slave" mode.
@JasonGiedymin your thought on this?
Hello!
As a rookie to ansible, I have some questions to bind them togetother:
zookeeper_client_port: "2181"
in ansible-mesos
, but not in ansible-marathon
.zookeeper_hostnames
, how can I set a global variable for them?ansible-mesos
readme write as zookeeper_hostnames: "{{ groups.zookeeper_hosts | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}
. ( I think groups.zookeeper_hosts
equals to groups[zookeeper_hosts]
here, isn't it ). But in ansible-zookeeper
, the example is zookeeper_hosts: "{{groups['zookeepers']}}"
.Now, I write a .yml like below:
- name: install java
- hosts: all
roles:
- role: geerlingguy.java
when: "ansible_os_family == 'RedHat'"
java_packages:
- java-1.8.0-openjdk
- name: Zookeeper cluster setup
hosts: zookeepers
sudo: yes
roles:
- role: AnsibleShipyard.ansible-zookeeper
zookeeper_hosts: "{{groups['zookeepers']}}"
- name: install mesos
- hosts: mesos-cluster
roles:
- role: mesos # I reset the name, because install from github
zookeeper_client_port: 2181
zookeeper_hostnames: "{{ groups.zookeepers | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}"
mesos_containerizers: "docker,mesos"
- name: install marathon
- hosts: marathon-cluster
roles:
- role: marathon
zookeeper_hostnames: "{{ groups.zookeepers | join(':2181,') }}:2181"
mesos_containerizers: "docker,mesos"
If there are a full example would be nice for learn and reuse.
Will this ansible role support SSL out of the box? I was looking at the documentation here and it says you have to modify your configure line to enable SSL.
../configure --enable-libevent --enable-ssl
This of course means you are building it from source, which I don't believe the play does. Is there a way to still use ansible-mesos and enable ssl?
When running the master
install mode, the mesos-slave
services remain enabled in systemd (more specifically, the file at /etc/systemd/system/multi-user.target.wants/mesos-slave.service
still exists), and vice versa. On a reboot, the system will continuously try to restart these services which should not be running.
The following task (and a similar one for disabling mesos-master) should fix this issue. I'll open a PR after some additional testing.
service: name=mesos-slave enabled=no
when: mesos_install_mode == "master"
Python mesos lib not installed or in path, it is used by various tools.
Cut v0.3.4
Use my other repo: ansible-nodejs as inspiration.
/tests/
with integration-tests.yml
file which describes a (perhaps a simple) test to verify the application is running.inventory.yml
, and playbook.yml
which is used to install this role in a dockerfile.Dockerfile
referencing AnsibleShipyard/base-ubuntu-javabuild.sh
which is a friendly command to build the dockerfile.I'm working on a PR with a few updates, but I wanted to suggest using ansible_default_ipv4.address
instead of ansible_eth1.ipv4.address
. I was deploying on an ubuntu instance which didn't have an eth1 interface and in inspecting ansible's artifacts it seems default would be better.
Cleanup to keep things consistent across repos.
Need to rename the tests/
dir to ci/
Sometimes mesos slaves do not want to start :
Failed to perform recovery: Incompatible agent info detected.
<lots of JSON>
To remedy this do as follows:
Step 1: rm -f /var/mesos/meta/slaves/latest
This ensures agent doesn't recover old live executors.
Step 2: Restart the agent.
(from journalctl)
After removing the latest directory as suggested, the agent starts again.
I believe it is due to http://www.flexthinker.com/2015/09/reconfiguring-mesos-agents-slaves-with-new-resources/
It is possible to detect changes in the resources (one of the templates?) and automatically remove the latest directory?
Additionally, an variable can be introduced to enable/disable this behavior
It'd be nice to provide support for configuring resources/attributes within Mesos using this role. The mesos-init-wrapper
reads these values from /etc/mesos-slave/attributes/X
and /etc/mesos-slave/resources/X
where X
is the name of the resource or attribute.
I think two new dicts should do the trick:
mesos_attributes:
rack_id: 1
os: centos7
mesos_resources:
ports: "[21000-22000,31000-32000]"
I'll be happy to add these changes in; just thought I'd open an issue first to track the changes and request comments or suggestions.
The vars defined in the vars
directory has a higher precedence than the likes of group_vars
, making it difficult or impossible to work with this role. Move them to defaults
so users can configure this role as necessary.
Oops, nohup logging
so far I've added :
export MASTER="{{ master_ip_address }}:{{ mesos_master_port }}"
to the slaves
and
export ZK="{{ mesos_zookeeper_masters }}"
export IP="{{ ansible_eth1.ipv4.address }}"
to the master
Otherwise /usr/bin/mesos-init-wrapper
is using default values for slaves :
[[ ! ${MASTER:-} ]] || args+=( --master="$MASTER" )
as well for master :
[[ ! ${ZK:-} ]] || args+=( --zk="$ZK" )
[[ ! ${IP:-} ]] || args+=( --ip="$IP" )
maybe I was missing something on the playbook execution
When using this play, I get the following error:
TASK: [ansible-mesos | Install Debian OS packages] ****************************
failed: [one] => (item=wget,curl,unzip,python-setuptools,python-dev,mesos=0.21.0-1.0.ubuntu1204) => {"failed": true, "item": "wget,curl,unzip,python-setuptools,python-dev,mesos=0.21.0-1.0.ubuntu1204"}
msg: No package matching 'mesos' is available
Did something change in the Debian repo config?
Hi,
Can someone provide a brief explanation of how to use this? Thanks.
Thanks,
Govind
Hi !
I tried playbook . In the TASK "Install Debian OS packages" (I use Ubuntu), zookeeper* packages sometimes were not installed. With "install_recommends" option, these are installed. entries are missing with_items: ? or can we setup without zookeeper with current configuration of role?
BTW requirements section in readme says "zookeeper" is necessary package for this role.
appreciate if any reply.
Mesosphere and EPEL's repositories have https endpoints available. It would be prudent to use these instead of their plaintext counterparts.
Couple of things are missing from the documentation:
Can someone post screenshots or execution command of the same?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.