Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Stand-alone installation and configuration of redis and startup scheme of production environment

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This paper briefly introduces the stand-alone installation and configuration of redis, which is convenient for others to obtain knowledge while recording the installation steps.

First, download the latest (stable version) redis installation package from the official website. The official website address is as follows: https://redis.io/download

After downloading the source package, redis needs to be compiled and installed. Gcc and tcl,gcc need to be installed to compile tcl for testing.

Use the command to install gcc,yum install gcc, and select yes,gcc all the way to install successfully.

To install tcl, first obtain the tcl source code package (see Baidu Cloud disk) or use the command: wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz

After downloading the source code package, use the command to decompress and install:

Tar-xzvf tcl8.6.1-src.tar.gzcd / usr/local/tcl8.6.1/unix/./configure make & & make install

Then extract the tar package of redis and use the command tar-zxvf redis-3.2.10.tar

Enter the unzipped directory and perform the test of the installation process recommended by make & & make test & & make install using test

After the installation is complete, first create two directories, / ect/redis, which is used to store the startup configuration files of redis, and then create a second directory, / var/redis/6379, which is used to hold the RDB backup files of redis.

After the two directories have been created, modify the redis.conf configuration file

Daemonizeyes makes redis run as daemon (daemon)

Pidfile/var/run/redis_6379.pid sets the pid file location of redis

Port6379 sets the listening port number of redis

Dir / var/redis/6379 sets the storage location of persistent files

Rename the modified redis.conf to 6379.conf and copy the file to the / etc/redis directory

Deploy the startup solution for redis production environment:

Copy the redis_init_script startup script from the utils directory to the / ect/init.d directory and rename it to redis_6379

Create a new startup script in the same directory. Note that the comments in the script are required, otherwise chkconfig will report an error and boot cannot be added.

#! / bin/sh### add for chkconfig# chkconfig: 2345 80 90# description: auto_ru# processname: redis_start/etc/init.d/redis_6379 start

After saving the script, name it start_redis_6379

Execute the command, set redis to boot, the system environment is centos, different systems start in different ways.

Chkconfig-add start_redis_6379chkconfig start_redis_6379 on

At this point, the installation and startup steps of redis have been recorded.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report