redis-commander is a GUI for redis. To install, run
1 2 |
npm install -g redis-commander redis-commander |
[…]
redis-commander is a GUI for redis. To install, run
1 2 |
npm install -g redis-commander redis-commander |
[…]
To install Redis from source, run
1 2 3 4 5 6 7 8 |
cd /usr/local/src wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make sudo make install cd utils sh install_server.sh |
[…]
To install Redis on Plesk Debian/Ubuntu server, run
1 |
apt install -y redis-server redis-tools |
Enable and restart redis-server
1 2 |
systemctl enable redis-server systemctl restart redis-server |
Now install PHP Modules
1 |
apt install -y plesk-php70-redis plesk-php71-redis plesk-php72-redis plesk-php73-redis plesk-php74-redis |
After installing, you will see redis listed in phpinfo() page. […]
On Ununtu/Debian, install it with
1 |
apt -y install redis-tools |
To get stats, run
1 |
redis-cli --stat |
If your redis on differnt sevrer or use non standard port, then use
1 |
redis-cli -h HOSTNAME -p PORT --stat |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
root@ip-10-0-0-31:~# redis-cli -h news24redis.cylrbg.0001.use1.cache.amazonaws.com --stat ------- data ------ --------------------- load -------------------- - child - keys mem clients blocked requests connections 9287 20.58M 27 0 179271 (+0) 1208 9287 20.62M 27 0 179277 (+6) 1208 9288 20.67M 28 0 179377 (+100) 1209 9288 20.64M 28 0 179494 (+117) 1209 9292 20.71M 28 0 179823 (+329) 1210 9292 20.68M 28 0 179969 (+146) 1211 9298 20.74M 29 0 180033 (+64) 1212 9311 20.67M 28 0 180162 (+129) 1214 9314 20.69M 29 0 180198 (+36) 1215 9318 20.80M 30 0 180275 (+77) 1216 9318 20.68M 30 0 180280 (+5) 1216 9318 20.82M 31 0 180307 (+27) 1218 9319 20.74M 31 0 180321 (+14) 1218 9322 20.70M 29 0 180350 (+29) 1219 9324 20.80M 30 0 180377 (+27) 1220 9366 20.90M 30 0 180724 (+347) 1221 9368 20.77M 29 0 181086 (+362) 1221 9368 20.73M 27 0 181133 (+47) 1221 9372 20.73M 27 0 181487 (+354) 1222 9380 20.73M 27 0 181592 (+105) 1223 ------- data ------ --------------------- load -------------------- - child - keys mem clients blocked requests connections 9384 20.76M 28 0 181639 (+47) 1224 9391 20.77M 28 0 181718 (+79) 1224 9391 20.79M 27 0 181731 (+13) 1224 9391 20.67M 25 0 181771 (+40) 1224 9391 20.67M 25 0 181780 (+9) 1224 9391 20.67M 25 0 181849 (+69) 1224 ^C root@ip-10-0-0-31:~# |
INFO
1 |
redis-cli INFO |
If you want to see info about clients, run
1 |
redis-cli INFO clients |
Monitor To see what redis is doing, run
1 |
redis-cli monitor |
If your redis is running on remote […]
To install redis php module in Ubuntu 16.04, run
1 |
apt -y install php-redis |
If you are using Apache, restart Apache.
1 |
systemctl restart apache2 |
If php-fpm restart
1 |
systemctl restart php7.0-fpm |
You will see following in your phpinfo() […]
Install Redis on Plesk Debian Server Installing Redis PHP module CentOS 7 Connect to redis from PHP Monitor redis with redis-cli Install Redis from Source redis commander – Web GUI for Redis Checking if redis works
1 2 3 |
# telnet redis 6379 set testkey 10 get testkey |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 |
root@ip-10-0-0-31:~# telnet news24redis.cylrbg.0001.use1.cache.amazonaws.com 6379 Trying 10.0.0.223... Connected to news24redis.cylrbg.0001.use1.cache.amazonaws.com. Escape character is '^]'. set testkey 10 +OK get testkey $2 10 quit +OK Connection closed by foreign host. root@ip-10-0-0-31:~# |
Count Number of Keys To count number of keys, use
1 |
DBSIZE |
Example
1 2 3 4 5 6 |
root@ip-10-0-0-31:~# telnet news24redis.cylrbg.0001.use1.cache.amazonaws.com 6379 Trying 10.0.0.223... Connected to news24redis.cylrbg.0001.use1.cache.amazonaws.com. Escape character is '^]'. DBSIZE :4114 |
Here DBSIZE returned […]
To install Redis PHP module from source, run
1 2 3 4 5 6 |
cd /usr/local/src git clone https://github.com/phpredis/phpredis.git cd /usr/local/src/phpredis /usr/serverok/php-7.1.12/bin/phpize ./configure --with-php-config=/usr/serverok/php-7.1.12/bin/php-config make && make install |
Once installed, edit your php.ini file, add following below extension_dir line
1 |
extension=redis.so |
Verify redis is installed with php -m
1 2 3 |
[root@vps154294 ~]# /usr/serverok/php-7.1.12/bin/php -m | grep redis redis [root@vps154294 ~]# |
Now restart web server
1 |
service httpd restart |
phpinfo() will show following […]
Lets search for available redis packages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
[root@vps154294 smartfst]# yum search redis Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * epel: mirror.us.leaseweb.net * remi-safe: repo1.ash.innoscale.net ============================================================================================ N/S matched: redis ============================================================================================ collectd-redis.x86_64 : Redis plugin for collectd collectd-write_redis.x86_64 : Redis output plugin for collectd hiredis.x86_64 : Minimalistic C client library for Redis hiredis-devel.x86_64 : Development files for hiredis hiredis-last.x86_64 : Minimalistic C client library for Redis opensips-redis.x86_64 : Redis connector pcp-pmda-redis.x86_64 : Performance Co-Pilot (PCP) metrics for Redis perl-Apache-Session-Redis.noarch : Redis driver for Apache::Session::NoSQL perl-Redis.noarch : Perl binding for Redis database php-nrk-Predis.noarch : PHP client library for Redis php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php-phpiredis.x86_64 : Client extension for Redis php54-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php54-php-phpiredis.x86_64 : Client extension for Redis php55-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php55-php-phpiredis.x86_64 : Client extension for Redis php56-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php56-php-phpiredis.x86_64 : Client extension for Redis php70-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php70-php-phpiredis.x86_64 : Client extension for Redis php71-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php71-php-phpiredis.x86_64 : Client extension for Redis php72-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php72-php-phpiredis.x86_64 : Client extension for Redis python-redis.noarch : Python 2 interface to the Redis key-value store python-trollius-redis.noarch : Redis client for the Python event loop PEP3156 for Trollius. python2-django-redis.noarch : Full featured redis cache backend for Django redis-trib.noarch : Cluster management script for Redis rubygem-redis.noarch : A Ruby client library for Redis rubygem-redis-doc.noarch : Documentation for rubygem-redis syslog-ng-redis.x86_64 : redis support for syslog-ng uwsgi-logger-redis.x86_64 : uWSGI - redislog logger plugin uwsgi-router-redis.x86_64 : uWSGI - Plugin for Redis router support redis.x86_64 : A persistent key-value database Name and summary matches only, use "search all" for everything. [root@vps154294 smartfst]# |
In this server, we have PHP 7.0 installed. So we need to install packages for PHP 7.0 Here are the two packages for PHP 7.0
1 2 |
php70-php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php70-php-phpiredis.x86_64 : Client extension for Redis |
Install it with yum
1 |
yum install -y php70-php-pecl-redis.x86_64 php70-php-phpiredis.x86_64 |
Now you need to restart web server, generally restarting apache will do. In this cause PHP is […]
To install Redis on CentOS, run yum install redis Start redis with
1 |
service redis start |
Set redis to start on boot
1 |
systemctl enable redis |
Verify redis is running with
1 2 3 |
[root@vps154294 ~]# netstat -antp | grep redis tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 32367/redis-server [root@vps154294 ~]# |
[…]