Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Change tidb's lease time to the default value and refine doc (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE authored and littlezhou committed Nov 9, 2017
1 parent f818806 commit ea85ee1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/ssm-deployment-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ Configure SSM

* **Configure database**

MySQL or SQLite can be used to store metadata for SSM. Alternatively, you can just enable TiDB integrated with SSM.
MySQL or SQLite can be used to store metadata for SSM. Alternatively, you can just enable TiDB (rc4 version) which has been integrated with SSM.
TiDB is a distributed NewSQL database, which can provide good scalability and high availability for SSM.

You just need to follow the guide in one of the two following options to configure database for SSM.

Option 1. Use MySQL/SQLite
* Option 1. Use MySQL/SQLite

You need to install a MySQL or SQLite instance first. Open conf/druid.xml, configure how SSM can access MySQL DB. Basically filling out the jdbc url, username and password are enough.
Please be noted that, security support will be enabled later. Here is an example for MySQL,
Expand All @@ -101,7 +101,7 @@ Configure SSM

`ssm` is the database name. User needs to create it manually through MySQL client.

Option 2. Use SSM-TiDB
* Option 2. Use SSM-TiDB

Since TiDB has been integrated with SSM, you do not need to install TiDB beforehand.
TiDB can be enabled in smart-site.xml.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public int hashCode() {

@Override
public String toString() {
return "AgentRegistered{ id=" + id + "}";
return "AgentRegistered{id=" + id + "}";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static void startDB(SmartConf conf, AgentMaster agentMaster)
Thread.sleep(100);
}
LOG.info("Tikv server is ready.");
String tidbArgs = String.format("--store=tikv --path=%s:2379 --lease=1s", host);
String tidbArgs = String.format("--store=tikv --path=%s:2379 --lease=10s", host);
TidbServer tidbServer = new TidbServer(tidbArgs, conf);
Thread tidbThread = new Thread(tidbServer);
tidbThread.start();
Expand Down
2 changes: 1 addition & 1 deletion smart-tidb/src/main/java/org/smartdata/tidb/LaunchDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public LaunchDB(SmartConf conf) {
String pdArgs = "--data-dir=pd";
String tikvArgs = "--pd=127.0.0.1:2379 --data-dir=tikv";
//The default lease time is 10s. Setting a smaller value may decrease the time of executing ddl statement, but it's dangerous to do so.
String tidbArgs = "--store=tikv --path=127.0.0.1:2379 --lease=1s";
String tidbArgs = "--store=tikv --path=127.0.0.1:2379 --lease=10s";
//String tidbArgs = new String("--log-file=logs/tidb.log");

pdServer = new PdServer(pdArgs, conf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ python reset_env.py ResetEnv.test_create_1000_100MB
These commands will create 10K * 1MB in `1MB`, 10K * 10MB in `10MB` and 1K * 100MB in `100MB`.

2. Init/Rest SSM and remote HDFS
Stop, init and start SSM
Stop and start SSM with formatting database
```
bin/stop-ssm.sh
bin/init-ssm.sh
bin/start-ssm.sh
bin/start-ssm.sh -format
```

[Optional] Remove existing files in test directories of remote cluster:
Expand Down
6 changes: 3 additions & 3 deletions supports/integration-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ HDFS dfs -mkdir /test/
python reset_env.py -v
```

3. Init/Rest SSM
3. Stop and start SSM with formatting database

```
bin/stop-ssm.sh
bin/init-ssm.sh
bin/start-ssm.sh
bin/start-ssm.sh -format
```

## Run Test Scripts
Expand Down

0 comments on commit ea85ee1

Please sign in to comment.