tool.txt 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. // 新增某字段mapping
  2. curl -XPUT http://127.0.0.1:19800/supplier_product_v1/supplier_product/_mapping -d '
  3. {
  4. "properties": {
  5. "bid_num": {
  6. "type": "integer"
  7. }
  8. }
  9. }'
  10. //开启节点平衡
  11. curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
  12. "transient" : {
  13. "cluster.routing.allocation.enable" : "all"
  14. }
  15. }'
  16. //关闭节点平衡
  17. curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
  18. "transient" : {
  19. "cluster.routing.allocation.enable" : "none"
  20. }
  21. }'
  22. //开启节点平衡
  23. curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
  24. "transient" : {
  25. "cluster.routing.allocation.enable" : "all"
  26. }
  27. }'
  28. //关闭节点平衡
  29. curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
  30. "transient" : {
  31. "cluster.routing.allocation.enable" : "none"
  32. }
  33. }'
  34. //手动移动节点
  35. curl -XPOST 'http://127.0.0.1:9800/_cluster/reroute' -d '{
  36. "commands" : [ {
  37. "move" :
  38. {
  39. "index": "qyxy_v2", "shard": 12,
  40. "from_node": "node_12", "to_node": "node_1"
  41. }
  42. }
  43. ]
  44. }'
  45. //查看节点个数
  46. curl http://localhost:9800/_settings?pretty
  47. //设置节点个数
  48. curl -XPUT 'http://127.0.0.1:9800/projectset_v1/_settings' -d '{
  49. "index.routing.allocation.total_shards_per_node":2
  50. }'
  51. // 分片异常 unsigned
  52. curl -XPOST '192.168.3.206:9800/_cluster/reroute' -d '{
  53. "commands": [{
  54. "allocate": {
  55. "index": "projectset_v1",
  56. "shard": 1,
  57. "node": "node-4",
  58. "allow_primary": 1
  59. }
  60. }]
  61. }'
  62. //新增某字段mapping
  63. curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d '
  64. {
  65. "properties": {
  66. "isValidFile": {
  67. "type": "boolean"
  68. }
  69. }
  70. }'
  71. curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d '
  72. {
  73. "properties": {
  74. "dataweight": {
  75. "type": "integer"
  76. }
  77. }
  78. }'
  79. // 恢复mapping文件
  80. curl -XPOST "http://192.168.3.128:9800/bidding/bidding/_mapping?pretty" -d '
  81. {
  82. "bidding": {
  83. "transform": {
  84. "lang": "groovy",
  85. "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
  86. },
  87. "_id": {
  88. "path": "_id"
  89. },
  90. "_all": {
  91. "enabled": false
  92. },
  93. "properties": {
  94. "winneraddr": {
  95. "index": "not_analyzed",
  96. "type": "string"
  97. },
  98. "projectcode": {
  99. "index": "not_analyzed",
  100. "type": "string"
  101. },
  102. "channel": {
  103. "index": "not_analyzed",
  104. "type": "string"
  105. },
  106. "projectaddr": {
  107. "index": "not_analyzed",
  108. "type": "string"
  109. },
  110. "contractcode": {
  111. "index": "not_analyzed",
  112. "type": "string"
  113. },
  114. "entidlist": {
  115. "index": "not_analyzed",
  116. "type": "string"
  117. },
  118. "agencyaddr": {
  119. "index": "not_analyzed",
  120. "type": "string"
  121. },
  122. "tagname": {
  123. "analyzer": "douhao",
  124. "type": "string"
  125. },
  126. "toptype": {
  127. "index": "not_analyzed",
  128. "type": "string"
  129. },
  130. "project_duration": {
  131. "type": "long"
  132. },
  133. "bid_guarantee": {
  134. "type": "boolean"
  135. },
  136. "href": {
  137. "index": "not_analyzed",
  138. "type": "string"
  139. },
  140. "id": {
  141. "index": "not_analyzed",
  142. "type": "string"
  143. },
  144. "filetext": {
  145. "analyzer": "my_ngram",
  146. "type": "string"
  147. },
  148. "budget": {
  149. "type": "double"
  150. },
  151. "buyeraddr": {
  152. "index": "not_analyzed",
  153. "type": "string"
  154. },
  155. "area": {
  156. "index": "not_analyzed",
  157. "type": "string"
  158. },
  159. "bidamount": {
  160. "type": "double"
  161. },
  162. "projectname": {
  163. "index": "not_analyzed",
  164. "type": "string",
  165. "fields": {
  166. "pname": {
  167. "type": "string"
  168. }
  169. }
  170. },
  171. "buyertel": {
  172. "index": "not_analyzed",
  173. "type": "string"
  174. },
  175. "project_scale": {
  176. "analyzer": "my_ngram",
  177. "type": "string"
  178. },
  179. "signaturedate": {
  180. "type": "long"
  181. },
  182. "s_winner": {
  183. "analyzer": "douhao",
  184. "type": "string",
  185. "fields": {
  186. "mwinner": {
  187. "analyzer": "my_ngram_title",
  188. "type": "string"
  189. }
  190. }
  191. },
  192. "winnerorder": {
  193. "properties": {
  194. "sortstr": {
  195. "index": "not_analyzed",
  196. "type": "string"
  197. },
  198. "entname": {
  199. "index": "not_analyzed",
  200. "type": "string"
  201. },
  202. "sort": {
  203. "type": "integer"
  204. }
  205. }
  206. },
  207. "supervisorrate": {
  208. "type": "double"
  209. },
  210. "project_completedate": {
  211. "type": "long"
  212. },
  213. "buyer": {
  214. "index": "not_analyzed",
  215. "type": "string",
  216. "fields": {
  217. "mbuyer": {
  218. "analyzer": "my_ngram_title",
  219. "type": "string"
  220. }
  221. }
  222. },
  223. "winner": {
  224. "index": "not_analyzed",
  225. "type": "string"
  226. },
  227. "qualifies": {
  228. "analyzer": "my_ngram",
  229. "type": "string"
  230. },
  231. "district": {
  232. "index": "not_analyzed",
  233. "type": "string"
  234. },
  235. "publishtime": {
  236. "type": "long"
  237. },
  238. "buyerzipcode": {
  239. "index": "not_analyzed",
  240. "type": "string"
  241. },
  242. "detail": {
  243. "analyzer": "my_ngram",
  244. "type": "string"
  245. },
  246. "projectinfo": {
  247. "properties": {
  248. "approvecontent": {
  249. "analyzer": "my_ngram",
  250. "type": "string"
  251. },
  252. "approvenumber": {
  253. "index": "not_analyzed",
  254. "type": "string"
  255. },
  256. "approvecity": {
  257. "index": "not_analyzed",
  258. "type": "string"
  259. },
  260. "approvestatus": {
  261. "index": "not_analyzed",
  262. "type": "string"
  263. },
  264. "approvecode": {
  265. "index": "not_analyzed",
  266. "type": "string"
  267. },
  268. "projecttype": {
  269. "index": "not_analyzed",
  270. "type": "string"
  271. },
  272. "approvetime": {
  273. "index": "not_analyzed",
  274. "type": "string"
  275. },
  276. "approvedept": {
  277. "analyzer": "my_ngram",
  278. "type": "string"
  279. }
  280. }
  281. },
  282. "city": {
  283. "index": "not_analyzed",
  284. "type": "string"
  285. },
  286. "purchasing": {
  287. "analyzer": "my_ngram",
  288. "type": "string"
  289. },
  290. "projectscope": {
  291. "index": "not_analyzed",
  292. "type": "string",
  293. "fields": {
  294. "pscope": {
  295. "analyzer": "my_ngram",
  296. "type": "string"
  297. }
  298. }
  299. },
  300. "agencytel": {
  301. "index": "not_analyzed",
  302. "type": "string"
  303. },
  304. "project_startdate": {
  305. "type": "long"
  306. },
  307. "title": {
  308. "analyzer": "my_ngram_title",
  309. "type": "string"
  310. },
  311. "winnerperson": {
  312. "index": "not_analyzed",
  313. "type": "string"
  314. },
  315. "comeintime": {
  316. "type": "long"
  317. },
  318. "s_topscopeclass": {
  319. "analyzer": "douhao",
  320. "type": "string"
  321. },
  322. "projectperiod": {
  323. "index": "not_analyzed",
  324. "type": "string"
  325. },
  326. "project_timeunit": {
  327. "index": "not_analyzed",
  328. "type": "string"
  329. },
  330. "spidercode": {
  331. "index": "not_analyzed",
  332. "type": "string"
  333. },
  334. "subtype": {
  335. "index": "not_analyzed",
  336. "type": "string"
  337. },
  338. "infoformat": {
  339. "type": "integer"
  340. },
  341. "s_subscopeclass": {
  342. "analyzer": "douhao",
  343. "type": "string"
  344. },
  345. "agency": {
  346. "index": "not_analyzed",
  347. "type": "string",
  348. "fields": {
  349. "magency": {
  350. "analyzer": "my_ngram",
  351. "type": "string"
  352. }
  353. }
  354. },
  355. "agencyperson": {
  356. "index": "not_analyzed",
  357. "type": "string"
  358. },
  359. "bidstatus": {
  360. "index": "not_analyzed",
  361. "type": "string"
  362. },
  363. "payway": {
  364. "index": "not_analyzed",
  365. "type": "string"
  366. },
  367. "winnertel": {
  368. "index": "not_analyzed",
  369. "type": "string"
  370. },
  371. "buyerclass": {
  372. "index": "not_analyzed",
  373. "type": "string"
  374. },
  375. "contract_guarantee": {
  376. "type": "boolean"
  377. },
  378. "site": {
  379. "index": "not_analyzed",
  380. "type": "string"
  381. },
  382. "bidopentime": {
  383. "type": "long"
  384. },
  385. "topscopeclass": {
  386. "index": "not_analyzed",
  387. "type": "string"
  388. },
  389. "buyerperson": {
  390. "index": "not_analyzed",
  391. "type": "string"
  392. },
  393. "purchasinglist": {
  394. "properties": {
  395. "number": {
  396. "type": "double"
  397. },
  398. "itemname": {
  399. "index": "not_analyzed",
  400. "type": "string"
  401. },
  402. "totalprice": {
  403. "type": "double"
  404. },
  405. "unitname": {
  406. "index": "not_analyzed",
  407. "type": "string"
  408. },
  409. "model": {
  410. "analyzer": "my_ngram",
  411. "type": "string"
  412. },
  413. "brandname": {
  414. "analyzer": "my_ngram",
  415. "type": "string"
  416. },
  417. "unitprice": {
  418. "type": "double"
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }'