Amazon linux install redis

feliperohdee / install-redis.sh

#! /bin/bash
# ##############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
# ##############################################
version=3.2.0
echo » ***************************************** «
echo » 1. Prerequisites: Install updates, set time zones, install GCC and make «
echo » ***************************************** «
# sudo yum -y update
# sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles \/etc/localtime
# sudo yum -y install gcc gcc-c++ make
echo » ***************************************** «
echo » 2. Download, Untar and Make Redis $version «
echo » ***************************************** «
cd /usr/local/src
sudo wget » http://download.redis.io/releases/redis- $version .tar.gz «
sudo tar xzf redis- $version .tar.gz
sudo rm redis- $version .tar.gz -f
cd redis- $version
sudo make distclean
sudo make
echo » ***************************************** «
echo » 3. Create Directories and Copy Redis Files «
echo » ***************************************** «
sudo mkdir /etc/redis /var/lib/redis
sudo cp src/redis-server src/redis-cli /usr/local/bin
echo » ***************************************** «
echo » 4. Configure Redis.Conf «
echo » ***************************************** «
echo » Edit redis.conf as follows: «
echo » 1: . daemonize yes «
echo » 2: . bind 127.0.0.1 «
echo » 3: . dir /var/lib/redis «
echo » 4: . loglevel notice «
echo » 5: . logfile /var/log/redis.log «
echo » ***************************************** «
sudo sed -e » s/^daemonize no$/daemonize yes/ » -e » s/^# bind 127.0.0.1$/bind 127.0.0.1/ » -e » s/^dir \.\//dir \/var\/lib\/redis\// » -e » s/^loglevel verbose$/loglevel notice/ » -e » s/^logfile stdout$/logfile \/var\/log\/redis.log/ » redis.conf | sudo tee /etc/redis/redis.conf
echo » ***************************************** «
echo » 5. Download init Script «
echo » ***************************************** «
sudo wget https://raw.github.com/saxenap/install-redis-amazon-linux-centos/master/redis-server
echo » ***************************************** «
echo » 6. Move and Configure Redis-Server «
echo » ***************************************** «
sudo mv redis-server /etc/init.d
sudo chmod 755 /etc/init.d/redis-server
echo » ***************************************** «
echo » 7. Auto-Enable Redis-Server «
echo » ***************************************** «
sudo chkconfig —add redis-server
sudo chkconfig —level 345 redis-server on
echo » ***************************************** «
echo » 8. Start Redis Server «
echo » ***************************************** «
sudo service redis-server start
echo » ***************************************** «
echo » Complete! «
echo » You can test your redis installation using the redis console: «
echo » $ /usr/local/redis- $version /src/redis-cli «
echo » redis> set foo bar «
echo » OK «
echo » redis> get foo «
echo » bar «
echo » ***************************************** «
read -p » Press [Enter] to continue. «
Читайте также:  Windows 10 pro insider preview 2021

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

FUT / install-redis.sh

1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
cd /tmp
wget http://download.redis.io/releases/redis-2.8.12.tar.gz
tar xzf redis-2.8.12.tar.gz
cd redis-2.8.12
make
3. Create Directories and Copy Redis Files
sudo mkdir /etc/redis
sudo mkdir /var/lib/redis
sudo cp src/redis-server src/redis-cli /usr/local/bin/
sudo cp redis.conf /etc/redis/
4. Configure Redis.Conf
sudo vim /etc/redis/redis.conf
[..]
daemonize yes
[..]
[..]
bind 127.0.0.1
[..]
[..]
dir /var/lib/redis
[..]
5. Download init Script
cd /tmp
wget https://raw.github.com/saxenap/install-redis-amazon-linux-centos/master/redis-server
6. Move and Configure Redis-Server
Note: The redis-server to be moved below is the one downloaded in 5 above.
sudo mv redis-server /etc/init.d
sudo chmod 755 /etc/init.d/redis-server
sudo vim /etc/init.d/redis-server
redis= » /usr/local/bin/redis-server «
7. Auto-Enable Redis-Server
sudo chkconfig —add redis-server
sudo chkconfig —level 345 redis-server on
8. Start Redis Server
sudo service redis-server start
// Taken from http://codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ and updated.

This comment has been minimized.

Copy link Quote reply

guumeyer commented Jul 9, 2015

Thanks, I’ve just change version redis from 2.8 to 3.02. It’s done.

This comment has been minimized.

Copy link Quote reply

ChristianRich commented Nov 11, 2015

My Amazon EC2 Linux instance is not able to register redis-server as a service:

$ sudo chkconfig —add redis-server
service redis-server does not support chkconfig

sudo chkconfig —level 345 redis-server on
service redis-server does not support chkconfig

What the fix for this?

This comment has been minimized.

Copy link Quote reply

Читайте также:  Улучшение windows 10 дизайн

yograterol commented Dec 8, 2015

Yes, I have the same problem that @ChristianRich

This comment has been minimized.

Copy link Quote reply

imam-san commented Mar 21, 2016

i have same problem ..
and this is what ive done ..
on dir /etc/init.d

systemctl start redis-server

systemctl enable redis-server

systemctl daemon-reload

This comment has been minimized.

Copy link Quote reply

ayoola-solomon commented Mar 21, 2016

This comment has been minimized.

Copy link Quote reply

JoshZA commented Apr 4, 2016

