Download the installation package, link: https://pan.baidu.com/s/13A1mDApAct31bYyRXOfaNg?pwd=l7kq Extraction code:l7kq
decompress
2. Linux system installation
Download the installation package https://download.redis.io/releases/, or my Baidu network disk also has: link: https://pan.baidu.com/s/1Z0LGJewCnVQidZLbTixPzQ?pwd=qxlv extraction code:qxlv
Upload the installation package to the Linux system, I use finalshellupload
Unzip the installation packagetar -zxvf redis-4.0.0.tar.gz -C /usr/local
Compile redis, enter the decompressed redis directory, and execute the command to compile:make
Enter its src directory and execute:make install
2. Start and connect
1. Windows system
Start: Click redis-server.exe, or enter the redis directory from the command line, and execute redis-server
Connection: Click redis-cli.exe, or command line to enter the redis directory, execute redis-cli
2. Linux system
Start the service: go to the src directory of redis and execute the command: ./redis-server. After installation, the service runs in the foreground by default, and there is a file in the same level directory as redis and src when configuring the background operation redis.config. Change the parameters in it daemonizeto yes
Connection: Go to the src directory of redis and execute the command:./redis-cli
3. Modify permissions
1. Windows system
Modify password: open redis.windows.configthe file, find it requirepass foobared, uncomment it, and replace foobared with your password. Or connect to redis, enter the command: config set requirepass 1234, the modification is successful when OK appears, and enter the command when connecting to redis later: redis-cli -a 密码.
Open connection permission: redis.windows.configfound in the file bind 127.0.0.1, just comment it out.
2. Linux system
Change password: redis.confFind requirepass foobaredit in the file, uncomment it, and replace foobared with your password. First turn off all services and then restart the service, and then pass the command: redis-cli -a 密码connect
Open connection permission: Found in the configuration file: bind 127.0.0.1, comment it out, because no comment means the default local connection. Restart the service, if you still can’t connect, it may be that the port is not open, open port 6379: firewall-cmd --zone=public --add-port=6379/tcp --permanent, refresh: firewall-cmd --reload, you can pass: firewall-cmd --zone=public --list-portscheck whether the port is opened successfully, and now other servers can connect to this redis.