Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

setup systemctl redis

1. Install pre-requisities

  `sudo apt-get install build-essential tcl`

2. Install Redis

  ```
  cd /tmp
  curl -O http://download.redis.io/redis-stable.tar.gz
  tar xzvf redis-stable.tar.gz
  cd redis-stable
  make
  make test
  sudo make install
  ```
  
3. Configure Redis

  ```
  sudo mkdir /etc/redis
  sudo cp /tmp/redis-stable/redis.conf /etc/redis
  sudo nano /etc/redis/redis.conf
  ```
  
  In the file, change the `supervised` directive`s value to `systemd`.
  
  ```
  ...
  supervised systemd
  ...
  ```
  
  Next, specify the working directory for Redis. This  is the directory that Redis will use to dump persistent data. We can use `/var/lib/redis`
  
  ```
  ...
  dir /var/lib/redis
  ...
  ```
  
  Save and close the file.
  
4. Configure systemd to start Redis on boot

  `sudo nano /etc/systemd/system/redis.service`
  
  Copy the contents of [this gist](https://gist.github.com/hackedunit/14690b6174708d3e83593ce1cdfb4ed8) to the file, save and close.

5. Create Redis user, group and directories

  ```
  sudo adduser --system --group --no-create-home redis
  sudo mkdir /var/lib/redis
  sudo chown redis:redis /var/lib/redis
  sudo chmod 770 /var/lib/redis
  ```

6. Start the Redis service and set Redis to start on boot

  ```
  sudo systemctl start redis
  sudo systemctl enable redis
  ```
 
Comment

PREVIOUS NEXT
Code Example
Shell :: redis install ubuntu 20.04 
Shell :: install cp in windows cmd 
Shell :: read file line loop in bash 
Shell :: boost volume in ubuntu 18.04 
Shell :: batch color escape character 
Shell :: undo most recent commit 
Shell :: change display resolution on terminal 
Shell :: port forward kubernetes 
Shell :: angular cli interface generate 
Shell :: linux bash temporary file 
Shell :: count new lines bash 
Shell :: run bash script linux with sudo password 
Shell :: github desktop arch linux 
Shell :: postinstall docker 
Shell :: $$ in shell script 
Shell :: read from .env file bash 
Shell :: The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER 
Shell :: git submodule add 
Shell :: linux hex to dec 
Shell :: How do I make a Git commit in the past 
Shell :: how to install wine in ubuntu 18.04 
Shell :: ssh with key 
Shell :: command to variable bash 
Shell :: boot pendrive cmd 
Shell :: git id 
Shell :: how to install pip ubuntu python2 
Shell :: git add ignored file 
Shell :: error: src refspec master does not match any 
Shell :: add local gitignore file 
Shell :: your repository has no remotes configured to push to 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =