CENTOS7/RHEL7 installation Redis Steps detailed

Source: Internet
Author: User
Tags fpm redis install redis
CENTOS7/RHEL7 Installation Redis steps detailedCENTOS7/RHEL7 installation Redis or the first test installed, because CENTOS7 upgrade and CENTOS6 have a big difference, the following we will look at CENTOS7/RHEL7 installation Redis steps detailed

method One: Use the command to install (if Epel is already installed).

Install Redis:

Yum-y Install Redis

Start/stop/reboot Redis

Join power-on Boot
Systemctl Enable Redis
Start the Redis service process
Systemctl Start Redis

To start the service:
1
Systemctl Start Redis.service
Stop service:

Systemctl Stop Redis.service

Restart Service:


Systemctl Restart Redis.service

Check Status:


[Root@idoseek ~]# 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 database.

To start the service with the system:


[Root@idoseek ~]# Systemctl Enable Redis.service
Ln-s '/usr/lib/systemd/system/redis.service '/etc/systemd/system/multi-user.target.wants/redis.service '

Turn off random boot:


[Root@idoseek ~]# systemctl Disable Redis.service
RM '/etc/systemd/system/multi-user.target.wants/redis.service '

method Two: Compile the installation

Download Installation compilation:


# 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
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

Here's a description of adding Redis plug-ins for PHP .

Download the latest expansion from the 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 expansion to PHP.ini, restart PHP-FPM:

Service PHP-FPM Restart

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


Http://www.cnblogs.com/Leo_wl/p/5484163.html

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.