CENTOS7/RHEL7 Installing Redis Steps

Source: Internet
Author: User
Tags install redis

CENTOS7/RHEL7 installing Redis steps centos7/rhel7 installing Redis or the first test installation, because CENTOS7 after the upgrade and CENTOS6 there is a big difference, let's take a look at centos7/ RHEL7 Installing Redis Steps

Method One: Install with the command (provided that Epel is already installed).

To install Redis:

Yum-y Install Redis

Start/stop/restart Redis
Start the service:
1
Systemctl Start Redis.service
Stop service:

Systemctl Stop Redis.service

Restart Service:


Systemctl Restart Redis.service

Check Status:


[Email protected] ~]# systemctl status Redis.service
Redis.service-redis Persistent Key-value Database
Loaded:loaded (/usr/lib/systemd/system/redis.service; enabled)
Active:active (running) since II 2014-10-21 21:37:22 EDT; 5h 26min ago
Main pid:30413 (Redis-server)
CGroup:/system.slice/redis.service
└─30413/usr/bin/redis-server 127.0.0.1:6379

October 21:37:22 idoseek.com systemd[1]: Started Redis persistent key-value database.

Start the service with the system:


[Email protected] ~]# Systemctl enable Redis.service
Ln-s '/usr/lib/systemd/system/redis.service '/etc/systemd/system/multi-user.target.wants/redis.service '

To turn off random startup:


[Email protected] ~]# systemctl disable Redis.service
RM '/etc/systemd/system/multi-user.target.wants/redis.service '

Method Two: Compile and install

Download Install compile:


# wget http://download.redis.io/releases/redis-2.8.17.tar.gz
# tar Xzf redis-2.8.17.tar.gz
# CD redis-2.8.17
# make
# make Install

To set the configuration file path:


# mkdir-p/etc/redis && CP Redis.conf/etc/redis

To modify a configuration file:


# vim/etc/redis/redis.conf
Modified to: Daemonize Yes
To start Redis:


#/usr/local/bin/redis-server/etc/redis/redis.conf
#关闭服务


REDIS-CLI shutdown

Or execute shutdown in the CLI


Redis 127.0.0.1:6379> shutdown

Clear Cache


REDIS-CLI Flushall

For more documentation, refer to the "README" file in the package.
View Status:

# Ss-nlp|grep Redis

Or

# Ps-ef | grep Redis

The following is an introduction to adding a Redis plugin to PHP .

Download the latest extension from official website, address: Http://pecl.php.net/package/redis or Https://github.com/phpredis/phpredis

#wget http://pecl.php.net/get/redis-2.2.5.tgz
#phpize
#./configure--prefix=/opt/redis--enable-redis--with-php-config=/opt/php/bin/php-config
#make && make Install

Add extension to php.ini and restart PHP-FPM:

Service PHP-FPM Restart

Http://www.111cn.net/sys/CentOS/85292.htm

CENTOS7/RHEL7 Installing Redis Steps

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.