ansible / ansible-examples

A few starter examples of ansible playbooks, to show features and how they work together. See http://galaxy.ansible.com for example roles from the Ansible community for deploying many popular applications.
11.64k stars 7.69k forks source link

Unable to Install Mongo with ansible-examples #108

Closed rodrigovalin closed 5 years ago

rodrigovalin commented 9 years ago

I keep getting this error:

Starting mongod: about to fork child process, waiting until server is ready for connections.

forked process: 3270 ERROR: child process failed, exited with error number 1

This is my hosts file:

#The site wide list of mongodb servers

# the mongo servers need a mongod_port variable set, and they must not conflict.
[mongo_servers]
ansible-mongo-00 mongod_port=2700
ansible-mongo-01 mongod_port=2701
ansible-mongo-02 mongod_port=2702
ansible-mongo-03 mongod_port=2703

#The list of servers where replication should happen, by default include all servers
[replication_servers]
ansible-mongo-00
ansible-mongo-01
ansible-mongo-02
ansible-mongo-03

#The list of mongodb configuration servers, make sure it is 1 or 3
[mongoc_servers]
ansible-mongo-00
ansible-mongo-01
ansible-mongo-02

#The list of servers where mongos servers would run. 
[mongos_servers]
ansible-mongo-00
ansible-mongo-01

The hosts are in my /etc/hosts file.

I added sudo to the site.yml file because if not, nothing gets installed:


---
# This Playbook would deploy the whole mongodb cluster with replication and sharding.

- hosts: all
  sudo: True
  roles:
  - role: common

- hosts: mongo_servers
  sudo: True
  roles:
  - role: mongod

- hosts: mongoc_servers
  sudo: True
  roles:
  - role: mongoc

- hosts: mongos_servers
  sudo: True
  roles:
  - role: mongos

- hosts: mongo_servers
  sudo: True
  tasks:
  - include: roles/mongod/tasks/shards.yml 

The ansible-mongo-{00-03} hosts are CentOS6.5 x64 (DigitalOcean images). I created a sudo user for this playbook to work and added the 'sudo' rules to the site.yml. The mongo servers refuse to start with the first error message.

ApsOps commented 9 years ago

I'm facing the same issue with Amazon Linux at AWS.

ApsOps commented 9 years ago

This SO questions seems to provide a fix - http://stackoverflow.com/questions/28591101/starting-mongod-fork-error-child-process-failed-exited-with-error-number-1

exponov commented 9 years ago

Have you tried installing Mongo with my fork? I have fixed several issues there.