Installation and considerations for Redis database

Source: Internet
Author: User

? Install the source package
[Email protected] ~]# tar-xf redis/redis-4.0.8.tar.gz-c.
[Email protected] ~]# CD redis-4.0.8/
[Email protected] redis-4.0.8]# yum-y install gcc gcc-c++
[[email protected] redis-4.0.8]# make && make install
[Email protected] redis-4.0.8]#./utils/install_server.sh
[Email protected] redis-4.0.8]# vim/etc/redis/6379.conf
Bind 192.168.4.40 #修改ip
6040 Port #修改端口
[Email protected] redis-4.0.8]# ln-s/etc/init.d/redis_6379/sbin/
[[email protected] redis-4.0.8]# redis_6379 stop
[[email protected] redis-4.0.8]# redis_6379 start
[Email protected] ~]# Ss-antulp | grep Redis
TCP LISTEN 0 128 192.168.4.40:6040 :Users: (("Redis-server", pid=4846,fd=6))
The following error is reported when you close redis with a script
[Email protected] ~]# Redis_6379-stop
Please use start, stop, restart or status as first argument
Workaround 1:[[email Protected] ~]# redis-cli-h 192.168.4.40-p 6040 shutdown
Workaround 2: You need to change the script file
[Email protected] ~]# vim/etc/init.d/redis_6379
8 redisport= "6040"
$CLIEXEC-H 192.168.4.40-p $REDISPORT shutdown
Once you've set it up, you can turn it off.
Such as:
[Email protected] ~]# Ss-antulp | grep Redis
TCP LISTEN 0 128 192.168.4.40:6040 :Users: (("Redis-server", pid=4846,fd=6))
Turn off Redis
[[email protected] ~]# redis_6379 stop
Stopping ...
Redis stopped

Setting the connection password
1. Modify the configuration file
[Email protected] ~]# vim/etc/redis/6379.conf
501 Requirepass 123446 (password)
After we set the secret, we use the script to close the file with the following error
[[email protected] ~]# redis_6379 stop
Stopping ...
(Error) Noauth Authentication required.
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
。。。。。。。。。。。
Workaround 1:
[Email protected] ~]# redis-cli-h 192.168.4.40-p 6040-a 123446 shutdown
Solution 2: Modify the script file
$CLIEXEC-H 192.168.4.40-p $REDISPORT-a 123446 shutdown
[[email protected] ~]# redis_6379 stop
Stopping ...
Waiting for Redis to shutdown ...
Redis stopped

Installation and considerations for Redis database

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.