Redis Environment Setup

Source: Internet
Author: User
Tags benchmark download redis redis server

I. Ready-to-install packages

Windows virtual machine software: VMware Workstation Pro 12

Linux installation files: Centos-7-x86_64-minimal-1511.iso

Remote login Software: Putty-0.67-installer

Remote File replication software: Winscp577setup

Redis Software: redis-3.0.7.tar.gz

Two. VMware installs CentOS 7

Installing the minimal version of CentOS by default is not with the ifconfig command, we first installed: Yum install Net-tools. After the installation, look under the IP of our virtual machine.

.

Three. CentOS Installation Redis

1. First minimal version installed GCC editing environment: $ yum Install gcc

Open WinSCP, upload redis-3.0.7.tar.gz to/root/redis

2. Go to Redis directory to unzip:

$CD/root/redis

$tar ZXVF redis-3.0.7.tar.gz

3. Compiling:

$ CD redis-3.0.7

$make (if error make MALLOC=LIBC)

$make Install

$CP redis.conf/etc/

Parameter description:

When the make install command finishes executing, the executable is generated in the/usr/local/bin directory, respectively, Redis-server, REDIS-CLI, Redis-benchmark, Redis-check-aof, Redis-check-dump, they function as follows:

Redis-server:redis Server Daemon Startup program

Redis-cli:redis command-line operation tool. You can also use Telnet to manipulate it based on its plain text protocol.

Redis-benchmark:redis Performance Testing tool to test Redis's read and write performance under current system

REDIS-CHECK-AOF: Data Repair

Redis-check-dump: Check the Export tool

4. Modify the system configuration file, execute the command

A) echo Vm.overcommit_memory=1 >>/etc/sysctl.conf

b) Sysctl Vm.overcommit_memory=1 or perform echo Vm.overcommit_memory=1 >>/proc/sys/vm/overcommit_memory

Use numeric meanings:

0, indicates that the kernel will check for sufficient available memory to be used by the process, and if sufficient memory is available, the memory request is allowed; otherwise, the memory request fails and the error is returned to the application process.

1, which means that the kernel allows all physical memory to be allocated regardless of the current memory state.

2, which indicates that the kernel allows allocating more memory than the sum of all physical memory and swap space

5. Modifying a Redis configuration file

A) $ cd/etc

b) VI redis.conf

c) Modify Daemonize Yes---to enable the process to run in the background

d) Modify Requirepass 123456---uncomment, set password

Parameter description:

Daemonize: Whether to run daemon mode later

Pidfile:pid File Location

Port: Port number for listening

Timeout: Request time-out

Loglevel:log Information level

Logfile:log File Location

Databases: number of open databases

Save *: How often the snapshot is saved, the first * indicates how long, and the third * indicates how many times the write operation is performed. Snapshots are automatically saved when a certain number of writes are performed within a certain amount of time. You can set multiple conditions.

Rdbcompression: Whether to use compression

Dbfilename: Data Snapshot file name (only file name, excluding directory)

Dir: Save directory for Data snapshot (this is the directory)

AppendOnly: If the appendonlylog is turned on, each write will record a log, which will improve the data anti-risk ability, but affect the efficiency.

Appendfsync:appendonlylog How to sync to disk (three options, each write is forced to call Fsync, Fsync per second, do not call Fsync wait for the system to synchronize itself)

6. Start Redis

A) $ cd/usr/local/bin

b)./redis-server/etc/redis.conf

7. Check whether the start is successful

A) $ ps-ef | grep Redis

8. If it is a remote connection, sometimes because of a firewall cause can ping, but the client is not connected, need to shut down the firewall

$ systemctl Stop Firewalld.service #停止firewall

$ systemctl Disable Firewalld.service #禁止firewall开机启动

9. When the configuration is complete, we use Putty to start the client connection and the connection is successful.

10. Try a remote connection

Can download Redis-2.4.5-win32-win64, direct decompression, into DOS

Remote connection without password, can be connected, but not authorized to use Redis command, enter the password can be used normally.

This is where Windows uses virtual machines to build a REDIS environment!

Redis Environment Setup

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.