Redis create-cluster create script increases the cpu usage to 100% - redis

I want to give a try to the create-cluster script given in the redis documentation.
I did as the documentation indicates:
./create-cluster start
./create-cluster create
After the ./create-cluster create command, my computer CPU is going indefinitely to 100% of usage.
./create-cluster stop
When stopping the cluster instances, the CPU usage is back to normal usage.
What is going on? What can I do in the configuration to solve this?
My operating system is a Windows 10 version 21H2.
I installed the WSL Ubuntu 20.04 and run redis on it.
I installed the apt-get redis-server package.
didi#CHOUCHOU:~$ redis-server --version
Redis server v=6.2.6 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=9c9e426e2f96cc51
didi#CHOUCHOU:~$ redis-cli --version
redis-cli 6.2.6
I downloaded from github the create-cluster script.
https://raw.githubusercontent.com/redis/redis/6.2/utils/create-cluster/create-cluster

Related

Redis start server if installed via snap

I am new to redis and I've just installed it using snap craft. All tutorials say that i can start redis server by typing redis-server in terminal. But for me it says that Command 'redis-server' not found. Is the process different if installed from snap?
Start Redis server:
sudo snap start redis
To run redis-cli copy it to /usr/local/bin/:
sudo cp /snap/redis/138/usr/bin/redis-cli
redis-cli

Redis running version unmatch actual version

Ubuntu 18.04
My Redis-Server Version:
Redis server v=5.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=71f661bb00c4db91
My Redis-Cli Version:
redis-cli 5.0.5
However, my redis is running on 4.0.9, so please let me know how can I change the configure and make my redis running on 5.0. Thank you.
127.0.0.1:6379> info
# Server
redis_version:4.0.9
I found there are two versions of Redis-server in my environment, and after uninstalling the unmatched running version, it works properly.

Err Unknown command scan, redis-cli

Installed the redis on ubuntu using
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04
redis-server -v gives
Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=76095d16786fbcba
redis-cli -v gives
redis-cli 4.0.9
While redis-cli info gives
redis_version:2.4.6
redis_git_sha1:26cdd13a
redis_git_dirty:0
arch_bits:64
multiplexing_api:winsock2
gcc_version:4.6.1
When run the scan command redis-cli scan 0 it gives error
(error) ERR unknown command 'scan'
Learned that scan only works on redis version 2.8+, so tried to update redis sudo apt install redis-server but it says
redis-server is already the newest version (5:4.0.9-1ubuntu0.1).
How can we run the SCAN command?
Problem is with your previous version of Cli: https://redis.io/commands/scan
upgrade your cli version to 2.8.0 or higher
I got the same issue due to install redis(2.4.0) on window 10 and donwload ubuntu from windows store and install latest version of redis(5.0.2) in Ubuntu but still redis-cli showed 2.4.6
To resolve this problem just uninstall redis-server from window and restart redis-server on Ubuntu

Running redis on MacOS - ping works without redis-server

I have just installed redis on MacOS. I'm following through the standard intro process. It says that in order start the DB I should call
$ redis-server
It also says that in order to confirm the server is running I should do the following:
$ redis-cli ping
PONG
I notice that I can ping the redis-cli as above and still get PONG back, even if I haven't executed redis-server. Does this mean that redis is running even if I don't exec redis-server?
If that is the case, how do I start and stop the local db?
Though you did not say, I guess you installed Redis using homebrew.
You can check what services you have started with homebrew using:
brew services list
Then you can use:
brew services start redis
and:
brew services stop redis

start redis-server on debian/ubuntu boot

I am trying to create a docker container where redis starts at boot.
there will be other foreground services running on that other container which will connect to the redis db.
for some reason the service does not start when i run the container.
here my simplified Dockerfile
FROM debian
# this solves an issue described here:
# http://askubuntu.com/questions/365911/why-the-services-do-not-start-at-installation
RUN sed -i -e s/101/0/g /usr/sbin/policy-rc.d
# install redis-server
RUN apt-get update && apt-get install -y redis-server
# updates init script (redundant)
RUN update-rc.d redis-server defaults
# ping google to keep the container running in foreground
CMD ["ping", "google.com"]
can anybody explain me why this is not working and how this should be done right?
So a docker container is like a full OS but has some key differences. It's not going to run a full init system. It's designed and intended to run a single process tree. While you can run a supervisor such as runit et al within a container, you are really working against the grain of docker and all the tooling and documentation is going to lead you away from using containers like VMs and toward the harmony of 1 process/service per container.
So redis isn't starting because the ping command is literally the only process running in your container.
there will be other foreground services running on that other container which will connect to the redis db.
Don't do it this way. Really. Everything will be easier when you put 1 process in each container and connect them via network links.
Digging up an old question here, but I landed on it whilst trying to package a really simple Redis job queue into an existing docker image setup. I needed it to start up on image boot so the app could have access to it. Memory and performance are not a concern in this scenario or an external Redis server would absolutely be the right choice.
Here's what I did in my Dockerfile for a simple NodeJs app to make it work without editing any system files post-install:
RUN apt-get update && apt-get -y redis-server
CMD service redis-server start & node dist/src/main
Sort of crude using parallel command processes, but as the accepted answer points out this is not a real operating system so we really only care about Redis being online when the app is.