How To Install Redis On Windows 7
Organization: CentOS Linux release seven.9.2009 (Core)
ane. Installation of GCC
Since redis is adult in C language, yous must first confirm whether to install gcc environment (gcc -five) earlier installation. If non, execute the following control to install
course: https://www.cnblogs.com/huangshuqiang/p/15477407.html
two. Download and unzip the installation package
[root@mesnosql ~]# wget http://download.redis.io/releases/redis-6.ii.half dozen.tar.gz [root@mesnosql ~]# tar -zxvf redis-6.ii.half dozen.tar.gz
3. Switch CD to redis decompression directory and execute compilation
[root@mesnosql ~]# cd redis-6.2.6 [root@mesnosql redis-6.2.6]# make
4. Install and specify the installation directory
[root@mesnosql redis-6.2.6]# brand install PREFIX=/usr/local/redis
5. Start service - groundwork first
[root@mesnosql redis-6.2.half-dozen]# cd /usr/local/redis/bin/
Copy redis.conf from the redis source directory to the redis installation directory. PS: push button to ~ directory.
[root@mesnosql ~]# cp redis-6.2.half dozen/redis.conf /usr/local/redis/bin/
six. Modify the redis.conf configuration file. PS: re enter bin
[root@mesnosql bin]# vim redis.conf
There are three main modifications:
i). Add # comments before demark ; Unlimited ip admission. By default, it can only be accessed locally
two).
The default is yes and changed to no. Plow off the protected mode mode, and the external network can access it direct
3).
Daemon is used to specify whether redis should be started as a daemon thread. The default is no
vii. Offset redis
[root@mesnosql bin]# ./redis-server redis.conf
8. Set startup
root@mesnosql bin]# vi /etc/systemd/system/redis.service
Copy and paste the following:
[Unit] Description=redis-server After=network.target [Service] Type=forking ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf PrivateTmp=truthful [Install] WantedBy=multi-user.target
Note: ExecStart is configured as its own path
9. Ready startup
[root@mesnosql bin]# systemctl daemon-reload [root@mesnosql bin]# systemctl kickoff redis.service [root@mesnosql bin]# systemctl enable redis.service
10. Create redis command soft link
[root@mesnosql ~]# ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis
Test redis
At this point, redis installation is complete.
Service performance command
systemctl start redis.service # Start redis service
systemctl stop redis.service # Stop redis service
systemctl restart redis.service # Restart the service
systemctl status redis.service # View the current condition of the service
systemctl enable redis.service # Fix startup and self startup
systemctl disable redis.service # Stop startup and self startup.
Supplement 1: redis make reports an fault later upgrading GCC to the latest version. Solution:
Fault when making: / bin/sh: cc: command non found
solve:
ane. Go back to the root directory (~)
sudo yum -y install gcc gcc-c++ libstdc++-devel
2. When returning to the redis make directory, execute:
make MALLOC=libc
Supplement ii: when the firewall is turned on, the external network cannot be accessed
View open ports
firewall-cmd --list-ports
View firewall status
firewall-cmd --state
Plow on the firewall
systemctl outset firewalld
Open port
firewall-cmd --zone=public --add-port=6379/tcp --permanent
service iptables restart
firewall-cmd --reload
After opening the port, you must restart the firewall, otherwise opening the port volition not piece of work.
Conclusion: I have never been in contact with linux before. When installing redis, I encountered many problems. It took several days to install it successfully. Most of the installation tutorials on the Cyberspace are not proficient.
Finally, at each installation step, although there are sometimes a large serial of commands, yous must pay attention to whether there is an fault in it, otherwise in the end, redis will be confused if it can't be used.
reference resource:
https://www.cnblogs.com/heqiuyong/p/10463334.html
https://redis.io/download Official course
https://www.cnblogs.com/Crazy-Liu/p/14313017.html
https://blog.csdn.net/liyanhui1001/article/details/106589682
https://world wide web.cnblogs.com/xuliangxing/p/7151685.html
Source: https://programming.vip/docs/install-the-latest-version-of-redis-6.2.6.html
Posted by: kinneytryin1978.blogspot.com
0 Response to "How To Install Redis On Windows 7"
Post a Comment