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

How to install stand-alone environment redis3.2 for centos7

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the relevant knowledge of "how to install stand-alone environment redis3.2 in centos7". The editor shows you the operation process through an actual case. The method of operation is simple, fast and practical. I hope this article "how to install stand-alone environment redis3.2 in centos7" can help you solve the problem.

The system version of this installation is as follows:

[root@zhangqinglei ~] # cat / etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

[root@zhangqinglei] # lsb_release-a

LSB Version:: core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-

Noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarchDistributor ID: CentOS

Description: CentOS Linux release 7.5.1804 (Core)

Release: 7.5.1804

Codename: Core

Because there are some differences between different system versions, the comparison is recorded. Later test the installation instructions for other versions of centos.

The redis version of this installation is as follows

Redis-3.2.13.tar.gz

It is installed on a server and provides different ports. And explain the uninstall of redis.

Table of contents:

Installation directory: / home/soft

Tool catalog: / home/tools

Rz uploads to tool catalog, redis-3.2.13.tar.gz

Extract to the soft directory

Tar-zxvf redis-3.2.13.tar.gz-C / home/soft/

Cd / home/soft/

Rename

Mv redis-3.2.13 redis3-6379

Expressed as redis3 version, open port is 6379

Enter the directory to start the installation

Cd redis3-6379

Make & & make install

Wait for about 1 minute before the execution is completed with no error.

Go to the utils directory and execute the redis initialization script install_server.sh

Cd utils/

. / install_server.sh

Perform the following steps

Fill in the port number and other paths. If default, enter directly.

From the perspective of the installation process, a file is created in the

/ etc/init.d/redis_6379

View the contents of the file

#! / bin/sh#Configurations injected by install_server below....EXEC=/usr/local/bin/redis-serverCLIEXEC=/usr/local/bin/redis-cliPIDFILE=/var/run/redis_6379.pidCONF= "/ etc/redis/6379.conf" REDISPORT= "6379" # SysV Init Information# chkconfig:-58 7 hours description: redis_6379 is the redis daemon.### BEGIN INIT INFO# Provides: redis_6379# Required-Start: $network $local_ Fs $remote_fs# Required-Stop: $network $local_fs $remote_fs# Default-Start: 2 3 4 "Default-Stop: 0 1" Should-Start: $syslog $named# Should-Stop: $syslog $named# Short-Description: start and stop redis_6379# Description: Redis daemon### END INIT INFOcase "$1" instart) if [- f $PIDFILE] thenecho "$PIDFILE exists Process is already running or crashed "elseecho" Starting Redis server... "$EXEC $CONFfi ; stop) if [!-f $PIDFILE] thenecho "$PIDFILE does not exist, process is not running" elsePID=$ (cat $PIDFILE) echo "Stopping..." $CLIEXEC-p $REDISPORT shutdownwhile [- x / proc/$ {PID}] doecho "Waiting for Redis to shutdown..." sleep 1doneecho "Redis stopped" fi;; status) PID=$ (cat $PIDFILE) if [!-x / proc/$ {PID}] thenecho 'Redis is not running'elseecho "Redis is running ($PID)" fi Restart) $0 stop $0 start;; *) echo "Please use start, stop, restart or status as first argument";; esac

You can know.

Start as / etc/init.d/redis_6379 start

Stop for / etc/init.d/redis_6379 stop

View status is / etc/init.d/redis_6379 status

The default binding IP of redis.config is 127.0.0.1, and the password is not set.

The installation starts. Check the status.

[root@zhangqinglei redis3-6379] # / etc/init.d/redis_6379 status

Redis is running (8236)

Currently running, the process ID is 8236

Go to the src directory and use redis-cli to test the connection

[root@zhangqinglei src] #. / redis-cli-h 127.0.0.1-p 6379

127.0.0.1 set first 6379 > 1

OK

127.0.0.1 purl 6379 > get first

"1"

127.0.0.1 6379 > keys *

1) "first"

Use exit to exit. So far, the installation has been successful.

This is the end of the introduction on "how to install stand-alone environment redis3.2 in centos7". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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: 232

*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

Development

Wechat

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

12
Report