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

Download and install redis automatically

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Since a colleague of the developer wants to play redis cache in his local virtual machine, he immediately wrote a script, which is now posted here, and friends in need can have a look: (this script roughly includes creating users and passwords, downloading, compiling and installing redis, modifying configuration files, and starting redis services, which is relatively simple).

# # install_redis.sh # #

#! / bin/bash

# define the function of create password

Create_passwd () {

A = (a b c d e f A B C D E F @ $0 1 2 3 4 5 6 7 8 9)

For ((iSuppli > / home/redis/redis_password.txt)

Echo $password | passwd-- stdin redis

# after download redis,compile and install redis

Yum-y install wget

Cd / root/src/ | | mkdir-p / root/src & & cd / root/src/

Wget http://download.redis.io/releases/redis-3.2.3.tar.gz

Tar xf redis-3.2.3.tar.gz

Cd / root/src/redis-3.2.3

Make

Make PREFIX=/usr/local/redis install

Cp / root/src/redis-3.2.3/redis.conf / usr/local/redis/

Sed-I 's/daemonize no/daemonize yes/g' / usr/local/redis/redis.conf

# change the authority of redis-installed dir and startup redis service

Chown-R redis:redis / usr/local/redis/

Su-redis

Cd / usr/local/redis/bin/

. / redis-server.. / redis.conf

Echo "welcome to use redis service"

Roughly so much, the specific script to show the beautification part, everyone according to their own aesthetic look, come here.

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

*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