Install redis on centos and enable the corresponding port service

Source: Internet
Author: User
Tags download redis install redis

1. Install centos 7. Remember to check the Web server or other tools with full functions during installation. Otherwise, the most basic ifconfig cannot be used.

2. Check whether iptables is available under/etc/sysconfig/. Check whether service iptables start can be started normally. If it cannot be started, use root user and Yum-install iptables to install the firewall.

3. After installation, there are two ways to allow external access: 1. Disable the firewall chkconfig iptables off (effective after restart) 2, open port access permission VI/etc/sysconfig/iptables add-A input-M state -- state new-m tcp-p tcp -- dport port number-J accept remember, this sentence must be added before reject.

4. Download redis and put it to the directory you want to install. Decompress tar-xfv redis.xxx.tar to enter the decompressed directory and enter make./install-server if there is a utils directory;

5. If the installation directory is not customized, the startup file will be under/usr/local/bin, and the configuration file will be under/etc/redis. You can edit the configuration file (whether to print the console, port number, database directory, etc.). By default, logs are stored in/var/log/redisxxx. log.

6. Enter/usr/local/bin/and enter ". /redis-server configuration file path ", for example :. /redis-server/etc/redis/reids. after entering the Config Key, you can start it.

7. Enter PS-Ef | grep redis to check whether the corresponding process exists. If no process exists, the configuration file may be modified incorrectly and can be corrected by yourself.

8. Enter./reids-CLI to access the client tool provided by redis.

9. Enter set user jacksparrow, and then get user to perform the test. Exit the quit input or press Ctrl + C.

10. If you want to stop the redis service,./redis-cli shutdown!
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.