Redis is installed on a CentOS

Redis is installed on centos.

Yum install Redis 1.   - to see if there redis yum source

[root@localhost ~]# yum install redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.optus.net
 * extras: mirrors.cn99.com
 * updates: mirror.bit.edu.cn
No package redis available.
Error: Nothing to do

  

Yum install epel-Release 2.  - Download fedora warehouse of epel

[root@localhost ~]# yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.optus.net
 * extras: mirrors.cn99.com
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                             Arch                          Version                     Repository                     Size
===================================================================================================================================
Installing:
 epel-release                        noarch                        7-11                        extras                         15 k

Transaction Summary
===================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                        1/1
  Verifying  : epel-release-7-11.noarch                                                                                        1/1

Installed:
  epel-release.noarch 0:7-11

Complete!

3 .yum install redis          --安装Redis

[root@localhost ~]# yum install redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                        | 6.8 kB  00:00:00
 * base: mirror.optus.net
 * epel: hkg.mirror.rackspace.com
 * extras: mirrors.cn99.com
 * updates: mirror.bit.edu.cn
epel                                                                                                        | 5.4 kB  00:00:00
(1/3): epel/x86_64/group_gz                                                                                 |  88 kB  00:00:00
(2/3): epel/x86_64/primary_db                                                                               | 6.8 MB  00:00:01
(3/3): epel/x86_64/updateinfo                                                                               | 996 kB  00:00:02
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:3.2.12-2.el7 will be installed
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: redis-3.2.12-2.el7.x86_64
--> Running transaction check
---> Package jemalloc.x86_64 0:3.6.0-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                        Arch                         Version                              Repository                  Size
===================================================================================================================================
Installing:
 redis                          x86_64                       3.2.12-2.el7                         epel                       544 k
Installing for dependencies:
 jemalloc                       x86_64                       3.6.0-1.el7                          epel                       105 k

Transaction Summary
===================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 648 k
Installed size: 1.7 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/jemalloc-3.6.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for jemalloc-3.6.0-1.el7.x86_64.rpm is not installed
(1/2): jemalloc-3.6.0-1.el7.x86_64.rpm                                                                      | 105 kB  00:00:00
(2/2): redis-3.2.12-2.el7.x86_64.rpm                                                                        | 544 kB  00:00:00
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              733 kB/s | 648 kB  00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <[email protected]>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : jemalloc-3.6.0-1.el7.x86_64                                                                                     1/2
  Installing : redis-3.2.12-2.el7.x86_64                                                                                       2/2
  Verifying  : redis-3.2.12-2.el7.x86_64                                                                                       1/2
  Verifying  : jemalloc-3.6.0-1.el7.x86_64                                                                                     2/2

Installed:
  redis.x86_64 0:3.2.12-2.el7

Dependency Installed:
  jemalloc.x86_64 0:3.6.0-1.el7

Complete!

4.  Service redis Start - start redis Service

5. The  redis-CLI - enter redis

[root@localhost ~]# ps -ef | grep redis
root      14823  14725  0 19:41 pts/1    00:00:00 grep --color=auto redis
[root@localhost ~]# service redis start
Redirecting to /bin/systemctl start redis.service
[root@localhost ~]# ps -ef | grep redis
redis     14840      1  0 19:42 ?        00:00:00 /usr/bin/redis-server 127.0.0.1:6379
root      14844  14725  0 19:42 pts/1    00:00:00 grep --color=auto redis
[root@localhost ~]# redis-cli
127.0.0.1:6379> ?
redis-cli 3.2.12
To get help about Redis commands type:
      "help @<group>" to get a list of commands in <group>
      "help <command>" for help on <command>
      "help <tab>" to get a list of possible help topics
      "quit" to exit

To set redis-cli perferences:
      ":set hints" enable online hints
      ":set nohints" disable online hints
Set your preferences in ~/.redisclirc  

6. the shutdown shut down service

127.0.0.1:6379> shutdown SAVE
not connected>
not connected>
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>
[root@localhost ~]# ps -ef | grep redis
root      14903  14725  0 20:24 pts/1    00:00:00 grep --color=auto redis

  

shutdown command may be followed by modifiers

SAVE modifiers and NOSAVE

    • By using the optional modifiers, you can modify the performance SHUTDOWN command. For example:
    • SHUTDOWN SAVE execution will force the database to perform a save operation, even if not set (configure) save point
      execution SHUTDOWN NOSAVE prevent the database to perform a save operation, even if you have one or more set points saved (you can use this regarded as is a hypothetical ABORT command forcibly stopped the server)

  

 

  

  

 

Guess you like

Origin www.cnblogs.com/julymaple/p/11305374.html