2017 © Pedro Peláez
 

library redis-trib-php

A pure PHP implementation of redis-trib.rb

image

dynamicnet/redis-trib-php

A pure PHP implementation of redis-trib.rb

  • Monday, February 5, 2018
  • by dynamicnet
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

redis-trib-php

A pure PHP implementation of redis-trib.rb. A tool to manage Redis clusters., (*1)

Why ?

The original redis-trib.rb is a Ruby tool, with some dependencies that require a recent Ruby., (*2)

Sometimes, you don't have a Ruby envrironnement and don't want to setup one in order to manage a Redis cluster., (*3)

redis-trib.php aims to do the same work as the original tool, but with PHP and no dependency., (*4)

The interface is the same as the original tool shipped with Redis. So any tutorial showing examples with the Ruby tool may work with this PHP tool., (*5)

Install manually

Pick the latest release at https://github.com/dynamicnet/redis-trib-php/releases, (*6)

~# wget https://github.com/dynamicnet/redis-trib-php/releases/XXXXXX
~# chmod +x ./redis-trib.php

~# ./redis-trib.php help

Install via Composer

Commands

the create, add-node, rebalance commands have a --simulate option that permit to test command line without issuing write commands to the cluster., (*7)

create

Create a cluster using a list of node. All nodes must be empty. If you have non empty nodes, you can use --force-flush to flush the redis DB, be carful with this option., (*8)

The slot allocation is automatic. The memory allocated to each node is used to balance the cluster. The more a node have memory, the more slot we allocate to it., (*9)

Create a cluster with 3 nodes, (*10)

~# redis-trib.php create 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381

info

Displays informations about the cluster. List of node, slot allocations, number of keys, opens slots., (*11)

~# redis-trib.php info 127.0.0.1:6379

check

Performs a sanity check of the cluster., (*12)

~# redis-trib.php create 127.0.0.1:6379

fix

Try to fix some problems in a cluster, for example opens slots after an interrupted rebalance/resharding., (*13)

~# redis-trib.php fix 127.0.0.1:6379

rebalance

Calculate, dispatch and move slots and keys in order to get a well balanced cluster according to the memory allocated to each node., (*14)

~# redis-trib.php rebalance 127.0.0.1:6379

call

Issues a command on each node in a cluster and display the result., (*15)

~# redis-trib.php call 127.0.0.1:6379 cluster nodes

DISCLAIMER

:warning: NOT PRODUCTION READY, (*16)

:warning: Not all commands or options of redis-trib.rb are available at the moment., (*17)

The Versions

05/02 2018

dev-master

9999999-dev https://github.com/dynamicnet/redis-trib-php

A pure PHP implementation of redis-trib.rb

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^5.6 || ^7.0 || ^7.1

 

by David Tourel

redis cli tool redis-cluster