A mounting redis
. 1, provided warehouse address the redis, Run:
yum the install EPEL-Release
appears under FIG i.e. successfully set
2, mounted redis
run the following command:
yum the install redis
. 3, starting redis
-Service redis Start
. 4, disposed at startup , execute the command: chkconfig Redis ON
5, if you want to access the database remotely, you need to open firewall port, the command is as follows:
firewall-cmd = --zone public --add-port = 6379 / tcp --permanent
6, set to open firewall ports the entry into force command is as follows:
firewall-cmd --reload
7, view all open firewall ports, command is as follows:
firewall-cmd --list
8, set up remote access, you need to modify the configuration file, first find the location redis.conf configuration files:
whereis redis.config
9, modify redis.conf configuration file, execute the command:
vi /etc/redis.conf
into the file, find bing 127.0.0.1 field, comment out the row, as shown:
If you need to modify the database password in redis.conf configuration file, locate requirepass foobared field, foobared changed the password to be set, then save and exit.
10, save and exit, (press ESC, then: number, enter WQ)
WQ
11, setup is complete, re-redis database, execute the command:
Service redis restart
Second, the test redis
1, redis enter the interactive command line, execute the command:
redis the -cli
2, the database data is added, Run:
SET 'A' 'B'
search data, execute the command: GET 'A'
. 3, when the result appears on the map, the installation is complete.
4. Remote Connection
Redis modify configuration files
The redis.conf in the redis.conf bind127.0.0.1 comment out this line, any IP can access; find the protected-mode yes instead protected-mode no; saved after the restart redis
----------------
Disclaimer: This article is CSDN bloggers, "Mr. Fu seven" original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source and link this statement.
Original link: https: //blog.csdn.net/a575553272/java/article/details/79743802