You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xu...@apache.org on 2020/02/27 07:18:36 UTC

[incubator-iotdb] branch IOTDB-479&IOTDB-328 created (now 302ba2c)

This is an automated email from the ASF dual-hosted git repository.

xuekaifeng pushed a change to branch IOTDB-479&IOTDB-328
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 302ba2c  fix bugs

This branch includes the following new commits:

     new 302ba2c  fix bugs

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: fix bugs

Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xuekaifeng pushed a commit to branch IOTDB-479&IOTDB-328
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 302ba2c4426a69fb6951c8b3770bffd2fcf61221
Author: 151250176 <15...@smail.nju.edu.cn>
AuthorDate: Thu Feb 27 15:18:13 2020 +0800

    fix bugs
---
 .../UserGuide/0-Get Started/1-QuickStart.md        |  7 +++++
 .../org/apache/iotdb/db/conf/IoTDBConfigCheck.java | 33 ++++++++++++++--------
 2 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/docs/Documentation/UserGuide/0-Get Started/1-QuickStart.md b/docs/Documentation/UserGuide/0-Get Started/1-QuickStart.md
index fb05a34..f6e2300 100755
--- a/docs/Documentation/UserGuide/0-Get Started/1-QuickStart.md	
+++ b/docs/Documentation/UserGuide/0-Get Started/1-QuickStart.md	
@@ -92,6 +92,13 @@ Users can start IoTDB by the start-server script under the sbin folder.
 > sbin\start-server.bat
 ```
 
+if you want to use JMX to connect IOTDB, you may need to add 
+
+```
+-Dcom.sun.management.jmxremote.rmi.port=PORT -Djava.rmi.server.hostname=IP 
+```
+to $IOTDB_JMX_OPTS in iotdb-env.sh. or iotdb-env.bat
+
 
 ### Use IoTDB
 
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfigCheck.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfigCheck.java
index e4e8e31..ec14db3 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfigCheck.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfigCheck.java
@@ -36,8 +36,9 @@ public class IoTDBConfigCheck {
   private static final IoTDBConfigCheck INSTANCE = new IoTDBConfigCheck();
   private static final Logger logger = LoggerFactory.getLogger(IoTDBDescriptor.class);
   // this is a initial parameter.
-  private static String TIMESTAMP_PRECISION = "ms";
-  private static long PARTITION_INTERVAL = 86400;
+  private static String timestampPrecision = "ms";
+  private static long partitionInterval = 86400;
+  private static String tsfileFileSystem = "LOCAL";
   private Properties properties = new Properties();
 
   public static final IoTDBConfigCheck getInstance() {
@@ -45,25 +46,27 @@ public class IoTDBConfigCheck {
   }
 
   public void checkConfig() {
-    TIMESTAMP_PRECISION = IoTDBDescriptor.getInstance().getConfig().getTimestampPrecision();
+    timestampPrecision = IoTDBDescriptor.getInstance().getConfig().getTimestampPrecision();
 
     // check time stamp precision
-    if (!(TIMESTAMP_PRECISION.equals("ms") || TIMESTAMP_PRECISION.equals("us")
-            || TIMESTAMP_PRECISION.equals("ns"))) {
+    if (!(timestampPrecision.equals("ms") || timestampPrecision.equals("us")
+            || timestampPrecision.equals("ns"))) {
       logger.error("Wrong timestamp precision, please set as: ms, us or ns ! Current is: "
-              + TIMESTAMP_PRECISION);
+              + timestampPrecision);
       System.exit(-1);
     }
 
-    PARTITION_INTERVAL = IoTDBDescriptor.getInstance().getConfig()
+    partitionInterval = IoTDBDescriptor.getInstance().getConfig()
             .getPartitionInterval();
 
     // check partition interval
-    if (PARTITION_INTERVAL <= 0) {
+    if (partitionInterval <= 0) {
       logger.error("Partition interval must larger than 0!");
       System.exit(-1);
     }
 
+    tsfileFileSystem = IoTDBDescriptor.getInstance().getConfig().getTsFileStorageFs().toString();
+
     createDir(SCHEMA_DIR);
     checkFile(SCHEMA_DIR);
     logger.info("System configuration is ok.");
@@ -87,8 +90,9 @@ public class IoTDBConfigCheck {
         file.createNewFile();
         logger.info(" {} has been created.", file.getAbsolutePath());
         try (FileOutputStream outputStream = new FileOutputStream(file.toString())) {
-          properties.setProperty("timestamp_precision", TIMESTAMP_PRECISION);
-          properties.setProperty("storage_group_time_range", String.valueOf(PARTITION_INTERVAL));
+          properties.setProperty("timestamp_precision", timestampPrecision);
+          properties.setProperty("storage_group_time_range", String.valueOf(partitionInterval));
+          properties.setProperty("tsfile_storage_fs", tsfileFileSystem);
           properties.store(outputStream, "System properties:");
         }
       }
@@ -100,17 +104,22 @@ public class IoTDBConfigCheck {
             .getFile(filepath + File.separator + PROPERTIES_FILE_NAME);
     try (FileInputStream inputStream = new FileInputStream(inputFile.toString())) {
       properties.load(new InputStreamReader(inputStream, TSFileConfig.STRING_CHARSET));
-      if (!properties.getProperty("timestamp_precision").equals(TIMESTAMP_PRECISION)) {
+      if (!properties.getProperty("timestamp_precision").equals(timestampPrecision)) {
         logger.error("Wrong timestamp precision, please set as: " + properties
                 .getProperty("timestamp_precision") + " !");
         System.exit(-1);
       }
       if (!(Long.parseLong(properties.getProperty("storage_group_time_range"))
-              == PARTITION_INTERVAL)) {
+              == partitionInterval)) {
         logger.error("Wrong storage group time range, please set as: " + properties
                 .getProperty("storage_group_time_range") + " !");
         System.exit(-1);
       }
+      if (!(properties.getProperty("tsfile_storage_fs").equals(tsfileFileSystem))) {
+        logger.error("Wrong tsfile file system, please set as: " + properties
+            .getProperty("tsfile_storage_fs") + " !");
+        System.exit(-1);
+      }
     } catch (IOException e) {
       logger.error("Load system.properties from {} failed.", file.getAbsolutePath(), e);
     }