Feature | Description |
---|---|
Version | 5.0.0 |
Service | Redis |
Component-Master | Redis-Master |
Component-Slave | Redis-Slave |
- Internet Access (need to yum install ruby etc);
- Ambari 2.x (test on 2.6.2.0) fully installed.
- Support redis single instance deployment: 1 instance;
- Support redis cluster mode deployment: 3+ master instance and 3+ slave instance.
- Download the source code.
- Copy the project folder to ambari 's lib folder. Such as:
cp -r ./REDIS-5.0.x /var/lib/ambari-server/resources/stacks/HDP/2.6/services
- Restart ambari-server:
ambari-server restart
1). choose 1 node be the master:
2). choose 0 node be the slave:
4). configure cluster disabled:
1). choose at least 3 nodes be the master:
2). choose at least 3 nodes be the slave:
4). configure cluster enabled:
- Then continue the deployment and enjoy urself.^^
Here is some manually maintaince method specially for cluster operations (All the {} pamas can be found in Redis Configs in Ambari Web):
{redis.base.dir}/src/redis-cli --cluster check {host_ip}:{port}
{redis.base.dir}/src/redis-cli --cluster create host1_ip:{master-port} host2_ip:{master-port} host3_ip:{master-port} ...
{redis.base.dir}/src/redis-cli --cluster add-node {new_host_ip}:{master-port} {exist_cluster_host_ip}:{master-port}
{redis.base.dir}/src/redis-cli --cluster reshard {new_host_ip}:{master-port}
{redis.base.dir}/src/redis-cli --cluster add-node {new_host_ip}:{master-port} {exist_cluster_host_ip}:{slave-port} --cluster-slave
# get node_id by check or info
{redis.base.dir}/src/redis-cli --cluster check {host_ip}:{master-port}
# then remove
{redis.base.dir}/src/redis-cli --cluster del-node {host_ip}:{port} {node_id}
# if node is already removed from cluster and stopped.
rm -fr {redis.base.dir} && rm -fr {log.file.dir} && rm -fr {pid.file.dir} && rm -fr {dir}
# remove the nodes.conf in dir
rm -fr {dir}/nodes.conf
# start redis (can be done on web)
{redis.base.dir}/src/redis-server {redis.base.dir}/redis.conf
# cleanup db
{redis.base.dir}/src/redis-cli
> flushdb
# use method above-mentioned add node to master or slave
- Only support creating master node cluster for the first time.
- Master node scaling need to be done mannually.
- Support salve node incremental scaling.
- Need more test if using on production.