# Node simulator manual

* image & chart放置位置
  * image放置在harbor上datahub-dev/Repositories/datahub-performer (Figure 1)&#x20;
  * helm chart放置在habor上datahub-dev/Helm Charts/datahub-performer (Figure 2)

![Figure 1](/files/-MCzVzo6SWTAXMIdEdUT)

![Figure 2](/files/-MCzVXBhBehMtrOnENFU)

* 使用helm chart部屬simulator

  * 到habor上複製datahub-performer values的內容
  * Figure 2圖中datahub-performer點進去到Figure 3畫面
  * 點選1.0.0到Figure 4畫面
  * 點選上方的values 複製下方的內容並存成values.yaml

![Figure 3](/files/-MCzXXOsDb-N-EOfhiQk)

![Figure 4](/files/-MCzZ52hdoQ_FR4aYEk4)

* 在values.yaml的根目錄下，執行以下指令
  * 指令說明helm install \[欲部屬的名稱] \[放置chart的資料夾名稱/chart的名稱] --version \[chart的版本號] -f ./values.yaml

```
 helm install simulator-test datahub-dev/datahub-performer --version 1.0.0 -f ./values.yaml
```

* 部屬完成後，kubectl get pod可以看到如Figure 5所示

![Figure 5](/files/-MCzacbyAnnDzhogzYHZ)

* 連進此pod進行壓測的參數設定，連進去的指令如下

```
kubectl exec -it simulator-test-datahub-performer-544d458df5-2kqfj /bin/bash
```

* 進去後執行ls指令，可以看到根目錄下的目錄結構

```
ls
```

![Figure 6](/files/-MCzbftxCEz92AugqNc_)

* 接著對setting.json進行配置，利用setting.sh用指令的方式幫你修改setting.json的內容，setting.sh的指令參數如下

```
//以下參數對應setting.json中的參數
host="" //對應mqttHost
port=1883 //對應mqttPort
username="" //對應mqttUserName
password="" //對應mqttPassword
scadaNums=1 //對應scadaNumbers
deviceNums=1 //對應deviceNumbers
tagNums=75 //對應tagNumbers
timeInterval=1000 //對應publishIntervalTime
execTime=86400 //對應exectionTime，若為0則不停止
useSame=false //對應isUseSame
```

* 指令格式: ./setting.sh paramName1=value1 paramName2=value2 paramName3=value3 ...\
  \*可以任選上面的參數填入想修改的值，(意思是可以全部都填，也可以選擇想改的參數填入就好)，以下兩種範例都舉例

```
./setting.sh host="rabbitmq-001-pub.sa.wise-paas.com" port=1883 username="03bdd820-4d47-40a2-9aff-85613c201b58:61734256-adfet-477f-9b3f-fswerwerad" password="aqetdfhwehqwthlqw" scadaNums=100 deviceNums=1 tagNums=1000 timeInterval=1000 useSame=false
```

```
./setting.sh host="rabbitmq-001-pub.sa.wise-paas.com" scadaNums=100 deviceNums=10
```

* 執行完畢後會顯示修改的內容，如下圖(Figure 7)

![Figure 7](/files/-MCzc8PJcP4WjpZnl1P8)

* 若修改正確執行node index.js啟動模擬，若修改不正確回上一步重新執行修改

```
node index.js //執行模擬
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://advwacloud.gitbook.io/rd-newbie-guide/kai-fa-huan-jing/node-simulator-manual.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
