Is it possible to install cc-database on different server than cc-ui/cc-cmonapi/cc-cmon ?

Comments

9 comments

  • Avatar
    Johan

    Hi,

    Let us check up on the first step you did.

    For the second step, what does your /etc/hosts file look like?

    Thanks

    Johan

    0
    Comment actions Permalink
  • Avatar
    Piotr

    Hi,

    Thanks for express response. My /etc/hosts file (in cc-ui server) is very simple.

    ...
    piotr@srv1:~$ cat /etc/hosts
    127.0.0.1    localhost
    10.0.0.1     srv1.localdomain    srv1

    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ...

    Regards,
    Piotr

    0
    Comment actions Permalink
  • Avatar
    Alex

    Hi

    Also, did you enter 'cmon' as the mysql user in the add existing dialog? Then please use 'root' instead.

     

    Best Regards,

    Alex

    0
    Comment actions Permalink
  • Avatar
    Piotr

    Hi,

    I try both 'cmon' and 'root' user and I got the same error. The problem is that software try to connect to wrong ip address. It try to connect to host where the cc-ui is running (hostname variable from cmon.cnf config file) instead mysql server (mysql_hostname).

    Regards,

    Piotr

    0
    Comment actions Permalink
  • Avatar
    Johan

    Hi,

    Can you paste the the /etc/cmon.cnf   and potentially any /etc/cmon.d/cmon*.cnf too here (please take out the passwords before pasting it here).

    BR

    johan

    0
    Comment actions Permalink
  • Avatar
    Piotr

    Sorry for long time without response. I had a holiday. I changed my configuration and I checked 2 scenarios.

    1.

    cc - 192.168.11.20 (cmon, mysql[cmon,dcps], apache)
    pxc1 - 192.168.11.11 (mysql/percona)
    pxc2 - 192.168.11.12 (mysql/precona)

    If I have installed all services (cmon, mysql[cmon,dcps], apache) on the same node almost everything works ok. I said almost because I cannot 'add existing cluster' to cluster control. I get an error:

    FAILED : Host (192.168.11.11) is already in an other cluster.

    I looks like cmon process add some information to cmon db earlier than clustercontrol.

    But I can add cluster from API.

    2.

    cc - 192.168.11.20 (cmon, mysql, apache)
    pxc1 - 192.168.11.11 (mysql/precona[cmon,dcps])
    pxc2 - 192.168.11.12 (mysql/precona[cmon,dcps])

    In that case I have the same problem as before. I can't 'add existing cluster' if hostname parameter is set to cc address (192.168.11.20), because cluster control try to connect to cmon database on that host. I get error.

    FAILED : Can't connect to the cmonDb: Unknown database 'cmon'

    If I change hostname value to 192.168.11.11 (which is incorrect because that host is not cluster control host) I have the same problem as in scenario 1. I can't 'add existing cluster' from ui, but I can add cluster from API. In that scenario clustercontrol doesn't work correctly beacause it has wrong hostname controller address (192.168.11.11 against 192.168.11.20).

    Below is my cmon.cnf file

    ...
    cluster_id=1
    name=PSNC_PXC
    type=galera
    mode=controller
    agentless=1
    logfile=/var/log/cmon/cmon.log
    pidfile=/var/run/
    enable_cluster_autorecovery=0
    enable_node_autorecovery=0
    enable_autorecovery=0
    os=debian
    os_user=cmon
    hostname=192.168.11.20
    wwwroot=/var/www/cc
    ssh_identity=/home/services/cmon/.ssh/id_rsa
    ssh_port=22
    mysql_hostname=192.168.11.11
    mysql_password=***
    mysql_port=3306
    mysql_basedir=/usr
    mysql_bindir=/usr/bin
    monitored_nics=eth0
    skip_name_resolve=0
    staging_dir=/tmp
    mysql_server_addresses=192.168.11.11,192.168.11.12,192.168.11.13
    db_stats_collection_interval=30
    host_stats_collection_interval=30
    db_schema_stats_collection_interval=10800
    ...

    Is that behaviour correct ?

    I checked 1.2.7 version, but I have the same problem.

    Best Regards,

    Piotr

    0
    Comment actions Permalink
  • Avatar
    Ashraf Sharif

    Hi,

    You should configure ClusterControl as in option 1. Can you send the output of:

    mysql -ucmon -p -h192.168.11.20
    use cmon;
    select * from hosts;

    Regards,

    Ashraf

    0
    Comment actions Permalink
  • Avatar
    Piotr

    Hi,

    My output.

    mysql -ucmon -p -h192.168.11.20 -Dcmon -e 'select * from hosts;'
    Enter password:
    +----+-----+---------------+-------------+-----------+---------------+---------------------+-----+--------------+---------------------+-----------------+
    | id | cid | hostname      | ping_status | ping_time | ip            | report_ts           | msg | cmon_version | cmon_status         | wall_clock_time |
    +----+-----+---------------+-------------+-----------+---------------+---------------------+-----+--------------+---------------------+-----------------+
    |  1 |   1 | 192.168.11.20 |           1 |        27 | 192.168.11.20 | 2014-07-02 11:23:45 |     | 1.2.7.328    | 2014-07-02 11:23:45 |      1404225361 |
    |  2 |   1 | 192.168.11.11 |           1 |       210 | 192.168.11.11 | 2014-07-02 11:23:45 |     | 1.2.7.328    | 2014-07-02 11:23:44 |               0 |
    |  3 |   1 | 192.168.11.12 |           1 |       200 | 192.168.11.12 | 2014-07-02 11:23:45 |     | 1.2.7.328    | 2014-07-02 11:23:45 |               0 |
    |  4 |   1 | 192.168.11.13 |           1 |       155 | 192.168.11.13 | 2014-07-02 11:23:45 |     | 1.2.7.328    | 2014-07-02 11:23:45 |               0 |
    +----+-----+---------------+-------------+-----------+---------------+---------------------+-----+--------------+---------------------+-----------------+

    When I reinstall all databases (cmon,dcps) and run cmon process nodes are added to that table before I run clustecontrol web interface.

    I would like to ask why I have to use cluster control databases on the same node where cmon process is running? Why is variable mysql_hostname ? If I can't use it. So finally, I can't install databases (cmon,dcps) separately from the cluster control node ?

     

    Regards,

    Piotr

    0
    Comment actions Permalink
  • Avatar
    Ashraf Sharif

    Hi Piotr,

    Please try following workaround:

    1. Stop CMON service

    2. Remove other cmon config file (if exists):

    rm -Rf /etc/cmon.d/*

    3. Comment following line inside /etc/cmon.cnf:

    #mysql_server_addresses=192.168.11.11,192.168.11.12,192.168.11.13

    * This has cause CMON to register the hosts into CMON DB each time you start cmon service. We don't need that since you are trying to add existing Galera later.

    4. Truncate the hosts table:

    mysql -ucmon -p -h192.168.11.20 cmon
    > truncate table hosts;

    5. Start CMON service and try to add the existing cluster again from UI.

     

    At the moment, try to stick with option 1 (cmon and dcps DB are co-located on cmon host). The error "FAILED : Can't connect to the cmonDb: Unknown database 'cmon'" is caused by a CMON backend bug which has been fixed and available for the next release. Supposedly, ClusterControl runs well if cmon and dcps DB are hosted externally (except for the mentioned bug).

    Regards,

    Ashraf

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk