当前位置:   article > 正文

Dolphinscheduler使用Datax同步mongodb到doris_dolphinscheduler 集成datax

dolphinscheduler 集成datax

1、dolphinscheduler与datax集成环境变量配置

  1. export JAVA_HOME=/opt/soft/java
  2. export PYTHON_HOME=/usr/bin/python
  3. export DATAX_HOME=/opt/soft/datax
  4. export PATH=$PYTHON_HOEM:$DATAX_HOME/bin:$JAVA_HOME/bin:$PATH

截图如下:

注意服务器上安装python2.7,以及datax安装在对应目录下。 

2、同步mongodb 到doris

  1. {
  2. "job": {
  3. "content": [
  4. {
  5. "reader": {
  6. "name": "mongodbreader",
  7. "parameter": {
  8. "address": ["xxx:27017","xxxx:27017","xxxx:27017"],
  9. "collectionName": "leases",
  10. "column": [
  11. {
  12. "name":"_id",
  13. "type":"string"
  14. },
  15. {
  16. "name":"id",
  17. "type":"string"
  18. },
  19. {
  20. "name":"storeid",
  21. "type":"string"
  22. },
  23. {
  24. "name":"storename",
  25. "type":"string"
  26. },
  27. {
  28. "name":"title",
  29. "type":"string"
  30. },
  31. {
  32. "name":"source",
  33. "type":"string"
  34. },
  35. {
  36. "name":"code",
  37. "type":"string"
  38. },
  39. {
  40. "name":"codeyear",
  41. "type":"string"
  42. },
  43. {
  44. "name":"codemonth",
  45. "type":"string"
  46. },
  47. {
  48. "name":"codesort",
  49. "type":"string"
  50. },
  51. {
  52. "name":"classify",
  53. "type":"string"
  54. },
  55. {
  56. "name":"property",
  57. "type":"string"
  58. },
  59. {
  60. "name":"propertydir",
  61. "type":"string"
  62. },
  63. {
  64. "name":"leaseduration",
  65. "type":"string"
  66. },
  67. {
  68. "name":"leasestartdate",
  69. "type":"string"
  70. },
  71. {
  72. "name":"leaseenddate",
  73. "type":"string"
  74. },
  75. {
  76. "name":"calcacreage",
  77. "type":"string"
  78. },
  79. {
  80. "name":"acreage",
  81. "type":"string"
  82. },
  83. {
  84. "name":"insidespace",
  85. "type":"string"
  86. },
  87. {
  88. "name":"residentialpoolarea",
  89. "type":"string"
  90. },
  91. {
  92. "name":"handoverdate",
  93. "type":"string"
  94. },
  95. {
  96. "name":"billingdate",
  97. "type":"string"
  98. },
  99. {
  100. "name":"deposit",
  101. "type":"string"
  102. },
  103. {
  104. "name":"rental",
  105. "type":"string"
  106. },
  107. {
  108. "name":"otherdeposit",
  109. "type":"string"
  110. },
  111. {
  112. "name":"quitedat",
  113. "type":"string"
  114. },
  115. {
  116. "name":"quitamount",
  117. "type":"string"
  118. }
  119. ],
  120. "dbName": "xxxx",
  121. "authDb":"admin",
  122. "userName": "xxxx",
  123. "userPassword": "xxxx"
  124. }
  125. },
  126. "writer": {
  127. "name": "doriswriter",
  128. "parameter": {
  129. "column": ["_id","id","storeid","storename","title","source","code","codeyear","codemonth","codesort","classify","property","propertydir","leaseduration","leasestartdate","leaseenddate","calcacreage","acreage","insidespace","residentialpoolarea","handoverdate","billingdate","deposit","rental","otherdeposit","quitedat","quitamount"],
  130. "connection": [
  131. {
  132. "jdbcUrl": "jdbc:mysql://xxxx:9030/ODS",
  133. "selectedDatabase":"ODS",
  134. "table": ["test"]
  135. }
  136. ],
  137. "loadProps":{},
  138. "loadUrl":["xxxx"],
  139. "password": "****",
  140. "postSql":[],
  141. "username": "root",
  142. }
  143. }
  144. }
  145. ],
  146. "setting": {
  147. "speed": {
  148. "channel": "1"
  149. }
  150. }
  151. }
  152. }

3、mogodb中json格式的集合,datax可用如下方式获取属性

  1. {
  2. "name":"tenant.company_phone",
  3. "type":"document.string"
  4. },

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/141189
推荐阅读
相关标签
  

闽ICP备14008679号