tool.txt 9.3 KB

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