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

Redis Learning 1 Murray-single Node installation configuration

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

Share

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

1. Install the basic package

Yum install gcc gcc-c++-y

2. Compile and install redis

Mkdir-p / data/usr/src

Tar-zxf redis-4.0.11.tar.gz-C / data/usr/src

Cd / data/usr/src/redis-4.0.11

Make PREFIX=/data/usr/redis-4.0.11 install MALLOC=libc

Mkdir / data/usr/redis-4.0.11/ {run,conf,logs,data}

Cp / data/usr/src/redis-4.0.11/redis.conf / data/usr/redis-4.0.11/conf/

3. Configure redis

Vi / data/usr/redis-4.0.11/conf/redis.conf

Bind IP, bind 127.0.0.1 to access the native machine, bind 192.168.121.121 to access external services

Bind 127.0.0.1

> >

Bind 127.0.0.1 192.168.121.121

# whether to run as a background daemon. Default is no. Values include yes and no.

Daemonize no

> >

Daemonize yes

# path for storing pid files

Pidfile / var/run/redis_6379.pid

> >

Pidfile / data/usr/redis-4.0.11/run/redis_6379.pid

# log file path

Logfile ""

> >

Logfile "/ data/usr/redis-4.0.11/logs/redis.log"

# path where database snapshot files are placed

Dir. /

> >

Dir / data/usr/redis-4.0.11/data

# set the redis service password. If enabled, the client needs to specify a password when connecting, otherwise the operation will indicate no permission.

# requirepass foobared

> >

Requirepass Redis2019!

Set environment variabl

Set env

Cat / etc/profile

REDIS_HOME=/data/usr/redis-4.0.11

Export PATH=\ $PATH:\ $REDIS_HOME/bin

EOF

Source / etc/profile

4. Start and stop the service

Start

Redis-server / data/usr/redis-4.0.11/conf/redis.conf

Stop it

Redis-cli-a Redis2019! Shutdown

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