Skip to content

Commit

Permalink
更新文件
Browse files Browse the repository at this point in the history
  • Loading branch information
dksou authored May 14, 2018
1 parent 229cfc4 commit ffc8077
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# dk-sqoop-plus
<div>本项目在原生sqoop 的基础上进行更多实用功能的扩展。</div><div><br></div><div>项目编译及sqoopo使用参见原生sqoop。</div>

Versions
IK version ES version
master 6.x -> master
6.2.4 6.2.4


<div><br></div><div>下面列举其扩展功能的使用:</div><div><br></div><div><b>1. RDBMS&nbsp; to&nbsp; Elasticsearch&nbsp;</b></div><div>&nbsp; 在其安装目录下执行 :&nbsp; bin/sqoop import --connect jdbc:oracle:thin:@192.168.1.35:1521:orcl --username system --password dkss --table DK10 -m 1 --target-dir 192.168.1.99:9200@dkes@dksqoop2/oracle&nbsp;&nbsp;</div><div>&nbsp; 执行命令说明:</div><div>&nbsp; &nbsp; sqoop import&nbsp; #固定,默认</div><div>&nbsp; &nbsp; --connect jdbc:oracle:thin:@192.168.1.35:1521:orcl&nbsp; #为RDBMS数据库的连接信息&nbsp; (如oracle , mysql , sqlserver)</div><div>&nbsp; &nbsp; --username system&nbsp; #RDBMS数据库用户名</div><div>&nbsp; &nbsp; --password dkss&nbsp; &nbsp; #RDBMS数据库密码</div><div>&nbsp; &nbsp; --table DK10&nbsp; &nbsp; &nbsp; &nbsp;#RDBMS要导入到elasticsearch的数据库表</div><div>&nbsp; &nbsp; -m 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#指定导入时产生的线程的数量。注意:如果RDBMS数据库表中没有主键,则-m的值只能是1</div><div>&nbsp; &nbsp; --target-dir 192.168.1.99:9200@dkes@dksqoop2/oracle&nbsp; #--target-dir的值包含三部分由“@”分隔,“@”前一部分192.168.1.99:9200为指定elasticsearch的主机地址和端口号,“@”中间一部分dkes为elasticsearch的集群名称,“@”后一部分dksqoop2/oracle包含两部分,由“/”分隔,“/”前一部分dksqoop2为elasticsearch的索引名称,“/”后一部分oracle为elasticsearch的类型名称。</div><div><br></div><div><b>2. HDFS to&nbsp; Elasticsearch</b></div><div>&nbsp; 在其安装目录下执行 :&nbsp; bin/sqoop export --connect "es@192.168.1.126:9200@elasticsearch@hdfs/sqoop"&nbsp; --export-dir aaa --fields-terminated-by '@' -m 1</div><div>&nbsp; &nbsp; 执行命令说明:</div><div>&nbsp; &nbsp; &nbsp; sqoop export&nbsp; #固定,默认</div><div>&nbsp; &nbsp; &nbsp; --connect "es@192.168.1.126:9200@kes@hdfs/sqoop"&nbsp; &nbsp;#--connect的值包含四部分由“@”分隔,第一部分es为固定默认值,第二部分192.168.1.126:9200为&nbsp; &nbsp; &nbsp; &nbsp;连接elasticsearch的主机地址和端口,第三部分dkes为elasticsearch的集群名称,第四部分hdfs/sqoop为elasticsearch的索引名/类型名。</div><div>&nbsp; &nbsp; &nbsp; --export-dir aaa&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #指的是要导出的hdfs文件所在的目录。</div><div>&nbsp; &nbsp; &nbsp; --fields-terminated-by '@'&nbsp; #--fields-terminated-by指的是hdfs文件内容各字段间的字段分隔符,如果不指定则默认为','分隔。</div><div>&nbsp; &nbsp; &nbsp; -m 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#指定导入时产生的线程的数量。线程数不能小于文件内容的记录条数。</div><div><br></div><div><br></div><div><br></div><div><br></div>
<div><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgb(234, 236, 239); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; margin-top: 0px !important;">DK-Sqoop-plus</h1></div><div>本项目在原生sqoop&nbsp;<span style="color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">(</span><a href="http://sqoop.apache.org/" rel="nofollow" style="box-sizing: border-box; color: rgb(3, 102, 214); text-decoration-line: none; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">http://sqoop.apache.org/</a><span style="color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">)&nbsp;</span>的基础上进行更多实用功能的扩展。</div><div>暂时只支持&nbsp; RDBMS(mysql 、oracle 、sqlserver) to Elasticsearch&nbsp; 和 HDFS to Elasticsearch 等功能,后续可能支持 Elasticsearch to RDBMS 等功能 。</div><div><br></div><div>项目编译及sqoopo使用参见原生sqoop。</div>
<div><br></div><div><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgb(234, 236, 239); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;;">Versions</h2></div><div><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;"><thead style="box-sizing: border-box;"><tr style="box-sizing: border-box; border-top: 1px solid rgb(198, 203, 209);"><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(223, 226, 229);">DK-Sqoop-plus version</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(223, 226, 229);">ES version</th></tr></thead><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box; border-top: 1px solid rgb(198, 203, 209);"><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(223, 226, 229);">master</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(223, 226, 229);">5.x -&gt; master</td></tr><tr style="box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgb(198, 203, 209);"><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(223, 226, 229);">1.5.4</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(223, 226, 229);">5.6.8</td></tr></tbody></table></div><div><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgb(234, 236, 239); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;;">Install</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">1.download&nbsp;</p><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">optional 1 - download pre-build package from here:&nbsp;<a href="https://github.com/medcl/elasticsearch-analysis-ik/releases" style="box-sizing: border-box; background-color: transparent; color: rgb(3, 102, 214); text-decoration-line: none;">https://github.com/</a></p><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">unzip plugin to folder&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; background-color: rgba(27, 31, 35, 0.05); border-radius: 3px;">your-es-root/plugins/</code></p></div><div><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgb(234, 236, 239); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;;">Quick Example</h2></div><div><b>1. RDBMS&nbsp; to&nbsp; Elasticsearch&nbsp;</b></div><div>&nbsp; 在其安装目录下执行 :&nbsp; bin/sqoop import --connect jdbc:oracle:thin:@192.168.1.35:1521:orcl --username system --password dkss --table DK10 -m 1 --target-dir 192.168.1.99:9200@dkes@dksqoop2/oracle&nbsp;&nbsp;</div><div>&nbsp; 执行命令说明:</div><div>&nbsp; &nbsp; sqoop import&nbsp; #固定,默认</div><div>&nbsp; &nbsp; --connect jdbc:oracle:thin:@192.168.1.35:1521:orcl&nbsp; #为RDBMS数据库的连接信息&nbsp; (如oracle , mysql , sqlserver)</div><div>&nbsp; &nbsp; --username system&nbsp; #RDBMS数据库用户名</div><div>&nbsp; &nbsp; --password dkss&nbsp; &nbsp; #RDBMS数据库密码</div><div>&nbsp; &nbsp; --table DK10&nbsp; &nbsp; &nbsp; &nbsp;#RDBMS要导入到elasticsearch的数据库表</div><div>&nbsp; &nbsp; -m 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#指定导入时产生的线程的数量。注意:如果RDBMS数据库表中没有主键,则-m的值只能是1</div><div>&nbsp; &nbsp; --target-dir 192.168.1.99:9200@dkes@dksqoop2/oracle&nbsp; #--target-dir的值包含三部分由“@”分隔,“@”前一部分192.168.1.99:9200为指定elasticsearch的主机地址和端口号,“@”中间一部分dkes为elasticsearch的集群名称,“@”后一部分dksqoop2/oracle包含两部分,由“/”分隔,“/”前一部分dksqoop2为elasticsearch的索引名称,“/”后一部分oracle为elasticsearch的类型名称。</div><div><br></div><div><b>2. HDFS to&nbsp; Elasticsearch</b></div><div>&nbsp; 在其安装目录下执行 :&nbsp; bin/sqoop export --connect "es@192.168.1.126:9200@elasticsearch@hdfs/sqoop"&nbsp; --export-dir aaa --fields-terminated-by '@' -m 1</div><div>&nbsp; &nbsp; 执行命令说明:</div><div>&nbsp; &nbsp; &nbsp; sqoop export&nbsp; #固定,默认</div><div>&nbsp; &nbsp; &nbsp; --connect "es@192.168.1.126:9200@kes@hdfs/sqoop"&nbsp; &nbsp;#--connect的值包含四部分由“@”分隔,第一部分es为固定默认值,第二部分192.168.1.126:9200为&nbsp; &nbsp; &nbsp; &nbsp;连接elasticsearch的主机地址和端口,第三部分dkes为elasticsearch的集群名称,第四部分hdfs/sqoop为elasticsearch的索引名/类型名。</div><div>&nbsp; &nbsp; &nbsp; --export-dir aaa&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #指的是要导出的hdfs文件所在的目录。</div><div>&nbsp; &nbsp; &nbsp; --fields-terminated-by '@'&nbsp; #--fields-terminated-by指的是hdfs文件内容各字段间的字段分隔符,如果不指定则默认为','分隔。</div><div>&nbsp; &nbsp; &nbsp; -m 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#指定导入时产生的线程的数量。线程数不能小于文件内容的记录条数。</div><div><br></div><div><br></div><div><br></div><div><br></div>

0 comments on commit ffc8077

Please sign in to comment.