Skip to main content

Redis on Linux Server



From this post, I am starting a series of posts/pages which will mostly based on caching (recently i read this blog and found out quite simple to understand about what and why we need caching) mechanism like Redis, Memcache, Apc, Varnish are the few to list. So, here on this post i am going to cover REDIS first. After reading this post, you will get to know

                                                     
                                                               
What is Redis ?


So, Redis is "no-sql" database which is used to stores data as keys. which is mainly used as database,as caching for website across the globe. NoSql means, there is no structure query language like mysql in redis, instead its data structure.


                                                         
Where it is Beneficial ?


Many of the website are using redis to fasten their response time to the end user using the advantages of redis. So if you want your website should serve as fast as possible then you should think of using redis in your environment.

But for beginners the question is ? how redis does that ? so the simplest answer i can give is 
when you visit any website for first time, your browser sends a request to the server asking for data
the server in return get the data from the application/database hosted on server and provides to browser and then to you.

This is the normal situation, where there is only browser-server in back-end application (may be php) and database (may be mysql)

but when redis is in use, browser send the request to the server, it then check whether the request which browser has made is available in redis database or not (means cache here) , if the data presents then it get served to the browser from redis itself , so here asking data from application/database gets eliminated.

so the total computation power needed for any application/database to generate requested data for the browser get saved. This situation is very much needed in environment   serving lots of users like some big social media sites and eCommerce sites.

(Recently i read this blog and found out quite simple to understand about what and why we need caching)
                                               
How to install Redis ? (Centos/Rhel/Ubuntu)

                                
So, let move towards installation of redis on (Centos/Rhel/Ubuntu). For this you will need,
  • Linux server (Centos/Rhel/Ubuntu)
  • Root login to the server or Sudo login 
  • Internet to the server


By RPM Method :-



Step 1 :  In order to install redis on Linux server , you would need to install the some online repository first on the server containing the redis package. 

Run below command as root/sudo, it will download the rpm package for repo on your machine.


Step 2 : Now, install it using below command.



Which means your redis package is installed now on your linux machine using rpm method.



By YUM Method :-



Step 1 :  For yum method, we first need to install repository containing the redis package by running below command



it will create "epel.repo" file under /etc/yum.repos.d/



That its redis is installed on your server now using yum method. Only difference between rpm method and yum method is yum finds the dependecny of package required for redis to get it install.

means if redis also need to redis-server package to run properly then yum will install both at the same time.But rpm will not do it, instead it will install only redis package on the server.


                                                               
Status Check

Next thing is to check how to verify redis is working properly or not, so to check that we have to run below commands



commands explains it all, but thats command will run only on Centos/RHEL server upto OS version 6. For RHEL/Centos 7 there will be different commands to run.


You can watch below video for to know about redis installation on linux machine and some troubleshooting skills while installing it.

Go and watch and do not forgot to share the post if you like it.






Comments

Post a Comment

Popular posts from this blog

Multiple instances of redis

In the last post I have covered how to install redis server on Centos/Rhel using rpm method and yum method and some troubleshooting skills. In this post i am going to cover how to install and configure redis to run with multiple ports.                                                                           But why we need more ports ? If you have read my earlier post , you already know that by default redis runs on single port 6379, which any one can use it for small website to cache the data. But for heavy website like magento we need to use additional ports along with 6379 to serve different cache from different ports. Like in Magento there is simple cache which is normally stored under /var/cache directory. Then there is Full Page Cache which is stored under /var/full_page_cache...

arbtd: Package isn't signed with proper key

  If you are System Admin and worked on linux machine or servers in your current job or in past. Chances are you might come across linux service abrtd, even if you have not worked on it. but might be through some other work. same thing happened to me, while I was doing my regular work of installing php packages on linux  servers , i came across this error for which spent couple of hours actually to resolve it. T he error was 

Resolving IP SKU Requirements When Adding Azure VMs to Load Balancers

When it comes to configuring Azure Virtual Machines (VMs) within a Load Balancer (LB) environment, there are essential requirements that need to be addressed to ensure optimal performance and reliability. One common challenge faced by Azure users is the necessity of configuring IP SKUs correctly. In this blog post, we'll explore this requirement, its importance, and provide a solution to address it effectively. Understanding the IP SKU Requirement   The IP SKU (Service Key Update) requirement plays a pivotal role in the proper functioning of your Azure infrastructure, particularly within the context of Load Balancers. Here's what you need to know : IP Should Be in Standard SKU When adding Azure VMs to a Load Balancer, it's highly recommended to utilize public IP addresses configured with the Standard SKU. The Standard SKU offers an array of advanced capabilities, including enhanced traffic management and load balancing options. By using Standard SKU, you ensure a higher deg...