------ body content display, start to learn new knowledge ------
Sometimes build in the construction of more than one of the same site when found Redis share triggered data conflicts, then we can open through the Redis multi-open to solve this problem!
Implementing multiple instances of redis based on multiple ports:
1, open the panel to install redis, and configure the use of the maximum memory, for example, the test server here is 4G memory, here chose 512M memory for redis use, configured to restart redis (if it is a production environment, at your own discretion, whether you can restart as well as limit the maximum memory).
2. Make a copy of redis in accordance with the good
The commands are as follows:
\cp -rp /www/server/redis/ /www/server/redis6378
3. Release port 6378 (can be assigned according to your actual port usage)
4, open the file manager, into the /www/server/redis6378 directory below
Open redis.conf and change the port in the configuration file to 6378.
5, modify the redis pid, log, data storage directory
Save after modification
6, delete the previous redis generated log and pid file (see the path)
7. Start and verify the startup command:
/www/server/redis6378/src/redis-server
/www/server/redis6378/redis.conf
The new Redis is now up and running!
Lastly to add to the supplement, if there is cached data within the redis that is copied over, it will still cause the data to be misplaced at the later site.
So you need to newly open redis under the corresponding port to clean the cache.
1. Ensure that the process survives first ps -ef|grep redis
2. Execute . /redis-cli or . /redis-cli -h 127.0.0.1 -p 6388maybe6389(Port number is based on self-set)Go to the newly opened redis instance
3. Execute the dbsize command
127.0.0.1:6388> dbsize
4. cleanup 127.0.0.1:6388> flushall
5. exit 127.0.0.1:6388> exit
6. Repeat 2-5 for multiple instances (note port numbers)
2024-08-16 21:39:48
Please note that some articles are time-sensitive, so if there are any errors or if they are no longer valid, please check below.leave a messageor contactHootSuite OfficialThe
No comments