FlinkJob GeoLite2 Guide
GeoLite2
GeoLite 离线文件下载地址:
1 | https://github.com/P3TERX/GeoLite.mmdb |
Country Reponse data 说明
1 | { |
Geo City Reponse
1 | { |
GeoLite2 ISP 字段信息
1 |
|
GetLite2 数据读取
java read demo
https://github.com/maxmind/GeoIP2-java
IPGeoinfo API servcie
个人使用spring-boot实现的ip-geo-info servcie, 源代码:
https://github.com/ordiy/my-public-repository-collect/tree/main/java-api-service-ip-to-geo-info
特点:
- 定义异步原子刷新GeoLite2 databaseSet(高QPS场景下 不会因为IP库更新出现 error)
- 引入了guava load cache 提高缓存加载效率,同时使用cache提高服务QPS
- 高性能高响应速度:4C8G instance 可实现 20K+ QPS
- repsonse 简单,可以快速用于FlinkSQL UDF
在Flink 中使用
Flink UDF 使用
1 | // tabEnv 定义UDF URL |
1 |
|
将GeoLite2
参考
- Title: FlinkJob GeoLite2 Guide
- Author: Ordiy
- Created at : 2024-12-10 17:51:37
- Updated at : 2026-03-04 13:43:27
- Link: https://ordiy.github.io/posts/2024-12-10-geolite2-lib-action-guide-md/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments