On 2013-02-04 21:32, Justice London wrote:
> In wsrep_urls you could start a new cluster if it could not detect
> any of
> the other hosts like so:
> wsrep_urls=gcomm://ip1:4567,gcomm://ip2:4567,gcomm://
>
> How do you do the same with wsrep addresses?
Good question. That would have been the correct way to start a cluster
- if only you could connect to mysql server before initializing storage
engines. As of now you can't and it is unlikely you ever will (since all
of the auth info is stored in the tables), so it works only with
wsrep_sst_method=mysqldump.
It goes like this:
1) set cluster addresses in my.cnf
wsrep_cluster_address=gcomm://addr1,addr2,addr3?pc.wait_prim=no
(pc.wait_prim=no is essential)
At that point you have a cluster component that is non-primary. It
won't accept any queries.
2) login to one of the nodes and
mysql> SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
This will make the component primary. Note that this may cause massive
resyncs and state transfers between the nodes if they all have different
states.
Make sure that there is only one primary component at any time (that's
why it is impossible to automate).
In practice wsrep_urls method seems to be more usable, albeit
conceptually inferior and technically more risky.