oVirt Reports Portal 3.4 added to ovirt-engine
生活随笔
收集整理的這篇文章主要介紹了
oVirt Reports Portal 3.4 added to ovirt-engine
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
配置完oVirt engine后, 可以進行用戶管理和虛擬化平臺的管理, 但是無法生成報告. 如圖, 點擊Reports Portal會告訴你沒有安裝report application.
安裝ovirt engine可參考昨天發(fā)的一篇文章. http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/ engine report建議在engine配置前就安裝, 那么只需engine-setup時可以直接配置. 現(xiàn)在的話, 等于已經配置了engine, 再加一個engine report的功能. 步驟如下 :
# yum install -y ovirt-engine-reportsInstalling:ovirt-engine-reports noarch 3.4.3-1.el6 ovirt-3.4-stable 1.1 M Installing for dependencies:jasperreports-server noarch 5.5.0-7.el6 ovirt-3.4-stable 423 Mliberation-mono-fonts noarch 1.05.1.20090721-5.el6 C6.3-base 222 kovirt-engine-dwh-setup noarch 3.4.3-1.el6 ovirt-3.4-stable 51 kovirt-engine-reports-setup noarch 3.4.3-1.el6 ovirt-3.4-stable 54 k
安裝時可能遇到GPGCHECK的問題, 加這個參數(shù)處理--nogpgcheck.
Package ovirt-engine-dwh-setup-3.4.3-1.el6.noarch.rpm is not signedyum install --nogpgcheck -y ovirt-engine-reports
然后執(zhí)行engine-setup配置.
[root@db-172-16-3-150 ~]# engine-setup --help Usage: /usr/bin/engine-setup--log=filewrite log to this file.--config=fileLoad configuration files.--config-append=fileLoad extra configuration files or answer file.--offlineOffline mode.--generate-answer=fileGenerate answer file.--jboss-home=dirUse this jboss.
使用engine-setup過程中, 需要調用pg_dump備份數(shù)據(jù)庫, 這個命令會調用/usr/bin/pg_dump, 而且嘗試了幾種辦法沒有辦法修改為其他路徑下的pg_dump(因為備份和服務端的版本不匹配會導致pg_dump失敗). ?(見末尾) 所以使用了一個方法, 直接覆蓋.
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_dump /usr/bin cp: overwrite `/usr/bin/pg_dump'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_restore /usr/bin cp: overwrite `/usr/bin/pg_restore'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/psql /usr/bin cp: overwrite `/usr/bin/psql'? y
還需要修改數(shù)據(jù)庫用戶的權限, 備份時開啟了read only事務, 必須超級用戶.?
2014-07-29 22:28:18 DEBUG otopi.plugins.**FILTERED**_engine_setup.**FILTERED**_engine.db.schema plugin.execute:866 execute-output: ('/usr/bin/pg_dump', '-E', 'UTF8', '--disable-dollar-quoting', '--disable-triggers', '--format=c', '-U', '**FILTERED**', '-h', 'localhost', '-p', '5432', '-f', '/var/lib/**FILTERED**-engine/backups/engine-20140729222818.Rbikl1.dump', '**FILTERED**') stderr: pg_dump: [archiver (db)] query failed: ERROR: permission denied to set parameter "transaction_read_only" pg_dump: [archiver (db)] query was: SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY
修改為超級用戶.
postgres=# alter role ovirt superuser; ALTER ROLE
安裝ovirt-report需要用到兩個數(shù)據(jù)庫, 一個歷史庫, 一個報告庫. 需要新建. 用戶使用ovirt同一個用戶, 不一樣也行, 無所謂.
# cd /ssd4/pg93 # mkdir tbs_ovirt_eh # chown pg93:pg93 tbs_ovirt_eh[root@db-172-16-3-150 pg93]# su - pg93 pg93@db-172-16-3-150-> psql psql (9.3.3) Type "help" for help.digoal=# create tablespace tbs_ovirt_eh location '/ssd4/pg93/tbs_ovirt_eh'; CREATE TABLESPACE digoal=# create database ovirt_eh with template template0 encoding 'UTF8' tablespace tbs_ovirt_eh owner ovirt; CREATE DATABASE digoal=# \c ovirt_eh ovirt You are now connected to database "ovirt_eh" as user "ovirt". -- ovirt_eh=> create schema ovirt; -- 不推薦自建schema, 建議使用public. 和ovirt engine原因一樣 . -- CREATE SCHEMApg93@db-172-16-3-150-> mkdir /ssd4/pg93/tbs_ovirt_er pg93@db-172-16-3-150-> psql psql (9.3.3) Type "help" for help.digoal=# create tablespace tbs_ovirt_er location '/ssd4/pg93/tbs_ovirt_er'; CREATE TABLESPACE digoal=# create database ovirt_er with template template0 encoding 'UTF8' tablespace tbs_ovirt_er owner ovirt; CREATE DATABASE digoal=# \c ovirt_er ovirt You are now connected to database "ovirt_er" as user "ovirt". -- ovirt_er=> create schema ovirt; -- 不推薦自建schema, 建議使用public. 和ovirt engine原因一樣 . -- CREATE SCHEMA ovirt_er=> \c postgres postgres You are now connected to database "postgres" as user "postgres". postgres=# grant all on tablespace tbs_ovirt_eh to ovirt; GRANT postgres=# grant all on tablespace tbs_ovirt_er to ovirt; GRANT postgres=# \q
現(xiàn)在還不能執(zhí)行engine-setup, 務必改一下yum, 因為某些依賴包可能需要簽名認證, 如果沒有簽名會導致認證失敗. 不推薦這么做, 建議導入KEY. http://blog.163.com/digoal@126/blog/static/1638770402014740018561/ 關閉檢測.
vi /etc/yum.repos.d/ovirt-3.4-dependencies.repo vi /etc/yum.repos.d/ovirt-3.4.repo 修改所有的 gpgcheck=0.
可以執(zhí)行engine-setup了, 執(zhí)行過程中會重啟ovirt-engine服務, 不過不會影響host上跑的虛擬機, 所以可以放心在線配置.
[root@db-172-16-3-150 ~]# engine-setup [ INFO ] Stage: Initializing [ INFO ] Stage: Environment setupConfiguration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140729223458-tzk701.logVersion: otopi-1.2.2 (otopi-1.2.2-1.el6) [ INFO ] Stage: Environment packages setup [ INFO ] Yum Downloading: ovirt-3.4-epel/metalink (0%) [ INFO ] Yum Downloading: repomdydzDTUtmp.xml (0%) [ INFO ] Yum Downloading: repomd3tKhg7tmp.xml (0%) [ INFO ] Yum Downloading: repomdcWBV6Ttmp.xml (0%) [ INFO ] Stage: Programs detection [ INFO ] Stage: Environment setup [ INFO ] Stage: Environment customization--== PRODUCT OPTIONS ==--Configure Reports on this host (Yes, No) [Yes]: Configure Data Warehouse on this host (Yes, No) [Yes]: --== PACKAGES ==--[ INFO ] Checking for product updates... [ INFO ] No product updates found--== NETWORK CONFIGURATION ==--Setup can automatically configure the firewall on this system.Note: automatic configuration of the firewall may overwrite current settings.Do you want Setup to configure the firewall? (Yes, No) [Yes]: No--== DATABASE CONFIGURATION ==--Where is the DWH database located? (Local, Remote) [Local]: Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ManualATTENTIONManual action required.Please create database for ovirt-engine use. Use the following commands as an example:create role ovirt_engine_history with login encrypted password 'ovirt_engine_history';create database ovirt_engine_history owner ovirt_engine_historytemplate template0encoding 'UTF8' lc_collate 'en_US.UTF-8'lc_ctype 'en_US.UTF-8';Make sure that database can be accessed remotely.DWH database secured connection (Yes, No) [No]: DWH database name [ovirt_engine_history]: ovirt_ehDWH database user [ovirt_engine_history]: ovirtDWH database password: Where is the Reports database located? (Local, Remote) [Local]: Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ManualATTENTIONManual action required.Please create database for ovirt-engine use. Use the following commands as an example:create role ovirt_engine_reports with login encrypted password 'ovirt_engine_reports';create database ovirt_engine_reports owner ovirt_engine_reportstemplate template0encoding 'UTF8' lc_collate 'en_US.UTF-8'lc_ctype 'en_US.UTF-8';Make sure that database can be accessed remotely.Reports database secured connection (Yes, No) [No]: Reports database name [ovirt_engine_reports]: ovirt_erReports database user [ovirt_engine_reports]: ovirtReports database password: --== OVIRT ENGINE CONFIGURATION ==--Skipping storing options as database already prepared--== PKI CONFIGURATION ==--PKI is already configured--== APACHE CONFIGURATION ==----== SYSTEM CONFIGURATION ==----== MISC CONFIGURATION ==--Reports power users password: 輸入engien123Confirm Reports power users password: 輸入engien123--== END OF CONFIGURATION ==--[ INFO ] Stage: Setup validation [ INFO ] Cleaning stale zombie tasks--== CONFIGURATION PREVIEW ==--Engine database name : ovirtEngine database secured connection : FalseEngine database host : localhostEngine database user name : ovirtEngine database host name validation : FalseEngine database port : 5432Update Firewall : FalseConfigure WebSocket Proxy : FalseHost FQDN : db-172-16-3-150.sky-mobi.comNFS mount point : /ssd4/ovirt/isoDWH installation : TrueDWH database name : ovirt_ehDWH database secured connection : FalseDWH database host : localhostDWH database user name : ovirtDWH database host name validation : FalseDWH database port : 5432Configure local DWH database : FalseReports installation : TrueReports database name : ovirt_erReports database secured connection : FalseReports database host : localhostReports database user name : ovirtReports database host name validation : FalseReports database port : 5432Configure local Reports database : FalsePlease confirm installation settings (OK, Cancel) [OK]: [ INFO ] Cleaning async tasks and compensations [ INFO ] Checking the Engine database consistency [ INFO ] Stage: Transaction setup [ INFO ] Stopping engine service [ INFO ] Stopping dwh service [ INFO ] Stopping websocket-proxy service [ INFO ] Stage: Misc configuration [ INFO ] Stage: Package installation [ INFO ] Stage: Misc configuration [ INFO ] Backing up database localhost:ovirt to '/var/lib/ovirt-engine/backups/engine-20140729223904.dQpGRz.dump'. [ INFO ] Updating Engine database schema [ INFO ] Creating/refreshing DWH database schema [ INFO ] Deploying Jasper [ INFO ] Importing data into Jasper [ INFO ] Configuring Jasper Java resources [ INFO ] Configuring Jasper Database resources [ INFO ] Customizing Jasper [ INFO ] Customizing Jasper metadata [ INFO ] Generating post install configuration file '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf' [ INFO ] Stage: Transaction commit [ INFO ] Stage: Closing up--== SUMMARY ==--SSH fingerprint: 36:C7:7C:1F:6C:BA:8E:A1:C3:5E:30:1B:AB:07:CA:B7Internal CA 5D:77:8F:FF:12:7A:47:1A:20:D2:34:5E:83:8D:FB:7B:B3:78:68:55Web access is enabled at:http://db-172-16-3-150.sky-mobi.com:80/ovirt-enginehttps://db-172-16-3-150.sky-mobi.com:443/ovirt-engineIn order to configure firewalld, copy the files from/etc/ovirt-engine/firewalld to /etc/firewalld/servicesand execute the following commands:firewall-cmd -service ovirt-postgresfirewall-cmd -service ovirt-httpsfirewall-cmd -service ovirt-httpThe following network ports should be opened:tcp:443tcp:5432tcp:80An example of the required configuration for iptables can be found at:/etc/ovirt-engine/iptables.example--== END OF SUMMARY ==--[ INFO ] Starting engine service [ INFO ] Restarting httpd [ INFO ] Starting dwh service [ INFO ] Stage: Clean upLog file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20140729223458-tzk701.log [ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20140729224557-setup.conf' [ INFO ] Stage: Pre-termination [ INFO ] Stage: Termination [ INFO ] Execution of setup completed successfully
配置完, 修改回普通用戶.
postgres=# alter role ovirt nosuperuser; ALTER ROLE
現(xiàn)在可以打開報告了, 從ovirt-engine或以下URL進入. https://172.16.3.150/ovirt-engine-reports/ ?
[其他] 1. pg_dump備份問題的幾種解決辦法, 都無效. 如果數(shù)據(jù)庫使用了ovirt打包的依賴版本, 例如9.3.5, 那么請把這個版本的bin路徑加到/etc/profile, 因為執(zhí)行engine-setup的時候可能用到pg_dump , 版本不對可能導致備份失敗.
vi /etc/profile export PATH=/home/pg93/pgsql/bin:$PATH
退出shell重進, 確認pg_dump路徑正確.
# which psql /home/pg93/pgsql/bin/psql
或者執(zhí)行engine-setup時設置PATH也行. 或者修改ovirt-engine 的 python腳本. 報錯信息
[ INFO ] Backing up database localhost:ovirt to '/var/lib/ovirt-engine/backups/engine-20140729213449.w8H6bH.dump'. [ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/bin/pg_dump' failed to execute
日志中都報錯信息, 說明了版本問題.
2014-07-29 21:34:49 DEBUG otopi.plugins.**FILTERED**_engine_setup.**FILTERED**_engine.db.schema plugin.execute:866 execute-output: ( '/usr/bin/pg_dump', '-E', 'UTF8', '--disable-dollar-quoting', '--disable-triggers', '--format=c', '-U', '**FILTERED**', '-h', 'local host', '-p', '5432', '-f', '/var/lib/**FILTERED**-engine/backups/engine-20140729213449.w8H6bH.dump', '**FILTERED**') stderr: pg_dump: server version: 9.3.3; pg_dump version: 8.4.20 pg_dump: aborting because of server version mismatch
修改ovirt-engine的python腳本, 還是沒有效果.
/usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.pyself._engineEnv.update({'PATH': ('/home/pg93/pgsql/bin:/usr/local/sbin:/usr/local/bin:''/usr/sbin:/usr/bin:/sbin:/bin'),/usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.pyself._engineEnv = os.environ.copy()self._engineEnv.update({'PATH': ('/home/pg93/pgsql/bin:/usr/local/sbin:/usr/local/bin:''/usr/sbin:/usr/bin:/sbin:/bin'),
修改后, 日志依舊顯示使用了/usr/bin/pg_dump
/var/log/ovirt-engine/setup/ 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:468 ENVIRONMENT DUMP - BEGIN 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/chkconfig=str:'/sbin/chkconfig' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/date=str:'/bin/date' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/hwclock=str:'/sbin/hwclock' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/initctl=str:'/sbin/initctl' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/ip=str:'/sbin/ip' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/ntpq=str:'/usr/sbin/ntpq' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/pg_dump=str:'/usr/bin/pg_dump' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/pg_restore=str:'/usr/bin/pg_restore' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/psql=str:'/usr/bin/psql' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/reboot=str:'/sbin/reboot' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/restorecon=str:'/sbin/restorecon' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/service=str:'/sbin/service' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:482 ENVIRONMENT DUMP - END
最終選擇了覆蓋.
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_dump /usr/bin cp: overwrite `/usr/bin/pg_dump'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_restore /usr/bin cp: overwrite `/usr/bin/pg_restore'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/psql /usr/bin cp: overwrite `/usr/bin/psql'? y
[參考] 1.?http://wiki.ovirt.org/Ovirt_Reports 2.?http://www.ovirt.org/How_to_setup_a_oVirt_Reports_development_environment 3.?http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/ 4.?http://wiki.centos.org/HowTos/oVirt
安裝ovirt engine可參考昨天發(fā)的一篇文章. http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/ engine report建議在engine配置前就安裝, 那么只需engine-setup時可以直接配置. 現(xiàn)在的話, 等于已經配置了engine, 再加一個engine report的功能. 步驟如下 :
# yum install -y ovirt-engine-reportsInstalling:ovirt-engine-reports noarch 3.4.3-1.el6 ovirt-3.4-stable 1.1 M Installing for dependencies:jasperreports-server noarch 5.5.0-7.el6 ovirt-3.4-stable 423 Mliberation-mono-fonts noarch 1.05.1.20090721-5.el6 C6.3-base 222 kovirt-engine-dwh-setup noarch 3.4.3-1.el6 ovirt-3.4-stable 51 kovirt-engine-reports-setup noarch 3.4.3-1.el6 ovirt-3.4-stable 54 k
安裝時可能遇到GPGCHECK的問題, 加這個參數(shù)處理--nogpgcheck.
Package ovirt-engine-dwh-setup-3.4.3-1.el6.noarch.rpm is not signedyum install --nogpgcheck -y ovirt-engine-reports
然后執(zhí)行engine-setup配置.
[root@db-172-16-3-150 ~]# engine-setup --help Usage: /usr/bin/engine-setup--log=filewrite log to this file.--config=fileLoad configuration files.--config-append=fileLoad extra configuration files or answer file.--offlineOffline mode.--generate-answer=fileGenerate answer file.--jboss-home=dirUse this jboss.
使用engine-setup過程中, 需要調用pg_dump備份數(shù)據(jù)庫, 這個命令會調用/usr/bin/pg_dump, 而且嘗試了幾種辦法沒有辦法修改為其他路徑下的pg_dump(因為備份和服務端的版本不匹配會導致pg_dump失敗). ?(見末尾) 所以使用了一個方法, 直接覆蓋.
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_dump /usr/bin cp: overwrite `/usr/bin/pg_dump'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_restore /usr/bin cp: overwrite `/usr/bin/pg_restore'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/psql /usr/bin cp: overwrite `/usr/bin/psql'? y
還需要修改數(shù)據(jù)庫用戶的權限, 備份時開啟了read only事務, 必須超級用戶.?
2014-07-29 22:28:18 DEBUG otopi.plugins.**FILTERED**_engine_setup.**FILTERED**_engine.db.schema plugin.execute:866 execute-output: ('/usr/bin/pg_dump', '-E', 'UTF8', '--disable-dollar-quoting', '--disable-triggers', '--format=c', '-U', '**FILTERED**', '-h', 'localhost', '-p', '5432', '-f', '/var/lib/**FILTERED**-engine/backups/engine-20140729222818.Rbikl1.dump', '**FILTERED**') stderr: pg_dump: [archiver (db)] query failed: ERROR: permission denied to set parameter "transaction_read_only" pg_dump: [archiver (db)] query was: SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY
修改為超級用戶.
postgres=# alter role ovirt superuser; ALTER ROLE
安裝ovirt-report需要用到兩個數(shù)據(jù)庫, 一個歷史庫, 一個報告庫. 需要新建. 用戶使用ovirt同一個用戶, 不一樣也行, 無所謂.
# cd /ssd4/pg93 # mkdir tbs_ovirt_eh # chown pg93:pg93 tbs_ovirt_eh[root@db-172-16-3-150 pg93]# su - pg93 pg93@db-172-16-3-150-> psql psql (9.3.3) Type "help" for help.digoal=# create tablespace tbs_ovirt_eh location '/ssd4/pg93/tbs_ovirt_eh'; CREATE TABLESPACE digoal=# create database ovirt_eh with template template0 encoding 'UTF8' tablespace tbs_ovirt_eh owner ovirt; CREATE DATABASE digoal=# \c ovirt_eh ovirt You are now connected to database "ovirt_eh" as user "ovirt". -- ovirt_eh=> create schema ovirt; -- 不推薦自建schema, 建議使用public. 和ovirt engine原因一樣 . -- CREATE SCHEMApg93@db-172-16-3-150-> mkdir /ssd4/pg93/tbs_ovirt_er pg93@db-172-16-3-150-> psql psql (9.3.3) Type "help" for help.digoal=# create tablespace tbs_ovirt_er location '/ssd4/pg93/tbs_ovirt_er'; CREATE TABLESPACE digoal=# create database ovirt_er with template template0 encoding 'UTF8' tablespace tbs_ovirt_er owner ovirt; CREATE DATABASE digoal=# \c ovirt_er ovirt You are now connected to database "ovirt_er" as user "ovirt". -- ovirt_er=> create schema ovirt; -- 不推薦自建schema, 建議使用public. 和ovirt engine原因一樣 . -- CREATE SCHEMA ovirt_er=> \c postgres postgres You are now connected to database "postgres" as user "postgres". postgres=# grant all on tablespace tbs_ovirt_eh to ovirt; GRANT postgres=# grant all on tablespace tbs_ovirt_er to ovirt; GRANT postgres=# \q
現(xiàn)在還不能執(zhí)行engine-setup, 務必改一下yum, 因為某些依賴包可能需要簽名認證, 如果沒有簽名會導致認證失敗. 不推薦這么做, 建議導入KEY. http://blog.163.com/digoal@126/blog/static/1638770402014740018561/ 關閉檢測.
vi /etc/yum.repos.d/ovirt-3.4-dependencies.repo vi /etc/yum.repos.d/ovirt-3.4.repo 修改所有的 gpgcheck=0.
可以執(zhí)行engine-setup了, 執(zhí)行過程中會重啟ovirt-engine服務, 不過不會影響host上跑的虛擬機, 所以可以放心在線配置.
[root@db-172-16-3-150 ~]# engine-setup [ INFO ] Stage: Initializing [ INFO ] Stage: Environment setupConfiguration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140729223458-tzk701.logVersion: otopi-1.2.2 (otopi-1.2.2-1.el6) [ INFO ] Stage: Environment packages setup [ INFO ] Yum Downloading: ovirt-3.4-epel/metalink (0%) [ INFO ] Yum Downloading: repomdydzDTUtmp.xml (0%) [ INFO ] Yum Downloading: repomd3tKhg7tmp.xml (0%) [ INFO ] Yum Downloading: repomdcWBV6Ttmp.xml (0%) [ INFO ] Stage: Programs detection [ INFO ] Stage: Environment setup [ INFO ] Stage: Environment customization--== PRODUCT OPTIONS ==--Configure Reports on this host (Yes, No) [Yes]: Configure Data Warehouse on this host (Yes, No) [Yes]: --== PACKAGES ==--[ INFO ] Checking for product updates... [ INFO ] No product updates found--== NETWORK CONFIGURATION ==--Setup can automatically configure the firewall on this system.Note: automatic configuration of the firewall may overwrite current settings.Do you want Setup to configure the firewall? (Yes, No) [Yes]: No--== DATABASE CONFIGURATION ==--Where is the DWH database located? (Local, Remote) [Local]: Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ManualATTENTIONManual action required.Please create database for ovirt-engine use. Use the following commands as an example:create role ovirt_engine_history with login encrypted password 'ovirt_engine_history';create database ovirt_engine_history owner ovirt_engine_historytemplate template0encoding 'UTF8' lc_collate 'en_US.UTF-8'lc_ctype 'en_US.UTF-8';Make sure that database can be accessed remotely.DWH database secured connection (Yes, No) [No]: DWH database name [ovirt_engine_history]: ovirt_ehDWH database user [ovirt_engine_history]: ovirtDWH database password: Where is the Reports database located? (Local, Remote) [Local]: Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ManualATTENTIONManual action required.Please create database for ovirt-engine use. Use the following commands as an example:create role ovirt_engine_reports with login encrypted password 'ovirt_engine_reports';create database ovirt_engine_reports owner ovirt_engine_reportstemplate template0encoding 'UTF8' lc_collate 'en_US.UTF-8'lc_ctype 'en_US.UTF-8';Make sure that database can be accessed remotely.Reports database secured connection (Yes, No) [No]: Reports database name [ovirt_engine_reports]: ovirt_erReports database user [ovirt_engine_reports]: ovirtReports database password: --== OVIRT ENGINE CONFIGURATION ==--Skipping storing options as database already prepared--== PKI CONFIGURATION ==--PKI is already configured--== APACHE CONFIGURATION ==----== SYSTEM CONFIGURATION ==----== MISC CONFIGURATION ==--Reports power users password: 輸入engien123Confirm Reports power users password: 輸入engien123--== END OF CONFIGURATION ==--[ INFO ] Stage: Setup validation [ INFO ] Cleaning stale zombie tasks--== CONFIGURATION PREVIEW ==--Engine database name : ovirtEngine database secured connection : FalseEngine database host : localhostEngine database user name : ovirtEngine database host name validation : FalseEngine database port : 5432Update Firewall : FalseConfigure WebSocket Proxy : FalseHost FQDN : db-172-16-3-150.sky-mobi.comNFS mount point : /ssd4/ovirt/isoDWH installation : TrueDWH database name : ovirt_ehDWH database secured connection : FalseDWH database host : localhostDWH database user name : ovirtDWH database host name validation : FalseDWH database port : 5432Configure local DWH database : FalseReports installation : TrueReports database name : ovirt_erReports database secured connection : FalseReports database host : localhostReports database user name : ovirtReports database host name validation : FalseReports database port : 5432Configure local Reports database : FalsePlease confirm installation settings (OK, Cancel) [OK]: [ INFO ] Cleaning async tasks and compensations [ INFO ] Checking the Engine database consistency [ INFO ] Stage: Transaction setup [ INFO ] Stopping engine service [ INFO ] Stopping dwh service [ INFO ] Stopping websocket-proxy service [ INFO ] Stage: Misc configuration [ INFO ] Stage: Package installation [ INFO ] Stage: Misc configuration [ INFO ] Backing up database localhost:ovirt to '/var/lib/ovirt-engine/backups/engine-20140729223904.dQpGRz.dump'. [ INFO ] Updating Engine database schema [ INFO ] Creating/refreshing DWH database schema [ INFO ] Deploying Jasper [ INFO ] Importing data into Jasper [ INFO ] Configuring Jasper Java resources [ INFO ] Configuring Jasper Database resources [ INFO ] Customizing Jasper [ INFO ] Customizing Jasper metadata [ INFO ] Generating post install configuration file '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf' [ INFO ] Stage: Transaction commit [ INFO ] Stage: Closing up--== SUMMARY ==--SSH fingerprint: 36:C7:7C:1F:6C:BA:8E:A1:C3:5E:30:1B:AB:07:CA:B7Internal CA 5D:77:8F:FF:12:7A:47:1A:20:D2:34:5E:83:8D:FB:7B:B3:78:68:55Web access is enabled at:http://db-172-16-3-150.sky-mobi.com:80/ovirt-enginehttps://db-172-16-3-150.sky-mobi.com:443/ovirt-engineIn order to configure firewalld, copy the files from/etc/ovirt-engine/firewalld to /etc/firewalld/servicesand execute the following commands:firewall-cmd -service ovirt-postgresfirewall-cmd -service ovirt-httpsfirewall-cmd -service ovirt-httpThe following network ports should be opened:tcp:443tcp:5432tcp:80An example of the required configuration for iptables can be found at:/etc/ovirt-engine/iptables.example--== END OF SUMMARY ==--[ INFO ] Starting engine service [ INFO ] Restarting httpd [ INFO ] Starting dwh service [ INFO ] Stage: Clean upLog file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20140729223458-tzk701.log [ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20140729224557-setup.conf' [ INFO ] Stage: Pre-termination [ INFO ] Stage: Termination [ INFO ] Execution of setup completed successfully
配置完, 修改回普通用戶.
postgres=# alter role ovirt nosuperuser; ALTER ROLE
現(xiàn)在可以打開報告了, 從ovirt-engine或以下URL進入. https://172.16.3.150/ovirt-engine-reports/ ?
[其他] 1. pg_dump備份問題的幾種解決辦法, 都無效. 如果數(shù)據(jù)庫使用了ovirt打包的依賴版本, 例如9.3.5, 那么請把這個版本的bin路徑加到/etc/profile, 因為執(zhí)行engine-setup的時候可能用到pg_dump , 版本不對可能導致備份失敗.
vi /etc/profile export PATH=/home/pg93/pgsql/bin:$PATH
退出shell重進, 確認pg_dump路徑正確.
# which psql /home/pg93/pgsql/bin/psql
或者執(zhí)行engine-setup時設置PATH也行. 或者修改ovirt-engine 的 python腳本. 報錯信息
[ INFO ] Backing up database localhost:ovirt to '/var/lib/ovirt-engine/backups/engine-20140729213449.w8H6bH.dump'. [ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/bin/pg_dump' failed to execute
日志中都報錯信息, 說明了版本問題.
2014-07-29 21:34:49 DEBUG otopi.plugins.**FILTERED**_engine_setup.**FILTERED**_engine.db.schema plugin.execute:866 execute-output: ( '/usr/bin/pg_dump', '-E', 'UTF8', '--disable-dollar-quoting', '--disable-triggers', '--format=c', '-U', '**FILTERED**', '-h', 'local host', '-p', '5432', '-f', '/var/lib/**FILTERED**-engine/backups/engine-20140729213449.w8H6bH.dump', '**FILTERED**') stderr: pg_dump: server version: 9.3.3; pg_dump version: 8.4.20 pg_dump: aborting because of server version mismatch
修改ovirt-engine的python腳本, 還是沒有效果.
/usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.pyself._engineEnv.update({'PATH': ('/home/pg93/pgsql/bin:/usr/local/sbin:/usr/local/bin:''/usr/sbin:/usr/bin:/sbin:/bin'),/usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.pyself._engineEnv = os.environ.copy()self._engineEnv.update({'PATH': ('/home/pg93/pgsql/bin:/usr/local/sbin:/usr/local/bin:''/usr/sbin:/usr/bin:/sbin:/bin'),
修改后, 日志依舊顯示使用了/usr/bin/pg_dump
/var/log/ovirt-engine/setup/ 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:468 ENVIRONMENT DUMP - BEGIN 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/chkconfig=str:'/sbin/chkconfig' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/date=str:'/bin/date' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/hwclock=str:'/sbin/hwclock' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/initctl=str:'/sbin/initctl' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/ip=str:'/sbin/ip' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/ntpq=str:'/usr/sbin/ntpq' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/pg_dump=str:'/usr/bin/pg_dump' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/pg_restore=str:'/usr/bin/pg_restore' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/psql=str:'/usr/bin/psql' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/reboot=str:'/sbin/reboot' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/restorecon=str:'/sbin/restorecon' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/service=str:'/sbin/service' 2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:482 ENVIRONMENT DUMP - END
最終選擇了覆蓋.
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_dump /usr/bin cp: overwrite `/usr/bin/pg_dump'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_restore /usr/bin cp: overwrite `/usr/bin/pg_restore'? y [root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/psql /usr/bin cp: overwrite `/usr/bin/psql'? y
[參考] 1.?http://wiki.ovirt.org/Ovirt_Reports 2.?http://www.ovirt.org/How_to_setup_a_oVirt_Reports_development_environment 3.?http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/ 4.?http://wiki.centos.org/HowTos/oVirt
總結
以上是生活随笔為你收集整理的oVirt Reports Portal 3.4 added to ovirt-engine的全部內容,希望文章能夠幫你解決所遇到的問題。