Skip to content

Commit

Permalink
Optimize the maker doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lionsoul2014 committed May 2, 2019
1 parent abf2292 commit 5767b1e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ p2region>> 101.105.35.57

### 6. 如何生成ip2region.db文件

从1.8版本开始,ip2region开源了ip2region.db生成程序的java实现,提供了ant编译支持,编译后会得到以下提到的dbMaker-{version}.jar,对于需要研究生成程序的或者更改自定义生成配置的请参考${ip2region_root}/maker/java内的java源码。


从ip2region 1.2.2版本开始里面提交了一个dbMaker-{version}.jar的可以执行jar文件,用它来完成这个工作:
* 1, 确保你安装好了java环境(不玩Java的童鞋就自己谷歌找找拉,临时用一用,几分钟的事情)
* 2, cd到ip2region的根目录,然后运行如下命令:
* 2, cd到${ip2region_root}/maker/java,然后运行如下命令:

```shell
java -jar dbMaker-{version}.jar -src 文本数据文件 -region 地域csv文件 [-dst 生成的ip2region.db文件的目录]
Expand All @@ -113,7 +116,7 @@ java -jar dbMaker-{version}.jar -src 文本数据文件 -region 地域csv文件
* 4, 默认的ip2region.db文件生成命令:

```shell
cd ip2region项目根目录
cd ${ip2region_root}/java/
java -jar dbMaker-1.2.2.jar -src ./data/ip.merge.txt -region ./data/global_region.csv

# 会看到一大片的输出
Expand Down
7 changes: 7 additions & 0 deletions maker/c/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# db maker C implementation

### 1, How to build ?

### 2, How to make ?

comming soon ...
12 changes: 12 additions & 0 deletions maker/java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# db maker java implementation

### 1, How to build ?
```
ant all
```


### 2, How to make ?
```
java -jar dbMaker-{version}.jar -src path of ip.merge.txt -region path of global_region.csv -dst ip2region.db target path
```

0 comments on commit 5767b1e

Please sign in to comment.