dev-master
9999999-dev https://github.com/dynamicnet/redis-trib-phpA pure PHP implementation of redis-trib.rb
MIT
The Requires
- php ^5.5 || ^5.6 || ^7.0 || ^7.1
by David Tourel
redis cli tool redis-cluster
Wallogit.com
2017 © Pedro Peláez
A pure PHP implementation of redis-trib.rb
A pure PHP implementation of redis-trib.rb. A tool to manage Redis clusters., (*1)
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)
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
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 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
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
Performs a sanity check of the cluster., (*12)
~# redis-trib.php create 127.0.0.1:6379
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
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
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
:warning: NOT PRODUCTION READY, (*16)
:warning: Not all commands or options of redis-trib.rb are available at the moment., (*17)
A pure PHP implementation of redis-trib.rb
MIT
redis cli tool redis-cluster