通过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
相关推荐
Elastic 中国社区官方博客2 小时前
我们如何在 Elasticsearch Serverless 上将向量搜索吞吐量提升一倍
大数据·数据库·人工智能·elasticsearch·搜索引擎·云原生·serverless
一 乐2 小时前
高校实习信息发布网站|基于Spring Boot的高校实习信息发布网站的设计与实现(源码+数据库+文档)
java·数据库·spring boot·后端·论文·毕设·高校实习信息发布网站
zgl_200537792 小时前
源代码:跨数据库通用SQL语法解析与标注拆解
大数据·数据库·数据仓库·sql·etl·源代码管理
雪度娃娃3 小时前
存储器层次结构——磁盘硬盘存储
服务器·网络·数据库·计算机组成原理
暴力求解3 小时前
Mysql数据库基础
数据库·mysql·操作系统
意倾城4 小时前
MySQL最左前缀匹配原则
数据库·mysql
暴躁小师兄数据学院4 小时前
【AI大数据工程师特训笔记】第13讲:数据库性能手术刀
大数据·数据库·数据仓库·sql·postgresql
步十人4 小时前
【Redis】持久化机制
数据库·redis·缓存
Quincy_Freak5 小时前
银河麒麟aarch64如何高效做数据分析?分享一款内网离线数据分析利器
大数据·数据库·数据挖掘·数据分析·aarch64
香气袭人知骤暖5 小时前
PG数据库 Docker 容器自动备份方案
数据库·docker·容器