【问题标题】:How to import MaxMind local data, CSV files into redis in Rails?Rails中如何将MaxMind本地数据、CSV文件导入redis?
【发布时间】:2017-12-25 09:01:26
【问题描述】:

我需要将 Maxmind 提供的 CSV 文件导入到 Ruby on Rails 应用程序中的 Redis。

在这个link 中,他们为 SQL 数据库提供了方法,但没有为 NoSQL 数据库提供方法。

【问题讨论】:

标签: ruby-on-rails csv redis geoip maxmind


【解决方案1】:

我找不到将 Maxmind 导入 Redis 的现成教程。但是,我看过一个将 IP2Location 导入 Redis 并进行查询的教程。您可以参考这篇文章,然后根据 Maxmind 更新 CSV 参数。

https://www.ip2location.com/tutorials/importing-ip2location-data-into-redis-and-querying-with-php

我希望我能更有用,但这是我能找到的最佳参考。

【讨论】:

    【解决方案2】:

    我用过这个宝石:

    https://github.com/zabolotnov87/geoip_redis
    

    实现起来很容易。

    我找到的其他解决方案是:

    https://redislabs.com/ebook/part-2-core-concepts/chapter-5-using-redis-for-application-support/5-3-ip-to-city-and-country-lookup/5-3-1-loading-the-location-tables/
    https://redislabs.com/ebook/part-2-core-concepts/chapter-5-using-redis-for-application-support/5-3-ip-to-city-and-country-lookup/5-3-2-looking-up-cities/
    

    他们已经正确地描述了它用于加载 csv 文件和查找城市,但代码是在 python 中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-05
      • 2016-09-27
      • 2014-07-10
      • 1970-01-01
      • 1970-01-01
      • 2012-10-27
      • 1970-01-01
      • 2018-03-18
      相关资源
      最近更新 更多