Ubuntu 16.04 Installation Redis (source installation) ZZ

Source: Internet
Author: User
Tags download redis install redis

This article is reproduced from:

Http://www.linuxdiyf.com/linux/22527.html

Redis is an open source API that is written in ANSI C, supports the web, can be persisted in memory, key-value databases, and provides multiple languages. This document documents the steps to install Redis on Ubuntu 16.04. Redis defaults to the Ubuntu repository and can be installed using apt: sudo apt install redis-server but not the latest version in the Repository, I compiled the installation from the source code in order to use the newest redis. First, install the Basic build tool: sudo apt install build-essential tcl 1) Download Redis source code: $ cd/tmp$ Curl-o http://download.redis.io/redis-stable . tar.gz 2) Unzip the TAR package: $ tar xzvf redis-stable.tar.gz 3) Compile and install: CD redis-stable$ make$ make test$ sudo make install 4) Configure Redis: Create R Edis configuration directory/etc/redis:$ sudo mkdir/etc/redis copy profile: $ sudo cp/tmp/redis-stable/redis.conf/etc/redis edit config file: $ sudo vim/etc /redis/redis.conf find supervised row, change No to systemd:supervised systemd

Locate dir line, save directory for configuration database: Dir/var/lib/redis

Save exit. 5) Create the SYSTEMD unit file: Configure Redis as a system service. Create Redis.service file: $ sudo vim/etc/systemd/system/redis.service writes the following: [Unit]description=redis in-memory Data storeafter=network.target[service]user=redisgroup=redisexecstart=/usr/local/bin/redis-server/etc/redis/ REDIS.CONFEXECSTOP=/USR/LOCAL/BIN/REDIS-CLI Shutdownrestart=always[install]wantedby=multi-user.target Save the exit file. 6) Create Redis users, groups, and directories: Create Redis Users and groups: $ sudo adduser--system--group--no-create-home redis Create a database directory corresponding to the configuration above: $ sudo mkdir/var/ lib/redis$ sudo chown redis:redis/var/lib/redis$ sudo chmod 770/var/lib/redis 7) Start Redis service: $ sudo systemctl start redis$ sudo systemctl enable Redis

Restart Service: $ sudo systemctl restart Redis 8) test: Use the command line client Connection Redis service: $ REDIS-CLI Test connectivity Status: Set up Redis authentication password: http://www.linuxdiyf.com/ Linux/22528.htmlredis Document: Http://redis.io/documentation

Ubuntu 16.04 Installation Redis (source installation) ZZ

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.