Get the App
SLTechnology News&Howtos  ›  Database  › 

Centos7 install redis and set boot up

Shulou Source: shulou.com Published: 2022-06-01 08:32:08 12月06日 Update

1. Install redis first

Tar xzf redis-3.0.0.tar.gz

Cd redis-3.0.0/

Make

Make install PREFIX=/usr/local/redis

Create a directory to store redis and copy files

Mkdir-p / usr/local/redis

Cd src/

Cp. / redis-server / usr/local/redis/

Cp. / redis-cli / usr/local/redis/

Cd..

Cp redis.conf / usr/local/redis/

Back-end startup

Copy the redis.conf configuration file in the redis source package to / usr/local/redis/bin/ (above)

Modify redis.conf to change daemonize from no to yes

Start when you are finished:

. / redis-server redis.conf

Set up boot boot

Create a redis folder under the / etc directory

Cd / etc/

Mkdir redis

Copy the / usr/local/redis/redis.conf file to the / etc/redis directory and name it 6379.conf

Cp / usr/local/redis/redis.conf / etc/redis/6379.conf

Make a copy of the startup script of redis and put it in the / etc/init.d directory

Cp / redis-3.0.0/utils/redis_init_script / etc/init.d/redisd

Set redis Boot self-boot

Cd / etc/init.d/

Vi redisd

Modify the path, save and exit vi

EXEC=/usr/local/redis/redis-server

CLIEXEC=/usr/local/redis/redis-cli

Execute the boot command

Chkconfig redisd on

Start and shut down redis

Service redisd start

Service redisd stop

Tags: Files directories commands folders source code scripts paths end startup storage configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB macOS Microsoft MySQL Shulou Tech Info