Is it possible to install cc-database on different server than cc-ui/cc-cmonapi/cc-cmon ?
Hi,
I try to do some non-standard setup. I want to install cc-ui + cc-cmonapi + cmon on 1 server (e.g 10.0.0.1) and cc-database (cmon + dscp) on another (10.0.0.2). In documentation (http://www.severalnines.com/docs/clustercontrol-administration-guide/components/cmon-controller/configuration-file) I found several options:
- Operating system - hostname=<string> - * Hostname or IP address of the CMON host -> 10.0.0.1
- CMON MySQL database - mysql_hostname=<string> - * The MySQL hostname where CMON database resides. Using IP address is recommended -> 10.0.0.2
But when I try to add existing cluster I get an error:
...
Verifying controller host and cmon password.
Can't connect to the cmonDb: Can't connect to MySQL server on '10.0.0.1' (111)
...
It looks like the mysql_hostname parameter was ignored.
When I change hostname parameter (for testing purpose) to 10.0.0.2 and try to add existsing cluster this step was ok, but I got another error.
...
Verifying the MySQL user/password.
Can't access the MySQL server: Warning: Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'cmon'@'localhost' (using password: YES)
...
Is it possible to install clustercontrol that way?
Regards,
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 -
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
-
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
-
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
Please sign in to leave a comment.
Comments
9 comments