Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^14: Help with Geo::IP output

by marto (Cardinal)
on Jun 25, 2020 at 11:38 UTC ( [id://11118516]=note: print w/replies, xml ) Need Help??


in reply to Re^13: Help with Geo::IP output
in thread Help with Geo::IP output

In the create example you provided a dsn, which worked. When you ran it again you didn't so the program has no idea where to look (you didn't tell it, and haven't got an entry in your config file), and once again, the default is Pg. Just add the dsn to your config file.

Replies are listed 'Best First'.
Re^15: Help with Geo::IP output
by Anonymous Monk on Jun 25, 2020 at 11:53 UTC

    THANK YOU SO MUCH marto!

    I had thought it wouldn't be possible to get this geoip thing to work - there were so many things missing in the puzzle:

    1) The default SQLite was 2013 version and I had no idea this could be an issue. Had to download the source and compile my own binaries.

    2) I didn't have DBD::SQLite installed until someone mentioned it.

    3) Then there was the config file which I didn't now I could get - thought it was only for paid users.

    4) And then there was the memory usage thing at the server end that stopped the --fetch processes because it was using too much RAM (someone did warn about this). The hosting made an exception for an hour to allow the command to run.

    So it was an not *easy thing* to do especially for someone not too familiar with Unix.

    But it's finally done now - thank you everyone for your patience and help. Thank you.

      All kinds of suggestions now committed. Note all the errors in the command line and how you get feedback:

      1. Nonexistent driver (type in driver name). You get the same error if you typed it correctly but the driver cannot load for whatever reason:

        $ perl ./geoip --no-fetch --DB=dbi:SQXLite:dbname=geoip.db Cannot continue without a working database Did you forget to install DBD::SQXLite?
      2. The dbx: part won't ever find a (standard) driver, so
      3. $ perl ./geoip --no-fetch -DB=dbx:SQLite:dbname=geoip.db Cannot continue without a working database Maybe the matching DBD for dbx:SQLite:dbname=geoip.db is not insta +lled

      I also made a few adjustments to the documentation based on marto's feedback. Thank you!

      (FWIW I have no idea what the errors will be if the machine does not have enough memory to create the database)

      Note that if you fetch new data files, you will need the memory again to load/update the database.

      For normal operation (--no-fetch) you don't need that much memory.


      Enjoy, Have FUN! H.Merijn

      You didn't have to do 1., simply installing DBD::SQLite (cpanm DBD::SQLite) builds SQLite for you: "DBD::SQLite is a Perl DBI driver for SQLite, that includes the entire thing in the distribution. So in order to get a fast transaction capable RDBMS working for your perl project you simply have to install this module, and nothing else.". From there it's a case of installing the app (cpanm App::geoip), and creating a config file with the details as specified. So the following steps:

      • Read and understand the module documentation.
      • Build SQLite and the perl module DBD::SQLite: cpanm DBD::SQLite.
      • Install geoip: cpanm App::geoip.
      • Create your config file as specified in the documentation.
      • Run the app and create the database: geoip --fetch --DB=dbi:SQLite:dbname=geoip.db

      I've made a note to review the module docs in light of this thread, and if I can come up with any improvement I'll raise with Tux and see what he thinks.

        Unless I remember wrongly, I did install DBD::SQLite and then tried again with geoip. It was the same result so that was when I decided to install the new SQLite from source (with help pointed by the hosting).

        Edit to my previous post:

        3) Then there was the config file which I didn't now I could get - thought it was only for paid users.

        Should have been:

        3) Then there was the license key which I didn't know I could get from Maxmind - had thought it was only for paid users.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118516]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-03-28 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found