ThingWorx Flow > ThingWorx Flow 安裝與管理 > ThingWorx Flow 8.5 安裝概觀 > 針對 PostgreSQL 的 ThingWorx Flow 先決條件
針對 PostgreSQL 的 ThingWorx Flow 先決條件
下面的內容提供您在安裝 ThingWorx Flow 之前需要設定的先決條件相關資訊:
安裝了 PostgreSQL 的 Windows Server 2016 的先決條件
擁有 Windows Server 2016 管理員存取權限
擁有 ThingWorx Flow 的本機或遠端資料庫連線。下表提供您需要設定的先決條件:
資料庫連線
先決條件
本機資料庫連線
已安裝 PostgreSQL,且路徑 PostgreSQL/bin 應該在 PATH 環境變數中可用。
要安裝 ThingWorx Flow 的主機必須擁有對 PostgreSQL 伺服器的存取權。
已更新 pg_hba.conf 檔案,以允許從 ThingWorx Flow 主機連線至 PostgreSQL。
例如,如果 ThingWorx Flow 安裝在與 PostgreSQL 相同的主機上,請更新 pg_hba.conf 檔案,以將密碼驗證方法設定為 md5passwordtrust。不過,不建議使用 trust
以下是密碼驗證設定為 md5pg_hba.conf 檔案的範例:
$ Edit pg_hba.conf for following:
...
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
如需有關 pg_hba.conf 檔案的詳細資訊,請參閱 此連結
遠端資料庫連線
安裝與 PostgreSQL 版本相容的 psql 用戶端。
將已安裝的 psql 新增至 PATH 環境變數。您可以依照下列步驟執行:
1. https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.1/windows/ 中下載 pgadmin4-4.1-x86.exe
2. 安裝 pgadmin 用戶端。
3. 更新 PATH 環境變數,以附加至 pgadmin 用戶端安裝位置的路徑。
可用於 ThingWorx Flow 的 PostgreSQL 資料庫。您可以使用現有 ThingWorx Foundation 資料庫或為 ThingWorx Flow 建立單獨的資料庫。在資料庫中設定下列組態設定:
將連線限制內容設定為 -1
Allow Connections? 內容設定為 Yes
Encoding 內容設定為 UTF-8
* 
請確保您未將此資料庫用於之前的 ThingWorx Flow 安裝。
請確保您的資料庫使用者擁有下列設定與權限:
將資料庫使用者設定為資料庫的擁有者。
Can login? 內容設定為 Yes
授與資料庫使用者對資料庫的所有權限。
含 PostgreSQL 的 Red Hat Enterprise Linux 7.5、7.6、8.0、8.1 或 8.2 的先決條件
* 
請務必在所支援版本的 Red Hat Enterprise Linux 上安裝 ThingWorx Flow。如需詳細資訊,請參閱 支援的作業系統
擁有具備管理員存取權的 Red Hat Enterprise Linux (RHEL) 7.5
/etc/selinux/config 檔案中,設定 SELINUX=enforcing,並重新啟動電腦。
執行下列指令來啟用軟體集合:
yum-config-manager --enable 'Red Hat Enterprise Linux Server 7 RHSCL (RPMs)'
yum-config-manager --enable 'Red Hat Enterprise Linux Server 7 Extra(RPMs)'
yum-config-manager --enable 'Red Hat Enterprise Linux Server 7 Optional (RPMs)'
yum-config-manager --enable 'Red Hat Enterprise Linux Server 7 RH Common (RPMs)'
yum-config-manager --enable 'Red Hat Enterprise Linux Server 7 Supplementary (RPMs)'
執行下列指令來啟用 EPEL 存放庫:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum localinstall epel-release-latest-7.noarch.rpm
擁有 ThingWorx Flow 的本機或遠端資料庫連線。下表提供您需要設定的先決條件:
資料庫連線
先決條件
本機資料庫連線
已安裝 PostgreSQL,且路徑 PostgreSQL/bin 應該在 PATH 環境變數中可用。
要安裝 ThingWorx Flow 的主機必須擁有對 PostgreSQL 伺服器的存取權。
已更新 pg_hba.conf 檔案,以允許從 ThingWorx Flow 主機連線至 PostgreSQL。
例如,如果 ThingWorx Flow 安裝在與 PostgreSQL 相同的主機上,請更新 pg_hba.conf 檔案,以將密碼驗證方法設定為 md5passwordtrust。不過,不建議使用 trust
以下是密碼驗證設定為 md5pg_hba.conf 檔案的範例:
$ Edit pg_hba.conf for following:
...
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
如需有關 pg_hba.conf 檔案的詳細資訊,請參閱 此連結
遠端資料庫連線
安裝與 PostgreSQL 版本相容的 psql 用戶端。
可用於 ThingWorx Flow 的 PostgreSQL 資料庫。您可以使用現有 ThingWorx Foundation 資料庫或為 ThingWorx Flow 建立單獨的資料庫。在資料庫中設定下列組態設定:
將連線限制內容設定為 -1
Allow Connections? 內容設定為 Yes
Encoding 內容設定為 UTF-8
* 
請確保您未將此資料庫用於之前的 ThingWorx Flow 安裝。
請確保您的資料庫使用者擁有下列設定與權限:
將資料庫使用者設定為資料庫的擁有者。
Can login? 內容設定為 Yes
授與資料庫使用者對資料庫的所有權限。
從您的 PosgreSQL 資料庫中,記下下列值:
PostgreSQL IP 位址或主機名稱
PostgreSQL 埠
ThingWorx Flow 資料庫名稱
ThingWorx Flow 資料庫登入使用者名稱
ThingWorx Flow 資料庫登入密碼