###### tags: `XFS`
# XFS開發環境設定
* 使用 **Jhipster ( Angular + SpringBoot )**
* 後端開發 IDE: IntelliJ or Eclipse
* 前端開發 IDE: Visual Studio Code
* 版控 SVN
* 應用程式伺服器 **Embedded Tomcat**
* 資料庫 **Postgresql**
* AadoptOpenJDK Open**JDK 8** (LTS) HotSpot 8u222b10 [載點](https://adoptopenjdk.net/releases.html)
* Maven 3.5以上版本
> ***
> * **資料庫SERVER** : Postgresql
> * **資料庫工具**: DBeaver
> * **伺服器連線工具**:MobaXterm
> * **檔案傳輸工具**:FileZilla
> * **Restful服務測試工具**:Postman
>
> 載點 https://tinyurl.com/y9cna58t
> ***
## 開發
### 專案SVN
* 文件 http://scm.iisigroup.com/scm/svn/TDD17/svn/019-XFS/repo/Document
* 程式碼 http://scm.iisigroup.com/scm/svn/TDD17/svn/019-XFS/repo/Development
## 本機測試環境
* 本機測試-方式
* 1.熱部署(Hot deploy)
* 2.專案打包成JAR(build a JAR file with Maven)
```
1.熱部署(Hot deploy)
- [中1] -Dspring.profiles.active=dev,no-liquibase,dev-iisi,iisi-mid1
- [中2] -Dspring.profiles.active=dev,no-liquibase,dev-iisi,iisi-mid2
- [內] -Dspring.profiles.active=dev,no-liquibase,dev-iisi,iisi-in
- [外] -Dspring.profiles.active=dev,no-liquibase,dev-iisi,iisi-out
```
設定參數

啟動

```
2.專案打包成JAR(build a JAR file with Maven)
- [中1] prod iisi-mid1 dev-iisi no-liquibase copy-jar db-iisi
- [中2] prod iisi-mid2 dev-iisi no-liquibase copy-jar db-iisi
- [內] prod iisi-in dev-iisi no-liquibase copy-jar db-iisi
- [外] prod iisi-out dev-iisi no-liquibase copy-jar db-iisi
```

```
Maven將模組打包完成,執行JAR
cd c:\xsf
java -jar xfs-web.jar --啟動WEB
java -jar xfs-service.jar --啟動SERVICE
java -jar xfs-batch.jar --啟動BATCH
```

## VM測試環境
伺服器連線工具:MobaXterm
| VM主機名稱 | IP | 帳號 |密碼 |root密碼|
| -------- | -------- | -------- | -----| ----|
| xfs-mid1 | 192.168.57.205| xfs|!QAZ2wsx |!QAZ2wsx|
| xfs-mid2 | 192.168.57.209| xfs|!QAZ2wsx |!QAZ2wsx|
| xfs-inn | 192.168.57.206| xfs|!QAZ2wsx |!QAZ2wsx|
| xfs-out | 192.168.57.207| xfs|!QAZ2wsx |!QAZ2wsx|
---
檔案傳輸工具:FileZilla
|位置| FTP Host | 帳號 |密碼|port|
| --------| -------- | -------- | -----|-----|
|MID1| 192.168.57.205| xfs |!QAZ2wsx |22 |
|MID2| 192.168.57.209| xfs |!QAZ2wsx |22 |
|INN| 192.168.57.206| xfs |!QAZ2wsx |22 |
|OUT| 192.168.57.207| xfs |!QAZ2wsx |22 |
---
資料庫工具: DBeaver
| DB Host | 帳號 |密碼|port|Database|
| -------- | -------- | -----|-----|-----|
| 192.168.57.208| xfs_mid1 |xfs_mid1|5432|postgres
| 192.168.57.208| xfs_mid2 |xfs_mid2|5432|postgres
| 192.168.57.208| xfs_in |xfs_in|5432|postgres
| 192.168.57.208| xfs_out |xfs_out|5432|postgres
<font color="#f00">**目錄結構**</font>
```
JAR上傳位置=> /home/xfs/jar
LOG檔案位置=> /stsapp/xfs/logs
```
<font color="#f00">**執行JAR檔案**</font>
```
./xfs-web.sh {參數}
./xfs-service.sh {參數}
./xfs-batch.sh {參數}
參數:
- [ ] start (啟動)
- [ ] start (啟動)
- [ ] stop (停止)
- [ ] restart(重啟)
Example:
啟動web=> ./xfs-web.sh start
停用web=> ./xfs-web.sh stop
重啟web=> ./xfs-web.sh restart
```
檢查服務是否正常運作
(WEB)
https://192.168.57.205:8080/xfs-web/ 中(M1)
https://192.168.57.209:8080/xfs-web/ 中(M2)
https://192.168.57.206:8080/xfs-web/ 內(1)
https://192.168.57.210:8080/xfs-web/ 內(2)
https://192.168.57.207:8080/xfs-web/ 外(1)
https://192.168.57.211:8080/xfs-web/ 外(2)
(SERVICE)
https://192.168.57.205:8081/xfs-service/check/get 中(M1)
https://192.168.57.209:8081/xfs-service/check/get 中(M2)
https://192.168.57.206:8081/xfs-service/check/get 內(1)
https://192.168.57.207:8081/xfs-service/check/get 外(1)