Selaa lähdekoodia

es备份恢复增加--limit提升效率

wukai 11 kuukautta sitten
vanhempi
commit
f891e1d016

+ 2 - 0
sync-in/src/main/java/com/jjt/in/service/impl/InEsServiceImpl.java

@@ -80,6 +80,7 @@ public class InEsServiceImpl extends InBaseService implements IInEsService {
                                 commands.add("--output");
                                 commands.add(uri);
                                 commands.add("--type=mapping");
+                                commands.add("--limit=10000");
                                 log.info("开始执行导入mapping命令:{}", commands);
                                 LinuxCommand.exec(commands);
                                 //导入data命令
@@ -90,6 +91,7 @@ public class InEsServiceImpl extends InBaseService implements IInEsService {
                                 commands.add("--output");
                                 commands.add(uri);
                                 commands.add("--type=data");
+                                commands.add("--limit=10000");
                                 log.info("开始执行导入data命令:{}", commands);
                                 LinuxCommand.exec(commands);
                             } catch (Exception e) {

+ 2 - 0
sync-out/src/main/java/com/jjt/out/service/impl/OutEsServiceImpl.java

@@ -137,6 +137,7 @@ public class OutEsServiceImpl extends OutBaseService implements IOutEsService {
             commands.add("--output");
             commands.add(tmpDir + mappingName);
             commands.add("--type=mapping");
+            commands.add("--limit=10000");
             LinuxCommand.exec(commands);
             //执行导出data命令
             commands = new ArrayList<>();
@@ -146,6 +147,7 @@ public class OutEsServiceImpl extends OutBaseService implements IOutEsService {
             commands.add("--output");
             commands.add(tmpDir + dataName);
             commands.add("--type=data");
+            commands.add("--limit=10000");
             LinuxCommand.exec(commands);
         } catch (Exception e) {
             throw new RuntimeException(e);