1. 程式人生 > 其它 >常用命令整理

常用命令整理

Windows檢視端口占用

netstat -aon|findstr "8081"

根據PID查詢程序

tasklist|findstr "9088"

殺掉程序

強制(/F引數)殺死 pid 為 9088 的所有程序包括子程序(/T引數):

taskkill /T /F /PID 9088

Influxdb建立表並設定保留策略

> create database testdb2 with duration 30d

檢視保留策略

> show retention policies on testdb2

建立保留策略

CREATE RETENTION POLICY "one_month" ON "testdb" DURATION 30d REPLICATION 1 DEFAULT

修改保留策略

> alter retention policy autogen on mydb duration 30d REPLICATION 1 SHARD DURATION 1d default

其中:

mydb:策略名
testdb:具體的資料庫名
30d:儲存 30 天,30 天之前的資料將被刪除,它具有各種時間引數,比如:h(小時),w(星期)
REPLICATION 1:副本個數,這裡填 1 就可以了
DEFAULT 設為預設的策略
shardGroupDuration :表示一個shard檔案所存的資料的時間跨度

PS : 如果切換資料庫的retention policy的話,已有的資料會被全部刪掉。