Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyKupershtokh committed Apr 9, 2019
0 parents commit 5ffe17d
Show file tree
Hide file tree
Showing 16 changed files with 724 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/clickhouse-maxmind-geoip.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM yandex/clickhouse-server

RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
unzip \
&& rm -rf \
/var/lib/apt/lists/* \
/var/cache/debconf \
/tmp/* \
&& apt-get clean

# download MaxMind GeoLite2 databases
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip /tmp
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip /tmp
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip /tmp
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip -O /tmp/GeoLite2-City-CSV.zip --no-check-certificate
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip -O /tmp/GeoLite2-Country-CSV.zip --no-check-certificate
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip -O /tmp/GeoLite2-ASN-CSV.zip --no-check-certificate

RUN unzip /tmp/GeoLite2-City-CSV.zip -d /tmp
RUN unzip /tmp/GeoLite2-Country-CSV.zip -d /tmp
RUN unzip /tmp/GeoLite2-ASN-CSV.zip -d /tmp

RUN mv /tmp/*/* /etc/clickhouse-server/

ADD clickhouse /etc/clickhouse-server

RUN pwd
RUN ls -la
RUN ls -la /etc/clickhouse-server
RUN ls -la /tmp

RUN cat /etc/clickhouse-server/GeoLite2-City-Locations-en.csv | sed 's/'"'"'/\\'"'"'/g' > /etc/clickhouse-server/GeoLite2-City-Locations-en-fixed.csv
153 changes: 153 additions & 0 deletions README.md

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions clickhouse/geoip_asn_blocks_ipv4_dictionary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<dictionaries>
<dictionary>
<name>geoip_asn_blocks_ipv4</name>
<source>
<file>
<path>/etc/clickhouse-server/GeoLite2-ASN-Blocks-IPv4.csv</path>
<format>CSVWithNames</format>
</file>
</source>
<lifetime>300</lifetime>
<layout>
<ip_trie/>
</layout>
<structure>
<key>
<attribute>
<name>prefix</name>
<type>String</type>
</attribute>
</key>
<attribute>
<name>autonomous_system_number</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>autonomous_system_organization</name>
<type>String</type>
<null_value>?</null_value>
</attribute>
</structure>
</dictionary>
</dictionaries>
34 changes: 34 additions & 0 deletions clickhouse/geoip_asn_blocks_ipv6_dictionary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<dictionaries>
<dictionary>
<name>geoip_asn_blocks_ipv6</name>
<source>
<file>
<path>/etc/clickhouse-server/GeoLite2-ASN-Blocks-IPv6.csv</path>
<format>CSVWithNames</format>
</file>
</source>
<lifetime>300</lifetime>
<layout>
<ip_trie/>
</layout>
<structure>
<key>
<attribute>
<name>prefix</name>
<type>String</type>
</attribute>
</key>
<attribute>
<name>autonomous_system_number</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>autonomous_system_organization</name>
<type>String</type>
<null_value>?</null_value>
</attribute>
</structure>
</dictionary>
</dictionaries>
69 changes: 69 additions & 0 deletions clickhouse/geoip_city_blocks_ipv4_dictionary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0"?>
<dictionaries>
<dictionary>
<name>geoip_city_blocks_ipv4</name>
<source>
<file>
<path>/etc/clickhouse-server/GeoLite2-City-Blocks-IPv4.csv</path>
<format>CSVWithNames</format>
</file>
</source>
<lifetime>300</lifetime>
<layout>
<ip_trie/>
</layout>
<structure>
<key>
<attribute>
<name>prefix</name>
<type>String</type>
</attribute>
</key>
<attribute>
<name>geoname_id</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>registered_country_geoname_id</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>represented_country_geoname_id</name>
<type>String</type>
<null_value>?</null_value>
</attribute>
<attribute>
<name>is_anonymous_proxy</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>is_satellite_provider</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>postal_code</name>
<type>String</type>
<null_value>?</null_value>
</attribute>
<attribute>
<name>latitude</name>
<type>Float32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>longitude</name>
<type>Float32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>accuracy_radius</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
</structure>
</dictionary>
</dictionaries>
69 changes: 69 additions & 0 deletions clickhouse/geoip_city_blocks_ipv6_dictionary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0"?>
<dictionaries>
<dictionary>
<name>geoip_city_blocks_ipv6</name>
<source>
<file>
<path>/etc/clickhouse-server/GeoLite2-City-Blocks-IPv6.csv</path>
<format>CSVWithNames</format>
</file>
</source>
<lifetime>300</lifetime>
<layout>
<ip_trie/>
</layout>
<structure>
<key>
<attribute>
<name>prefix</name>
<type>String</type>
</attribute>
</key>
<attribute>
<name>geoname_id</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>registered_country_geoname_id</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>represented_country_geoname_id</name>
<type>String</type>
<null_value>?</null_value>
</attribute>
<attribute>
<name>is_anonymous_proxy</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>is_satellite_provider</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>postal_code</name>
<type>String</type>
<null_value>?</null_value>
</attribute>
<attribute>
<name>latitude</name>
<type>Float32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>longitude</name>
<type>Float32</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>accuracy_radius</name>
<type>UInt32</type>
<null_value>0</null_value>
</attribute>
</structure>
</dictionary>
</dictionaries>
Loading

0 comments on commit 5ffe17d

Please sign in to comment.