Linux installation Redis and extranet access

Source: Internet
Author: User
Tags download redis redis server

1. Download Redis, the latest version is redis-3.2.1.tar.gz

2. Upload to Linux, unzip to/usr/local/below, command: TAR-ZXVF redis-3.2.1.tar.gz

3. We need to authorize redis because we want to use it in an external network and enter the redis.conf file

Modify several configurations: VI redis.conf

A) comment out the native of the binding,

b) Set Redis-service as background service

c) Set the password for the REDIS-CLI connection to the Redis server

d) Exit Save: Command: wq!

4. Start the Redis server, under the Redis directory, Redis-service redis.conf

View process, PS-EF | grep Redis

5.REDIS-CLI the Redis client to connect to the server and test whether it can be connected successfully.

-H is the abbreviation for the host ip,host of the connection,-P is the abbreviation for Port ports, and after-A is the abbreviation for the password (configured after Requirepass) auth

See the 6379 above to indicate the connection was successful.

By entering Ping, the server returns Pong,redis is case-insensitive and exit is quit.

6. How does the extranet test connect to a Redis server, first requiring a firewall to allow Redis Port 6379 to open up.

A) iptables-i INPUT 4-p tcp-m State--state new-m TCP--dport 6379-j ACCEPT
#允许6379端口
b) Service Iptables save #保存iptables规则

c) IPTABLES-NVL view rules for iptables tables

Ps-ef | grep Redis Find the process number of Redis, kill kill-9 PID, restart Redis service, Redis-service redis.conf,

7. On the outside of the computer, cmd--->telnet 121.43.xx.110 space 6379 Note the space, if a black screen appears to indicate that the extranet can access the Redis server

My command is wrong, telnet 121.43.xx.110 6379 IP corresponds to the IP of your Linux host

Here is a simple example of a redis, the code is reference to others, I modified the access to Redis use the password place.

The following code comes from:

Http://www.cnblogs.com/edisonfeng/p/3571870.html

Linux installation Redis and extranet access

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.