---
# System prepended metadata

title: Install edge server
tags: [Check Point 初始版]

---

# Install edge server
###### tags: `Check Point 初始版`
Install Ubuntu 18.04
**設定網路**
![](https://i.imgur.com/ohkl1ns.jpg)
**安裝套件**
(必做)#apt-get update
(必做)#apt-get install git
(必做)#apt-get install net-tools     //可以使用ifconfig
(必做)#apt-get install openssh-server  //類似Terminal
#apt-get install zip unzip
#apt-get install -y pbzip2    //製作IEI USB image必需
#apt-get install clamav    //防毒軟體


**Download edgo server project to install**
cd /home/test; git clone http://nayana:1wXDJo-z9hjnebZqCxqf@40.74.91.221/puzzle/edge-server-factory-env
cd edge-server-factory-env
chmod 777 setup.sh
bash setup.sh   (setup.sh一定要在/home/test路徑下安裝)

**Open UI**
Factory Tool API/UI Port: 3000 , http://localhost:3000  (http://localhost:3000)
Config Management API/UI Port: 3001, http://localhost:3001
(http://localhost:3001)

**HMS測試區帳號密碼**
Operator ID : brianyang@ieiworld.com
Password : P@ssw0rd
工廠HMS 帳號密碼(20190904已失效)
Operator ID : 81189
Password : 81189

**(必做)第一次要同意此ssh (Re-Image)**
#ssh hwtest@172.16.2.167
yes

rm ~/.ssh/known_hosts (清除同意ssh)
sudo /etc/init.d/ssh restart

**log(debug)**
#systemctl stop pm2-root
/home/test/EdgeServer/apiserver#nodemon app.js

**version**
/home/test# cat /etc/puzzle/version/.factory 
![](https://i.imgur.com/bOUZLtv.png)


**Set config for server type, then reboot PC**
Defalut server is D-Tool
Edit file: 
#vi /home/test/EdgeServer/apiserver/config/config.js

serveras : "HUBMULTITEST" //HWTEST/BURNTEST/HUBTEST/HUBMULTITEST
![](https://i.imgur.com/Ntjyr1T.png)


更改完重新啟動pm2-root server或者作業系統重新開機
#systemctl restart pm2-root
#systemctl status pm2-root    //status show online
![](https://i.imgur.com/LZLrp7E.png)


#systemctl restart mongodb    //更新mongodb server
#systemctl status mongodb    //查看mongodb server
![](https://i.imgur.com/VweEWyH.png)

**用screen方式連console**
#apt-get install screen
#screen /dev/ttyUSB0 115200
離開頁面 ctrl+A+D
離線方式只能直接USB插拔

**修改Hubtest-Function test測試項目**
#vi /home/test/EdgeServer/apiserver/hub/hubStagesConfig.js
一共11個測試項目,前面加"//"可以移除測試項目,設定完一樣作業系統重新開機或者systemctl restart pm2-root
![](https://i.imgur.com/zPSsHsV.png)

**查看Product Name INFO**
https://grmatest.ieiworld.com/GRMAWebService.asmx?op=GetHMSVPDKeypartsDataJ
新版確認2019/10/07(update image)
pCpdoctype : Image File / uBoot File(connectHMSCPImage.js)
https://grmatest.ieiworld.com/GRMAWebService.asmx?op=Get_cp_sn_upgrade_info
https://beautifier.io/


**查看Re-Image Info**
https://grmatest.ieiworld.com/GRMAWebService.asmx?op=GetHMSCPFileURL
![](https://i.imgur.com/6Qq0dBu.png)

**FT3 MES Check**
http://mesolap.qnap.com.tw/qnapwebservice/Service.asmx?op=GetHMSCPFileURL

**Get Device Info**
http://192.168.0.2:3000/cp/puzzle/api/v1/test/getHubCache

https://docs.google.com/spreadsheets/d/19wdRWJRD1FkXtkk1wPXxOEN5XJVwOeXqcOteoJySQPY/edit#gid=942305997

**BrunTest 接法**
![](https://i.imgur.com/mFWlt3k.png)

**Update api console factorytool**
#git pull
/home/test/edge-server-factory-env# bash update.sh

**edit BurnTEST time**
/home/test/EdgeServer/apiserver/core/testoperations.js![](https://i.imgur.com/2lGFf0h.png)

default Burn 2032 status
Run : http://localhost:3000/cp/puzzle/api/v1/test/setBI
/home/test/EdgeServer/apiserver/routes/test.js
![](https://i.imgur.com/PesIGXp.png)
![](https://i.imgur.com/Vwum7tK.png)


MES Report
http://iei-mesolap2.iei.com.tw/Reports/Pages/Report.aspx?ItemPath=%2fMESReports_Prod%2fRepair+And+Test%2fCP+Test+Log+Data

Get_PLM_ECN_Info
#ssh hwtest@172.16.2.167
#cd /share/CP/plm/

MES 測試區
http://mesolap.qnap.com.tw/qnapwebtest/service.asmx

let MESTest = true;
// Formal
let MESHostURL = "http://mesolap.qnap.com.tw/qnapwebservice/Service.asmx";
let MESHostURLTest = "http://mesolap.qnap.com.tw/qnapwebtest/Service.asmx";

// Test Only
// let MESHostURL = "http://qidu-qmesfs/qnapwebservice/service.asmx";
// let MESHostURLTest = "http://qidu-qmesfs/qnapwebservice/service.asmx";

const HMSTest = true;

let HMSHostURLFormal = "https://ihms.ieiworld.com/GRMAWebService.asmx";
let HMSHostURLTest = "https://ihmstest.ieiworld.com/grmawebservice.asmx";

HUB v2.1.0

vi /home/test/JumpServer/jumpServer/syncData# vim syncTimer.js 
const UTCTimeToSync = "T05:51:00"; (T08:00:00)

vi /home/test/JumpServer/jumpServer/routes# vi operations.js 
        DataUpdateTrigger('SNVPDUpdate', snList);
        setTimeout(() => {
            DataUpdateTrigger('SnCurrentInfoUpdate', snList);
        }, 10 * 1000);
        setTimeout(() => {
            DataUpdateTrigger('SNUpgradeInfoImageUpdate', snList);
        }, 20 * 1000);
        setTimeout(() => {
            DataUpdateTrigger('SNUpgradeInfoUBootUpdate', snList);
        }, 30 * 1000);
        setTimeout(() => {
            DataUpdateTrigger('UserAccountInfoUpdate', snList);
        }, 40 * 1000);
        setTimeout(() => {
            DataUpdateTrigger('blobCheckResultUpdate', snList);
        }, 50 * 1000);

到jumpserver手動加SN
#ssh test@172.16.2.126
login : test
password : 8888
cd /jumpServer/jumpServer/routes/operations.js
// snList = [""]


下午四點更新SN 6筆到Jumpserver
每30分鐘爬一次,共爬三次資料.沒有取到的會利用line回報
eJumpServerCollectionName
1 * 30 * 60 * 1000
2 * 30 * 60 * 1000
3 * 30 * 60 * 1000


JUMP SERVER
每一小時的01分跟JumpServer要VPD等六筆資料
vi /home/test/EdgeServer/apiserver/core/syncoperations.js
    //Execute this process every hour at  eg. 9.10, 10.10, 11.10, 12.10...
    schedule.scheduleJob('01 * * * *', function(){
        processSyncJumpToEdgeServer();







