[one-users] Opennebula DB upgrade issues:
Carlos Martín Sánchez
cmartin at opennebula.org
Thu Sep 15 06:44:11 PDT 2011
Hi,
The sequel gem should be installed by the install_gems script [1].
Did you get any error message during the installation?
Regarding the Mysql error, it is a bug. I have opened a ticket [2].
Please change in /usr/lib/one/ruby/onedb/2.0_to_2.9.80.rb the following:
- @db.fetch("SELECT COUNT (ip) FROM old_leases WHERE (oid=#{oid} AND
used=1)") do |r|
- total_leases = r[:"COUNT (ip)"]
+ @db.fetch("SELECT COUNT(ip) FROM old_leases WHERE (oid=#{oid} AND
used=1)") do |r|
+ total_leases = r[:"COUNT(ip)"]
It looks mysql doesn't like the space before the parenthesis.
I have also found a typo in /usr/lib/one/ruby/onedb/onedb_backend.rb , and
"onedb restore" won't work with mysql unless you change:
create_cmd = mysql_cmd+"-e 'CREATE DATABASE IF NOT EXISTS #{@db_name};'"
- rc = system(create_cnd)
+ rc = system(create_cmd)
if !rc
raise "Error creating MySQL DB #{@db_name} at #{@server}."
end
Thank you for the feedback, it will be solved in the final release.
Carlos.
[1]
http://opennebula.org/documentation:rel3.0:ignc#ruby_libraries_requirements_front-end
[2] http://dev.opennebula.org/issues/812
--
Carlos Martín, MSc
Project Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org <http://www.opennebula.org/> | cmartin at opennebula.org
On Wed, Sep 14, 2011 at 4:07 PM, Ajay Bhatnagar <abhatnagar at rim.com> wrote:
> I tried to upgrade Mysql db from V2.0 to 2.9.80 using onedb upgrade –v
> command for updating db to support Opennebula 3. But ran in into issues
> described below****
>
> Does it need some more mysql component or some fix in onedb upgrade process
> ?****
>
> Thanks****
>
> Ajay****
>
> ** **
>
> Environment:****
>
> **a. **OS : Suse 11Sp1 2.6.32.12-0.7-default****
>
> **b. **Mysql : Server version: 5.0.67 SUSE MySQL RPM****
>
> **c. **Installed mysql components rpm -qa|grep mysql****
>
> libmysqlclient15-5.0.67-13.20.1****
>
> libmysqlclient-devel-5.0.67-13.20.1****
>
> mysql-client-5.0.67-13.20.1****
>
> libmysqlclient_r15-5.0.67-13.20.1****
>
> mysql-5.0.67-13.20.1****
>
> ruby-mysql-2.7.4-2.11****
>
> ** **
>
> Following issues were encountered:****
>
> **1. **Following mysql gem install does not resolve all issues to
> run upgrade, needed to add gem sequel.****
>
> gem install mysql2-0.3.7.gem****
>
> gem install mysql-2.8.1.gem****
>
> ** **
>
> ./onedb upgrade -v****
>
> /usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require': no such file to load -- sequel (LoadError)****
>
> from
> /usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
> ****
>
> from /srv/cloud/lib/ruby/onedb/onedb_backend.rb:18****
>
> from /srv/cloud/lib/ruby/onedb/onedb.rb:18:in `require'****
>
> from /srv/cloud/lib/ruby/onedb/onedb.rb:18****
>
> from ./onedb:39:in `require'****
>
> from ./onedb:39****
>
> ** **
>
> gem install sequel-3.27.0.gem****
>
> Successfully installed sequel-3.27.0****
>
> 1 gem installed****
>
> Installing ri documentation for sequel-3.27.0...****
>
> Installing RDoc documentation for sequel-3.27.0...****
>
> ** **
>
> **2. **During upgrade it refers to function count which does not
> exist. ****
>
> ** **
>
> ./onedb upgrade -v****
>
> Version read:****
>
> 2.0 : Could not read any previous db_versioning data, assuming it is an
> OpenNebula 2.0 or 2.2 DB.****
>
> ** **
>
> MySQL dump stored in /srv/cloud/var/mysql_localhost_opennebula.sql****
>
> Use 'onedb restore' or restore the DB using the mysql command:****
>
> mysql -u user -h server -P port db_name < backup_file****
>
> * > Running migrator /srv/cloud/lib/ruby/onedb/2.0_to_2.9.80.rb*
>
> *Mysql::Error: FUNCTION opennebula.COUNT does not exist*****
> ---------------------------------------------------------------------
> This transmission (including any attachments) may contain confidential
> information, privileged material (including material protected by the
> solicitor-client or other applicable privileges), or constitute non-public
> information. Any use of this information by anyone other than the intended
> recipient is prohibited. If you have received this transmission in error,
> please immediately reply to the sender and delete this information from your
> system. Use, dissemination, distribution, or reproduction of this
> transmission by unintended recipients is not authorized and may be unlawful.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110915/b4523eab/attachment-0002.htm>
More information about the Users
mailing list