Categories
REDIS

Redis MAC

brew update
brew install redis

To Start

brew services start redis

to stop 

brew services stop redis

Or, if you don’t want/need a background service you can just run:

redis-server /usr/local/etc/redis.conf

Test if Redis server is running.

redis-cli ping

If it replies “PONG”, then it’s good to go!

Location of Redis configuration file.

/usr/local/etc/redis.conf

Uninstall Redis and its files.

brew uninstall redis
rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Categories
Queues REDIS

Redis Practical commands

Redis Command Line

redis-cli -h 127.0.0.1 -p 6379

List keys

keys *

Show Value Key

mget "nameOfYourKey"
Categories
REDIS

Show all Redis keys

$ redis-cli KEYS '*'


Categories
Queues REDIS

Flush keys in Redis

redis-cli FLUSHALL
Categories
AWS REDIS Unix

How to install redis on AWS unix ec2 instance ?

 $ vi /etc/yum.repos.d/epel.repo

 [epel]
 name=Extra Packages for Enterprise Linux 6 - $basearch
 baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
 failovermethod=priority
 enabled=1
 gpgcheck=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Step 2: Clean all yum repo and update repolist:

$ yum clean all
$ yum repolist

Step 3: Install Redis on the server by running command

$ yum install redis 

Step 4: Check redis status

service redis status

service redis start
service redis stop
service redis restart

Categories
Queues REDIS

How to resolve laravel Connection refused [tcp://127.0.0.1:6379] ?

#1 inst all Redis on your mac as follow

brew install redis

Launch Redis on computer starts.

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

Start Redis server via “launchctl”.

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Start Redis server using configuration file.

$ redis-server /usr/local/etc/redis.conf

Stop Redis on autostart on computer start.

$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Location of Redis configuration file.

/usr/local/etc/redis.conf

Uninstall Redis and its files.

$ brew uninstall redis
$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Get Redis package information.

$ brew info redis

Test if Redis server is running.

$ redis-cli ping
Categories
REDIS Scalability

Using a Redis Server

Using a Redis Server

Redis Command line

 redis-cli -h 127.0.0.1 -p 6379

Helper

zincrby ‘trending_threads’ 1 ‘Some Thread Title’

zrange ‘trending_threads’ 0 -1

zrange ‘trending_threads’ 0 -1 WITHSCORES

zrange ‘trending_threads’ 0 -1