GithubHelp home page GithubHelp logo

chen0040 / ansible-centos-redis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 1.55 MB

redis setup on centos using ansible

License: MIT License

Ruby 99.73% Shell 0.27%
vagrantfile redis-server ansible

ansible-centos-redis's Introduction

ansible-centos-redis

redis setup on centos using ansible

Configure OS before installing redis

For CentOS Users

git clone this project to your host computer and navigate to the root directory of the project then run the following command:

devops/sbin/env_setup.sh

This will install ansible and make tools.

For Windows Users

git clone this project to your host computer and navigate to the root directory of the project then run the following command:

vagrant up

This will start a vagrant centos 7 VM (at ip 192.168.10.12) with ansible and make tools. Run the following command to ssh into the centos VM:

vagrant ssh

Install redis

On the centOS, cd to the devops/ansible folder (that is the "devops/ansible" folder in this project), and run the following command:

ansible-playbook setup-redis.yml -u root -i redis.inventory.password --tags=install_redis

This will build and install a redis-6379.service on the CentOS. Run the following command to check this service after the installation:

systemctl status redis-6379.service

Start redis

After the service is installed, one can start the redis service by running the following command:

sudo systemctl start redis-6379.service

This will start the redis service at port 6379.

To test this service, run the following command:

redis-cli -a chen0469 ping

Here "chen0469" is the authentication password set in devops/ansible/inventory.password

The redis service can also be started by running the following commands:

cd devops/ansible
ansible-playbook setup-redis.yml -u root -i redis.inventory.password --tags=start_redis

Other options available for the ansible-playbook are:

  • restart_redis
  • stop_redis
  • reload_redis
  • clean_redis

Install redis cluster

To install and start redis cluster instead, run the following command:

ansible-playbook setup-redis.yml -u root -i redis.inventory.cluster --tags=install_redis
ansible-playbook setup-redis.yml -u root -i redis.inventory.cluster --tags=start_redis

ansible-centos-redis's People

Contributors

chen0040 avatar

Watchers

 avatar

Forkers

valentindroubay

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.