Linux to build the cache servers

table of Contents

1 Redis installation

1.1 Redis installation

1.2 connecting redis

1.2.1 redis start:

Redis 1.2.2-cli

1.3 Redis five data types

1.4 Configuration GUI

1.4.1 connection

1.4.2 successfully connected


1 Redis installation

1.1 Redis installation

Redis is c language development.

Description is built environment

Install redis need c compiler environment language. If you do not need to install gcc online. Yum install gcc-c ++

Which you agree to

installation steps:

The first step: redis source package uploaded to the linux system.

Step two: Unpack redis.

Step Three: compiler. make

Do not test, they give you download the package can not be wrong, even if wrong, it will not change, generally can not be wrong, wrong is not the environment you

Step four: Install. make install PREFIX = / usr / local / redis

1.2 connecting redis

1.2.1 redis start:

Front-end start: [root @ localhost bin] # ./redis-server

Reception did not start operating a general background to start several Ctrl + c to exit

Background start:

Copy the /root/redis-3.0.0/redis.conf to the next / usr / local / redis / bin directory

[root@localhost redis-3.0.0]# cp redis.conf /usr/local/redis/bin/

Modify the configuration file:

[root@localhost bin]# ./redis-server redis.conf

Yes the background is changed to start, no one inside the box

View redis process:

[Root @ localhost bin] # ps aux | grep repeat

root      5190  0.1  0.3  33936  1712 ?        Ssl  18:23   0:00 ./redis-server *:6379    

root 5196 0.0 0.1 4356 728 pts / 0 S + 18:24 0:00 grep Fredis

[root@localhost bin]#

Redis 1.2.2-cli

Close redis: [root @ localhost bin] # ./redis-cli shutdown

The default connection localhost running redis 6379 port services.

[root@localhost bin]# ./redis-cli -h 192.168.25.153 -p 6379

-h: address of the server connection

-p: Port number services

1.3 Redis five data types

String: key-value (do caching)

Hash: key-fields-values ​​(do caching)

List: sequential repeat

Set: No order can not be repeated

SortedSet (zset): sequential, can not be repeated

1.4 Configuration GUI

1.4.1 connection

1.4.2 successfully connected

Published 237 original articles · won praise 20 · views 20000 +

Guess you like

Origin blog.csdn.net/ZGL_cyy/article/details/105293892