If you want to create a Capturing System and think that it may be better to store temporary data with redis, you just want to dress up with a virtual machine, install redis on the virtual machine, and access redis on the virtual machine through local.
After the Virtual Machine and redis are successfully installed, it is found that the local connection is not connected to the redis on the Virtual Machine. First, comment out the following configuration (this is used to restrict the IP addresses that can be connected ):
# Bind 127.0.0.1
Here I connect to redis on the virtual machine through redis manger. The configuration interface of this software is as follows:
After the configuration, I found that I could not connect to the virtual machine, but my xshell can connect to the virtual machine. At this time, I thought it might be a port problem (xshell uses port 22 ), after finding a bunch of data, we found that the port is not open because it is necessary to open the port. We need to add the port opening rule to iptables:
Iptables-I input-P TCP -- dport 6379-J accept
Here, the-I parameter is the meaning of adding a rule. You can also use-a to add it at the end. However, if I try it, it will fail, probably because of the priority of the previous rule, coming soon
Input is the entry rule, and there is also output
-What protocol does P mean by protocol?
-- Dport indicates the destination port.
-J indicates rules, which can be accept and drop.
In this way, the rule is added. You can run the following command to check that 6379 has been added:
Iptables-l-N | grep 6379
Test redis manger and find that it can be connected, but it is not actually saved yet. It will expire after restart, but you need to save it by using the following command:
Service iptables save
This command writes the 6379 port rule
/Etc/sysconfig/iptables
File, rather than temporary, it will not disappear after restart. Now, enabling the redis port on the virtual machine is complete.
Connect to the redis instance on the VM locally