通过geoip自动更新GeoLite2-ASN GeoLite2-City GeoLite2-Country

1、首先注册登录

Sign In | MaxMind

登录地址、填写邮箱、用户名、密码信息

2、同意GeoLite2 End User License Agreement协议

注册登录成功之后,要想获取到免费产品的订阅信息,还需要同意GeoLite2 End User License Agreement协议,否则登录之后,在个人账号门户是看不到GeoLite2下载信息的。

GeoLite sign up | MaxMind

3、登录个人中心获取license

生成license的时候复制备用。

4、下载geoipupdate执行更新

下载地址

github.com

上传到linux服务器上解压,修改GeoIP.conf文件
GeoIP.conf,填写对应的AccountID 账号IDLicenseKey 复制的License,都可在登录后的个人中心获取

复制代码
# Please see https://dev.maxmind.com/geoip/updating-databases?lang=en for
# instructions on setting up geoipupdate, including information on how to
# download a pre-filled GeoIP.conf file.

# Replace YOUR_ACCOUNT_ID_HERE and YOUR_LICENSE_KEY_HERE with an active account
# ID and license key combination associated with your MaxMind account. These
# are available from https://www.maxmind.com/en/my_license_key.
AccountID 账号ID
LicenseKey 复制的License

# Enter the edition IDs of the databases you would like to update.
# Multiple edition IDs are separated by spaces.
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country

# The remaining settings are OPTIONAL.

# The directory to store the database files. Defaults to /usr/local/share/GeoIP
# DatabaseDirectory /usr/local/share/GeoIP

# The server to use. Defaults to "https://updates.maxmind.com".
# Host https://updates.maxmind.com

# The proxy host name or IP address. You may optionally specify a
# port number, e.g., 127.0.0.1:8888. If no port number is specified, 1080
# will be used.
# Proxy 127.0.0.1:8888

# The user name and password to use with your proxy server.
# ProxyUserPassword username:password

# Whether to preserve modification times of files downloaded from the server.
# Defaults to "0".
# PreserveFileTimes 0

# The lock file to use. This ensures only one geoipupdate process can run at a
# time.
# Note: Once created, this lockfile is not removed from the filesystem.
# Defaults to ".geoipupdate.lock" under the DatabaseDirectory.
# LockFile /usr/local/share/GeoIP/.geoipupdate.lock

# The amount of time to retry for when errors during HTTP transactions are
# encountered. It can be specified as a (possibly fractional) decimal number
# followed by a unit suffix. Valid time units are "ns", "us" (or "µs"), "ms",
# "s", "m", "h".
# Defaults to "5m" (5 minutes).
# RetryFor 5m

# The number of parallel database downloads.
# Defaults to "1".
# Parallelism 1

执行命令,例如解压到了home下,可以配置crontab定时执行

复制代码
/home/geoipupdate_7.1.1_linux_amd64/geoipupdate -v -f /home/geoipupdate_7.1.1_linux_amd64/GeoIP.conf
相关推荐
brave_zhao1 小时前
达梦8最终锁阻塞巡检 SQL
数据库
一 乐8 小时前
婚纱摄影网站|基于ssm + vue婚纱摄影网站系统(源码+数据库+文档)
前端·javascript·数据库·vue.js·spring boot·后端
1.14(java)9 小时前
SQL数据库操作:从CRUD到高级查询
数据库
Full Stack Developme10 小时前
数据库索引的原理及类型和应用场景
数据库
IDC02_FEIYA11 小时前
SQL Server 2025数据库安装图文教程(附SQL Server2025数据库下载安装包)
数据库·windows
辞砚技术录12 小时前
MySQL面试题——联合索引
数据库·面试
萧曵 丶12 小时前
MySQL 主键不推荐使用 UUID 的深层原因
数据库·mysql·索引
小北方城市网12 小时前
分布式锁实战指南:从选型到落地,避开 90% 的坑
java·数据库·redis·分布式·python·缓存
毕设十刻12 小时前
基于Vue的人事管理系统67zzz(程序 + 源码 + 数据库 + 调试部署 + 开发环境配置),配套论文文档字数达万字以上,文末可获取,系统界面展示置于文末
前端·数据库·vue.js
TDengine (老段)14 小时前
TDengine Python 连接器入门指南
大数据·数据库·python·物联网·时序数据库·tdengine·涛思数据