Currently I am working on a distributed Weibo crawler. Weibo has strict restrictions on account and IP requests. I have seven or eight public IPs, but there are only four servers, so the other four IPs are wasted if not used. So I thought of using a virtual machine or docker to bind the public IP. Since the virtual machine was too bloated, and installing the virtual machine on centos7 was cumbersome, I decided to use docker, and then run my crawler program in docker. How can I make docker bind the static IP of the public network?
It is recommended not to use docker. Configuration management is complicated and requires professional network knowledge. Here is another solution recommended for reference. Configure multiple IPv4 addresses on one network card, and then bind each process to an IP. This solution is much simpler. . How to configure multiple IPs can be found on google/baidu, there are many examples.
Use nginx as proxy