How come we are running redis and redisearch on same port 6379, What I understand is redisearch need to be install and run with redis - redis

How come we are running Redis and redisearch on the same port 6379, What I understand is redisearch need to be installed and run with Redis, it will work on data stored in Redis, or do we need to move data to redisearch and then create index?

RediSearch is a Redis module which runs, as all modules, within Redis itself: it doesn't open any additional port on its own, as all the requests are handled by the hosting Redis server itself.
With that being said, I would suggest to read the quick start for RediSearch.

Related

Does Twemproxy / nutcracker support MGET command of Redis

I am using nutcracker in my application to fetch data from Redis nodes.
Just wanted to know whether it supports multi get or it internally fetches all keys one by one.
Yes it does.
You can find all the Redis commands that twemproxy supports here

Redis Cluster or Replication without proxy

Is it possible to build one master (port 6378) + two slave (read only port: 6379, 6380) "cluster" on one machine and increase the performances (especially reading) and do not use any proxy? Can the site or code connect to master instance and read data from read-only nodes? Or if I use 3 instances of Redis I have to use proxy anyway?
Edit: Seems like slave nodes don't have any data, they try to redirect to master instance, but it is not correct way, am I right?
Definitely. You can code the paths in your app so writes and reads go to different servers. Depending on the programming language that you're using and the Redis client, this may be easier or harder to achieve.
Edit: that said, I'm unsure how you're running a cluster with a single master - the minimum should be 3.
You need to send a READONLY command after connecting to the slave before you could execute any read commands.
A READONLY command only affects during the current socket session which means you need this command for every TCP connection.

twemproxy (nutcracker) adding redis instance and keeping consistency

I set up twemproxy (nutcracker) with 2 redis servers as backends including slaves, sentinel and failover.
As soon as I add another redis server some of the keys are not able to be read, probably due to twemproxy redirecting to another redis.
How do I add another redis instance without breaking the consistency?
I want to use the setup as a consistent and very fast database.
Here are my settings:
redis_cluster:
auto_eject_hosts: false
distribution: ketama
hash: fnv1a_32
listen: 127.0.0.1:6379
preconnect: true
redis: true
servers:
- 127.0.0.1:7004:1 redis_1
- 127.0.0.1:7005:1 redis_2
I want to keep sharding a job of the server and be able to add instances. Do I need to use another setup?
Twemproxy can't do that. You can use Redis Cluster, or if you want to use Twemproxy you have to use a technique called presharding. Which is, start directly with, like, 32 or 64 instances or alike, even if them all run in the same host to start. Then start moving instances from one box to another in order to scale to multiple actual servers. The word to the right of the instances configured inside Twemproxy "redis_1" are used in order to hash, so that you can change IP address when you move instances, and still the hashing will be the same for that server.
Redis Cluster is release candidate 2 at this point. While it needs more testing and deployments to be battle tested as Redis is, it is already a viable product, so you may want to test it as well.

Which option is better for Redis? SHUTDOWN or service stop?

I have Redis server running on CentOS as a service. I can stop the server using service redis stop or redis-cli SHUTDOWN.
What is the difference between the two options and which one I should be using in Production environment?
You should check your init script since it may precisely perform a shutdown on stop and not a killproc, e.g:
ExecStop=/usr/bin/redis-cli shutdown
(from Fedora package: redis-server.service)
Using shutdown is the recommended way to stop Redis if persistence matters as stated by the documentation:
If persistence is enabled this commands makes sure that Redis is switched off without the lost of any data.

How to clean up redis hosted by cloudfoundry?

The redis cache offered by CloudFoundry has a small capacity, i.e. 16MB.
I know redis has a command "FLUSHALL" which is used to delete all the keys in the cache. How to do the same thing in cloudfoundry?
You can recreate and rebind the service as you wish unless you have any specific configuration that cannot be migrated. (I assume services provisioned by CF.com should be created as the same.)
Also sending FLUSHALL to the redis tunnel should be another option if you have vmc and caldecott gem installed as well as a redis execution locally. Would you mind if you can send the error why you cannot connect to it?