Notes on building a redis cluster

Recommended reference tutorial: https://blog.csdn.net/pucao_cug/article/details/69250101

mistake:

from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/redis-3.0.6/src/redis-trib.rb:25:in `<main>'

solve:

gem install redis (latest)

sudo gem install redis -v 3.0.6 (corresponding version)

#Check if the background process exists
ps -ef | grep redis

#Check if port 6379 is listening
netstat -lntp | grep 6379

#Use the `redis-cli` client to detect whether the connection is normal ./redis-cli Redis 

cluster is built, generally at least 6 machines or processes, 3 primary sets and 3 secondary sets
. Create a cluster directory in the /usr/local/ directory
mkdir redis-cluster
cd redis-cluster
respectively mkdir /* port number */
eg:
mkdir 7000
cd 7000
mkdir data
Copy the redis.conf configuration file in the redis installation directory

 sudo cp redis.conf /usr/local/redis-cluster/7005/

Then start the 
redis-server redis.conf separately and
use the following command to check whether the startup is successful

    ps aux | grep redis outputs the following image

 

 Can't start redis after adding cluster-enabled yes? ? ? ?

  Turned out to be not enough permissions. . . . . . Just add sudo. . . . .

The picture above shows that the ports are open.

However, the cluster has not been established successfully.

Enter the following command

ruby ./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005

Since then, the redis cluster has been successfully built, you can check it

Finish! ! !

.Use the Redis startup script to set up automatic startup at boot

startup script

It is recommended to use the startup script to start the redis service in the production environment. The startup scripts redis_init_script are located in the Redis  /utils/ directory.

#Browse the startup script roughly, and find that redis habitually uses the listening port name as the configuration file name, and we will follow this convention later.
#redis server listening port
REDISPORT=6379
#The location of the server is stored in `/usr/local/bin/redis-server` by default after make install. If you do not make install, you need to modify the path, the same below.
EXEC=/usr/local/bin/redis-server
#client location CLIEXEC=/usr/local/bin/redis-cli
#Redis PID file location PIDFILE=/var/run/redis_ ${REDISPORT}.pid #Configuration file location, need to modify CONF= "/etc/redis/ ${REDISPORT}.conf"

 Set it up again to be successful.

#Set to start the server automatically at boot
chkconfig redisd on
#Open service
service redisd start
#Close the service
service redisd stop

ubuntu system does not have chkconfig
and replace it with sysc_rc_config
 

Python报错: Command “python setup.py egg_info” failed with error code 1

This is because your computer uses both versions of Python 2.7+ and 3.5+. By default, pip will use version 2.7+, and some libraries depend on version 3.5+. In 
this case, you only need to specify the pip version corresponding to 3.5+.

python3 install pip3:

sudo apt-get install python3-pip

sudo python3 -m pip install softwarename

Note: Sometimes you may need to update the pip version first

sudo python3 -m pip install --upgrade pip

没有解决问题!!!最后还是通过

sudo apt-get install python-psycopg2 completed the installation

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325067669&siteId=291194637