附錄E:準備用于oVirt引擎的本地手動配置的PostgreSQL資料庫
使用此過程可以使用自定義值設定引擎資料庫。在配置引擎之前設定此資料庫; 您必須在提供資料庫憑據engine-setup。要設定資料庫,您必須首先ovirt-engine在引擎機器上安裝軟體包; 該postgresql-server軟體包作為依賴項安裝。
注:該engine-setup和engine-backup --mode=restore在指令唯一支援的系統錯誤消息en_US.UTF8的語言環境,即使系統區域設定是不同的。
postgresql.conf檔案中的區域設定必須設定為en_US.UTF8。
重要提示:資料庫名稱隻能包含數字,下劃線和小寫字母。
準備本地手動配置的PostgreSQL資料庫以與oVirt引擎一起使用
初始化PostgreSQL資料庫,啟動postgresql服務,并確定該服務在啟動時啟動:
# su -l postgres -c "/usr/bin/initdb --locale=en_US.UTF8 --auth='ident' --pgdata=/var/lib/pgsql/data/" # systemctl start postgresql.service # systemctl enable postgresql.service
以使用者psql身份連接配接到指令行界面postgres:
# su - postgres $ psql
為引擎建立一個使用者,以便在寫入和讀取資料庫時使用它。引擎上的預設使用者名是engine:
postgres=# create role user_name with login encrypted password 'password';
建立一個資料庫來存儲有關紅帽虛拟化環境的資料。引擎上的預設資料庫名稱是engine:
postgres=# create database database_name owner user_name template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
連接配接到新的資料庫并添加plpgsql語言:
postgres=# \c database_name database_name=# CREATE LANGUAGE plpgsql;
確定可以通過啟用md5用戶端身份驗證來遠端通路資料庫。編輯該/var/lib/pgsql/data/pg_hba.conf檔案,并local在檔案底部開始的行下面立即添加以下行:
host [database name] [user name] 0.0.0.0/0 md5 host [database name] [user name] ::0/0 md5
重新啟動postgresql服務:
# systemctl restart postgresql.service
本文轉自 Barron1 51CTO部落格,原文連結:http://blog.51cto.com/13172370/1980283,如需轉載請自行聯系原作者