Consider setting the wget url to http://download.redis.io/releases/redis-stable.tar.gz

This comment has been minimized.

Copy link Quote reply

meltonpineda commented Jun 14, 2016

Thanks for this nice script!

This comment has been minimized.

Copy link Quote reply

rajkumar-surnar commented Jun 20, 2016

Thanks for the script.

This comment has been minimized.

Copy link Quote reply

dpayne9000 commented Jul 12, 2016

script is clean bro

This comment has been minimized.

Copy link Quote reply

anil614sagar commented Jul 20, 2016

Thank you for the script

This comment has been minimized.

Copy link Quote reply

stevenvergenz commented Nov 20, 2016

The built binaries will segfault if you just move them. Instead run sudo make install .

Источник

khelll / install-redis.sh

#! /bin/bash
# ##############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
# ##############################################
version=3.2.0
echo » ***************************************** «
echo » 1. Prerequisites: Install updates, set time zones, install GCC and make «
echo » ***************************************** «
# sudo yum -y update
# sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles \/etc/localtime
# sudo yum -y install gcc gcc-c++ make
echo » ***************************************** «
echo » 2. Download, Untar and Make Redis $version «
echo » ***************************************** «
cd /usr/local/src
sudo wget » http://download.redis.io/releases/redis- $version .tar.gz «
sudo tar xzf redis- $version .tar.gz
sudo rm redis- $version .tar.gz -f
cd redis- $version
sudo make distclean
sudo make
echo » ***************************************** «
echo » 3. Create Directories and Copy Redis Files «
echo » ***************************************** «
sudo mkdir /etc/redis /var/lib/redis
sudo cp src/redis-server src/redis-cli /usr/local/bin
echo » ***************************************** «
echo » 4. Configure Redis.Conf «
echo » ***************************************** «
echo » Edit redis.conf as follows: «
echo » 1: . daemonize yes «
echo » 2: . bind 127.0.0.1 «
echo » 3: . dir /var/lib/redis «
echo » 4: . loglevel notice «
echo » 5: . logfile /var/log/redis.log «
echo » ***************************************** «
sudo sed -e » s/^daemonize no$/daemonize yes/ » -e » s/^# bind 127.0.0.1$/bind 127.0.0.1/ » -e » s/^dir \.\//dir \/var\/lib\/redis\// » -e » s/^loglevel verbose$/loglevel notice/ » -e » s/^logfile stdout$/logfile \/var\/log\/redis.log/ » redis.conf | sudo tee /etc/redis/redis.conf
echo » ***************************************** «
echo » 5. Download init Script «
echo » ***************************************** «
sudo wget https://raw.github.com/saxenap/install-redis-amazon-linux-centos/master/redis-server
echo » ***************************************** «
echo » 6. Move and Configure Redis-Server «
echo » ***************************************** «
sudo mv redis-server /etc/init.d
sudo chmod 755 /etc/init.d/redis-server
echo » ***************************************** «
echo » 7. Auto-Enable Redis-Server «
echo » ***************************************** «
sudo chkconfig —add redis-server
sudo chkconfig —level 345 redis-server on
echo » ***************************************** «
echo » 8. Start Redis Server «
echo » ***************************************** «
sudo service redis-server start
echo » ***************************************** «
echo » Complete! «
echo » You can test your redis installation using the redis console: «
echo » $ /usr/local/redis- $version /src/redis-cli «
echo » redis> set foo bar «
echo » OK «
echo » redis> get foo «
echo » bar «
echo » ***************************************** «
read -p » Press [Enter] to continue. «
Читайте также:  Пакет обновлений для windows 2003 sp2

This comment has been minimized.

Copy link Quote reply

iainlbc commented Jan 6, 2017

Thanks, needed up something up quickly for hackathon and this came in handy 👍

This comment has been minimized.

Copy link Quote reply

adityamertia commented Jan 11, 2018

Hi,
I used version=4.0.6 the latest version.
Ran this script and the compilation was done smoothly, however while service starting it was stuck at a point listed below. If i check the redis server was up and running but im not sure why i had to CTRL-C to exit the program. I did not see «Press [ENTER] to continue. «

2018-01-11 11:31:36 (36.1 MB/s) — ‘redis-server’ saved [2025/2025]

  1. Move and Configure Redis-Server
  1. Auto-Enable Redis-Server
  1. Start Redis Server

Starting redis-server (via systemctl):
^C

This is where its stuck and i had to press CTRL-C to come out. Am i missing something?

This comment has been minimized.

Copy link Quote reply

dleber commented Jun 17, 2018

Thanks for the script.

Just a couple tips in case it helps others.

I was using version 4.0.1 & Amazon Linux, and found redis-cli located at:
/usr/local/src/redis-$version/src/redis-cli
Instead of (line 62)
/usr/local/redis-$version/src/redis-cli

I also adjusted $PATH by adding the following in the

/.bashrc file:
export PATH=»$PATH:/usr/local/src/redis-4.0.1/src»
And finally I refreshed the change with
source

Now I can start the client any time with
redis-cli

This comment has been minimized.

Copy link Quote reply

jpickwell commented Oct 29, 2018

@dleber, you don’t need that since redis-server and redis-cli are copied to /usr/local/bin which should already be on your PATH . I don’t know why the test text refers to the source directory. It should just say redis-cli without any path.

Источник

Оцените статью