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

How to install Redis3.0 in CentOS environment

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to install Redis3.0 in CentOS environment". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The online unified chat and push system redis version 2.8.6 has been running well for nearly a year. The reason for testing redis3.0 is that 3.0has many new features compared with 2.8:

Redis cluster-- A distributed redis implementation

The new "embedded string" object coding results with less cache loss and a significant increase in speed under specific workloads

Aof child-> parent final data transfer minimizes latency through "last write" in the aof rewrite process

Greatly improved lru approximation algorithm for key erasure

The wait command jams waiting for write operations to be transferred to a specified number of slave nodes

Migrate connection cache, greatly increasing the speed of key migration

New parameters copy and replace for migarte

Client pause command: stops processing client requests within a specified time

Bitcount performance improvement

Config set accepts memory values from different units, such as "config set maxmemory 1gb".

The redis log format adjusts the role used to reflect the instance (master/slave)

Incr performance improvement

Keep an exploratory mind to technology while you are young!

Start installation

1. Install the dependency package

The copy code is as follows:

[root@localhost ~] # yum install gcc gcc-c++ kernel-devel automake autoconf libtool make wget tcl vim ruby rubygems unzip php-devel git-y

2. Install the redis server

No. / configure, just compile it without make install

[root@localhost ~] # wget http://download.redis.io/releases/redis-3.0.6.tar.gz[root@localhost ~] # tar xzf redis-3.0.6.tar.gz [root@localhost ~] # cd redis-3.0.6 [root@localhost redis-3.0.6] # make [root@localhost redis-3.0.6] # src/redis-server

3. Use redis client to test

[root@localhost redis-3.0.6] # src/redis-cli127.0.0.1:6379 > set key valok127.0.0.1:6379 > get key "val" 127.0.0.1 set key valok127.0.0.1:6379 6379 > del key (integer) 1127.0.1 purl 6379 > exists key (integer) 0

4. Install phpredis to make it easy to use php to operate redis

Download address of phpredis:

[root@localhost ~] # unzip phpredis-develop.zip [root@localhost ~] # cd phpredis-develop [root@localhost phpredis-develop] # phpize [root@localhost phpredis-develop] #. / configure [root@localhost phpredis-develop] # make & & make install

Hint: installing shared extensions: / usr/lib64/php/modules/

Vi / etc/php.ini

Join

Extension=redis.so

Restart apache

Service httpd restart

5. Php connection redis code test

This is the end of the content of "how to install Redis3.0 in CentOS". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

*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

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report