如何更新 maxmind GeoLite2

How to update maxmind GeoLite2

据说GeoLite2每个月都有更新,难道我每个月都要手动更新GeoLite2到本地吗?

或使用 watchForUpdate?

maxmind.open('/path/to/GeoLite2.mmdb', { watchForUpdates: true });

更新是否需要很多时间,我不希望用户为了获得他们的位置而等待 GeoLite2 更新。

最简单的方法是使用 update script provided by Maxmind

否则,您必须通过 HTTP 下载文件,解压缩 .tar.gz 并替换本地文件。是的,这可能需要几秒钟,因为文件很大。