Coder Social home page Coder Social logo

ansible_redis-cluster's Introduction

๐Ÿš€ Ansible Redis Cluster Deployment ๐Ÿš€

Automate the deployment of a Redis cluster using Ansible! Deploy multiple instances on the same server with systemd and enjoy an interactive initialization prompt.

Prerequisites

  • Ansible installed on the machine from which you run the playbook.
  • redis-tools package installed so Ansible can initialize the cluster
  • Target servers with SSH access.
  • Ensure that the necessary ports (e.g., 6379, 16379) are open on the target servers.

Usage

  1. Clone this repository:

    git clone https://github.com/SmartechOpenSource/ansible_redis-cluster.git
    cd ansible_redis-cluster/playbooks
    
  2. Update the inventory.ini and playbook.yml file:

    we want 2 Redis servers on each instance

    playbook.yml
    
      vars: 
        - redis_instances_per_host: 2 
    
    
    inventory.ini
    Keep the Formatting as is and add details of your target instances.
      [redis_hosts]
      redis-1 ansible_host=192.168.1.2
      redis-2 ansible_host=192.168.1.3
    
  3. Run the playbook and wait for the cluster init confirmation

    ansible-playbook -i inventory.ini playbook.yml
    
  4. wait for it to finish

    this is a sample of what you get at the and

    TASK [redis_cluster : Display Redis cluster initialization command]
    "msg": "i will use this command to init the cluster: redis-cli --cluster create 192.168.1.2:6379 192.168.1.2:6380 192.168.1.3:6379 192.168.1.3:6380 --cluster-replicas 1 delegate_to: 192.168.1.2:6379"
    
    TASK [redis_cluster : Confirm Initialization] 
    [redis_cluster : Confirm Initialization]
    Redis cluster configuration complete. Do you want to initialize the cluster now? (y/n):
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.