On Linux, you can easily force the source IP adress using iptables rules.
should be something like
iptables -t nat -A POSTROUTING -d <DESTINATION_IP> -o <INTERFACE> -j
SNAT --to <SOURCE_IP>
just a few iptables commands on bootup/ifup and you should be fine
i.e. Server 1 has 10.0.0.1 and 10.0.0.2, Server 2 has 10.0.0.11 and
10.0.0.12 and you want 10.0.0.1 and 10.0.0.11 to be one "connection" and
.2/.12 as a separate one:
on Server 1
iptables -t nat -A POSTROUTING -d 10.0.0.11 -o eth0 -j SNAT --to 10.0.0.1
iptables -t nat -A POSTROUTING -d 10.0.0.12 -o eth0 -j SNAT --to 10.0.0.2
and on Server 2
iptables -t nat -A POSTROUTING -d 10.0.0.1 -o eth0 -j SNAT --to 10.0.0.11
iptables -t nat -A POSTROUTING -d 10.0.0.2 -o eth0 -j SNAT --to 10.0.0.12
This should enforce that all packets from server 1 going to IP 10.0.0.11
have the source IP 10.0.0.1 and all packets going to 10.0.0.12 have the
source IP 10.0.0.2. And the same in reverse for server 2.
Should be the correct syntax, but have a look at "man iptables" or
Google... iptables is very powerful, very handy sometimes and much
easier to use than many people think...
Jan
> <
http://10.1.10.200:4568>;"
> wsrep_node_incoming_address = 10.1.10.200
> # this is used for bootstrapping only
> #wsrep_cluster_address = gcomm://
> wsrep_cluster_address = gcomm://
10.1.10.27
> <
http://10.1.10.27>,10.1.10.28,10.1.10.29
> <
http://10.1.10.201:4568>;"
> wsrep_node_incoming_address = 10.1.10.201
> # this is used for bootstrapping only
> #wsrep_cluster_address = gcomm://
> wsrep_cluster_address = gcomm://
10.1.10.30
> <
http://10.1.10.30>,10.1.10.31,10.1.10.32
> wsrep_provider = /usr/lib/libgalera_smm.so
> wsrep_sst_method = xtrabackup
> wsrep_slave_threads = 16
> innodb_locks_unsafe_for_binlog = 1
> innodb_autoinc_lock_mode = 2
> binlog_format = ROW
> # Query Cache is not supported with wsrep
> query_cache_size=0
> query_cache_type=0
> # secrets for state transfer.
> !include /etc/mysql/user_data.secrets.wsrep
>
> On node 5:
>
> instance 1:
> ##########################
> # Galera Cluster Settings #
> ###########################
> [mysqld]
> wsrep_cluster_name = mysqlro
> # Human-readable node name (non-unique). Hostname by default.
> #wsrep_node_name = node0
> wsrep_node_address = 10.1.10.202
> wsrep_provider_options =
> "gmcast.listen_addr=tcp://10.1.10.202:4567;ist.recv_addr=
10.1.10.202:4568
> <
http://10.1.10.202:4568>;"
> wsrep_node_incoming_address = 10.1.10.202
> # this is used for bootstrapping only
> #wsrep_cluster_address = gcomm://
> wsrep_cluster_address = gcomm://
10.1.10.27
> <
http://10.1.10.27>,10.1.10.28,10.1.10.29
> <
http://10.1.10.203:4568>;"
> wsrep_node_incoming_address = 10.1.10.203
> # this is used for bootstrapping only
> #wsrep_cluster_address = gcomm://
> wsrep_cluster_address = gcomm://
10.1.10.30
> <
http://10.1.10.30>,10.1.10.31,10.1.10.32
> wsrep_provider = /usr/lib/libgalera_smm.so
> wsrep_sst_method = xtrabackup
> wsrep_slave_threads = 16
> innodb_locks_unsafe_for_binlog = 1
> innodb_autoinc_lock_mode = 2
> binlog_format = ROW
> # Query Cache is not supported with wsrep
> query_cache_size=0
> query_cache_type=0
> # secrets for state transfer.
> !include /etc/mysql/user_data.secrets.wsrep
>
> As soon as I bring up either instance I get errors. Here is an
> example of bringing up instance2:
>
> On node 4:
>
> ==> user_data.err <==
> 131017 22:24:53 [Note] WSREP: Node 1 (atl-mysqlro5) requested state
> transfer from '*any*'. Selected 0 (atl-mysqlro4)(SYNCED) as donor.
> 131017 22:24:53 [Note] WSREP: Shifting SYNCED -> DONOR/DESYNCED (TO:
> 61796743)
> 131017 22:24:53 [Note] WSREP: IST request:
> 3ca49689-2ea0-11e2-0800-77c8d18762d3:61794351-61796742|tcp://
10.1.10.203:4568
> <
http://10.1.10.203:4568>
> 131017 22:24:53 [Note] WSREP: IST first seqno 61794352 not found
> from cache, falling back to SST
> 131017 22:24:53 [Note] WSREP: wsrep_notify_cmd is not defined,
> skipping notification.
> 131017 22:24:53 [Note] WSREP: Running: 'wsrep_sst_xtrabackup --role
> 'donor' --address '
10.1.10.203:4444/xtrabackup_sst
> <
http://10.1.10.203:4444/xtrabackup_sst>' --auth 'root:gunpey911'
> --socket '/var/run/mysqld/user_data.sock' --datadir
> '/dealnews/mysqldb/user_data/' --defaults-file
> '/etc/mysql/user_data.cnf' --gtid
> '3ca49689-2ea0-11e2-0800-77c8d18762d3:61796743''
> 131017 22:24:53 [Note] WSREP: sst_donor_thread signaled with 0
> WSREP_SST: [INFO] Streaming with xbstream (20131017 22:24:53.354)
> WSREP_SST: [INFO] Using socat as streamer (20131017 22:24:53.357)
> WSREP_SST: [INFO] Streaming GTID file before SST (20131017 22:24:53.368)
> WSREP_SST: [INFO] Evaluating xbstream -c ${INFO_FILE} | socat -u
> stdio TCP:
10.1.10.203:4444 <
http://10.1.10.203:4444>; RC=(
> ${PIPESTATUS[@]} ) (20131017 22:24:53.373)
> WSREP_SST: [INFO] Sleeping before data transfer for SST (20131017
> 22:24:53.381)
> 131017 22:24:53 [Note] WSREP: (5b7d9132-379c-11e3-ad45-7f6c0f23935f,
> 'tcp://
10.1.10.201:4567 <
http://10.1.10.201:4567>') reconnecting to
> 7716abfc-379c-11e3-99b0-ee61208245b2 (tcp://
10.1.10.202:4567
> <
http://10.1.10.202:4567>), attempt 0
>
> ==> ro.err <==
> 131017 22:24:53 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
> 131017 22:24:55 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
> 131017 22:24:56 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
> 131017 22:24:58 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
> 131017 22:24:59 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
> 131017 22:25:01 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
> 131017 22:25:02 [Note] WSREP: handshake failed, my group: 'mysqlro',
> peer group: 'mysqluser_data'
>
>
> On Node 5:
>
> 131017 22:26:31 [Note] WSREP: wsrep_notify_cmd is not defined,
> skipping notification.
> 131017 22:27:07 [Note] WSREP: (7716abfc-379c-11e3-99b0-ee61208245b2,
> 'tcp://
10.1.10.203:4567 <
http://10.1.10.203:4567>') reconnecting to
> 5b7d9132-379c-11e3-ad45-7f6c0f23935f (tcp://
10.1.10.200:4567
> <
http://10.1.10.200:4567>), attempt 90
> 131017 22:27:52 [Note] WSREP: (7716abfc-379c-11e3-99b0-ee61208245b2,
> 'tcp://
10.1.10.203:4567 <
http://10.1.10.203:4567>') reconnecting to
> 5b7d9132-379c-11e3-ad45-7f6c0f23935f (tcp://
10.1.10.200:4567
> <
http://10.1.10.200:4567>), attempt 120
> 131017 22:28:37 [Note] WSREP: (7716abfc-379c-11e3-99b0-ee61208245b2,
> 'tcp://
10.1.10.203:4567 <
http://10.1.10.203:4567>') reconnecting to
> 5b7d9132-379c-11e3-ad45-7f6c0f23935f (tcp://
10.1.10.200:4567
> <
http://10.1.10.200:4567>), attempt 150
> 131017 22:29:22 [Note] WSREP: (7716abfc-379c-11e3-99b0-ee61208245b2,
> 'tcp://
10.1.10.203:4567 <
http://10.1.10.203:4567>') reconnecting to
> 5b7d9132-379c-11e3-ad45-7f6c0f23935f (tcp://
10.1.10.200:4567
> <
http://10.1.10.200:4567>), attempt 180
>
>
> I cannot for the life of me figure out why node5/instance2 is trying
> to connect to
10.1.10.200:4567 <
http://10.1.10.200:4567> which is
> node4/instance1.
>
> Any insight?
>
> Regards,
>
> Mike E.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "codership" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
codership-tea...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.