Install redis in Ubuntu

Source: Internet
Author: User
Tags download redis dotfiles install redis

(1) Go to the/usr/local directory.
CD/usr/local
If there is no local folder, create
Sudo mkdir/usr/local
Sudo chmod 777/usr/local
(2) download redis
Wget http://download.redis.io/releases/redis-2.8.12.tar.gz
Extract
Tar zxvf redis-2.8.12.tar.gz
Rename to: redis2.8
Music redis-2.8.12 redis2.8
(3) Compile,
CD/usr/local/redis2.8
Make
(4) check whether the compilation is successful
CD/usr/local/redis2.8/src
Make Test
If the following error is prompted, it is because Tcl is not installed.
You need TCL 8.5 or newer in order to run the redis Test
Make: *** [test] Error 1
Download and install Tcl in the/usr/local directory.
CD/usr/local
Wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
Extract
Tar zxvf tcl8.6.1-src.tar.gz
After decompression, compile
CD tcl8.6.1/Unix
./Configure
Make
Make install

After Tcl is installed, check whether the compilation is successful.

CD/usr/local/redis2.8

CD SRC

Make Test

If the result is as follows, the compilation is successful.

\ O/all tests passed without errors!

Cleanup: may take some time... OK

(5) Installation

CD/usr/local/redis2.8/src

Make install

(6) default directory of the redis command:/usr/local/bin/

Download the configuration file and startup script

 

Wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server
Wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf
Sudo MV redis-server/etc/init. d/redis-Server
Sudo chmod + x/etc/init. d/redis-Server
Sudo MV redis. CONF/etc/redis. conf

Create a user redis and create a new data and log folder

 

Sudo useradd redis
Sudo mkdir-P/var/lib/redis
Sudo mkdir-P/var/log/redis
Sudo chown redis. redis/var/lib/redis
Sudo chown redis. redis/var/log/redis

Set automatic start upon startup

Sudo update-rc.d redis-server defaults

Start redis

Sudo/etc/init. d/redis-Server start

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.