You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CloudStack管理服务启动失败:merovingian2无法获取新数据库连接

Troubleshooting "merovingian2 can't get a new database connection" in CloudStack 4.11

Hey there, let’s break down how to fix this frustrating database connection error step by step—this is a common snag when setting up CloudStack, so we’ll start with the most likely culprits:

1. Verify CloudStack Database Configuration

First, double-check the core database settings that CloudStack relies on:

  • Locate the config file at /etc/cloudstack/management/db.properties
  • Confirm these critical values are correct:
    • jdbc.url: Ensure it points to your database host, port, and the CloudStack database name (e.g., jdbc:mysql://your-db-host:3306/cloud?useSSL=false&serverTimezone=UTC). If your database is on the same management server, localhost should work—don’t accidentally use server2’s IP here!
    • jdbc.user and jdbc.password: These must match the credentials you created specifically for CloudStack. Typos here are one of the top causes of this error.
    • jdbc.driverClassName: For MySQL 5.x, use com.mysql.jdbc.Driver; for MySQL 8.0+/MariaDB 10.2+, switch to com.mysql.cj.jdbc.Driver (CloudStack 4.11 works best with the older driver, so confirm your database version matches).

2. Test Direct Database Connectivity

Let’s rule out database-side issues by connecting directly from your management server (server1):
Run this command in your terminal:

mysql -u <cloud-db-user> -p<cloud-db-password> -h <db-host> cloud
  • If this fails, your problem isn’t with CloudStack—it’s with the database itself:
    • Check if MySQL/MariaDB is running (service mysqld status or systemctl status mariadb).
    • Verify port 3306 is open on the database server (use telnet <db-host> 3306 or nc -zv <db-host> 3306 to test connectivity).
    • Make sure the database server’s firewall isn’t blocking incoming traffic from server1.

3. Confirm Database User Permissions

CloudStack’s database user needs explicit permission to connect from server1:

  • If you restricted the user to localhost during setup, but CloudStack tries to connect via the server’s private/public IP, it will fail. Fix this by re-granting permissions:
GRANT ALL PRIVILEGES ON cloud.* TO '<cloud-db-user>'@'<server1-ip>' IDENTIFIED BY '<cloud-db-password>';
FLUSH PRIVILEGES;
  • For testing, you can temporarily use '%' instead of <server1-ip> to allow connections from any host (just remember to lock this down for production!).

4. Dig into Management Server Logs for Specific Details

The error message you’re seeing is generic—let’s get the full story from the logs:

  • Open the management server log at /var/log/cloudstack/management/management-server.log
  • Search for keywords like merovingian2, SQLException, or connection refused. You’ll find specific errors that point to the root cause, such as:
    • Access denied for user 'clouduser'@'server1': Permissions issue
    • Could not connect to host: 192.168.x.x: Network/firewall block
    • Unknown database 'cloud': You didn’t initialize the CloudStack database correctly

5. Double-Check CloudStack Setup Steps

Quickly confirm you didn’t miss a key setup step:

  • Ensure you ran cloudstack-setup-databases to initialize the database schema and permissions (this is easy to skip if you’re following the guide too quickly).
  • Verify the NFS share for secondary storage is configured correctly (while this doesn’t directly cause database errors, it’s a common post-install misstep that can cascade into other issues).

Once you fix the underlying database connection issue, re-run cloudstack-setup-management and start the service with service cloudstack-management start—it should fire up successfully if the connection is working.

内容的提问来源于stack exchange,提问作者JackFrost

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:12:32