Results 1 to 5 of 5

Thread: Bug: zmmyinit failing - and workaround

  1. #1
    deltatango is offline Active Member
    Join Date
    Jul 2007
    Posts
    36
    Rep Power
    8

    Default Bug: zmmyinit failing - and workaround

    I prepared a fresh new server (Xserve 3GHz Xeon, 8GB RAM, OS X10.4, Zimbra 6.0.1 Network Edition) to become our new mailserver. And as I want to switch over the service from the current (mac mini) zimbra server, I was following the docs for switching servers, and restoring its contents from backups.

    The (empty) server is running fine, I can log into the web frontend and zmcontrol reports everything as running.

    To prepare the server for restore, I followed Backup and Restore and when it comes to re-initialising the mysql database, zmmyinit cannot connect to the re-created mysql, giving errors:

    mail:~ zimbra$ /opt/zimbra/libexec/zmmyinit
    * Creating required directories
    * Generating mysql config /opt/zimbra/conf/my.cnf
    * Creating database in /opt/zimbra/db/data
    * Starting mysql server
    * Failed to connect to mysql...retrying
    * Failed to connect to mysql...retrying
    (repeated until I hit CTRL-C)

    Because my.cnf is created by the zmmyinitwith a ridiculously big innodb_buffer_pool_size of 2576980377 bytes. The mysql in 10.4 server is only a 32bit version (yes, that's how Apple does it, and to make matters worse, it's a Power PC version in a Xeon server), thus mysql of course has to fail (log(mysql_error.log):

    mysqld(11372) malloc: *** set a breakpoint in szone_error to debug
    mysqld(11372) malloc: *** vm_allocate(size=2576371712) failed (error code=3)
    mysqld(11372) malloc: *** error: can't allocate region
    mysqld(11372) malloc: *** set a breakpoint in szone_error to debug
    mysqld(11372) malloc: *** vm_allocate(size=2576371712) failed (error code=3)
    mysqld(11372) malloc: *** error: can't allocate region
    mysqld(11372) malloc: *** set a breakpoint in szone_error to debug
    InnoDB: Fatal error: cannot allocate the memory for the buffer pool

    The culprit is line 73 in /opt/zimbra/libexec/zmmyinit:

    mysql_memory_percent=${mysql_memory_percent:=30}

    It uses 30% of available mem for mysql, which is not entirely a bad idea, but with 8GB RAM and only a 32Bit mysql ...
    I just edited the number down to 5 and now it works.
    Last edited by deltatango; 10-16-2009 at 09:15 AM.

  2. #2
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Does MAC have /proc/cpuinfo ? A potential change in the script would be
    Code:
    grep "flags.* lm.*" /proc/cpuinfo
    and if lm is present then its 64bit else 32bit. mysql_memory_percent could be adjusted accordingly then.

  3. #3
    deltatango is offline Active Member
    Join Date
    Jul 2007
    Posts
    36
    Rep Power
    8

    Default

    Quote Originally Posted by uxbod View Post
    Does MAC have /proc/cpuinfo
    Unfortunately not (is BSD). Still, a "uname -p" gives "i386" under 10.4, but it is highly misleading, as 10.4 and 10.5 are a wild mixture of 32bit and 64 bit binaries.

    Then again, Zimbra for Mac is only available in 32Bit, thus no need for determining the architecture.

  4. #4
    brian is offline Project Contributor
    Join Date
    Jul 2006
    Posts
    623
    Rep Power
    10

    Default

    not quite sure why you are calling zmmyinit by hand and/or editing the script. When doing a production install via zmsetup.pl. zmmyinit --mysql_memory_percent 10 is invoked on mac based systems with more then 2GB of RAM instead of the default 30percent. If you need to invoke it by hand then you just need to pass in the correct percentage for you system.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    deltatango is offline Active Member
    Join Date
    Jul 2007
    Posts
    36
    Rep Power
    8

    Default

    Quote Originally Posted by brian View Post
    not quite sure why you are calling zmmyinit by hand and/or editing the script. When doing a production install via zmsetup.pl. zmmyinit --mysql_memory_percent 10 is invoked on mac based systems with more then 2GB of RAM instead of the default 30percent. If you need to invoke it by hand then you just need to pass in the correct percentage for you system.
    Ok, thanks for clarification. The additional parameter wasn't documented in http://www.zimbra.com/docs/ne/4.5.10...1.html#1059814

    And thus I ran into the problem described.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •