To set up secure clusters for cross-cluster mirroring:
-
Verify that the user for whom you are configuring access, exists in the registry
on both the clusters and has the following permissions:
- Permissions to create volumes on the source cluster.
- Permissions to mirror volumes on the destination cluster.
You can set up access for the mapr user, who already has permissions to
create volumes and mirror volumes.
-
Configure clusterA for communicating with the other clusters by editing
mapr-clusters.conf file on each node clusterA to specify the
hostname or IP address of the CLDB nodes on the other clusters.
Perform the following steps to configure the nodes on the clusters:
-
On any node in clusterA, append the first entry from clusterB’s
mapr-clusters.conf file, entry which is prefixed with the
cluster name, to the end of clusterA’s mapr-clusters.conf
file.
Note that clusterA’s entry must be the first line of the
mapr-clusters.conf file:
clusterA.cluster.com secure=true perfnode50.lab:7222
clusterB.cluster.com secure=true perfnode100.lab:7222
The clusterA’s
mapr-clusters.conf file now contains two
entries.
-
Copy the updated
/opt/mapr/conf/mapr-clusters.conf file
to all the other nodes in clusterA.
-
On any node in clusterB, append the first entry from clusterA’s
mapr-clusters.conf file, entry which is prefixed with the
cluster name, to the end of the remote cluster’s mapr-clusters.conf
file.
Note that clusterB’s entry must be the first line of mapr-clusters.conf
file:
clusterB.cluster.com secure=true perfnode100.lab:7222
clusterA.cluster.com secure=true perfnode50.lab:7222
The clusterB’s
mapr-clusters.conf file now contains two
entries.
-
Copy the updated
/opt/mapr/conf/mapr-clusters.conf file
to all the nodes in clusterB.
-
Log in to any node on the source cluster (ClusterA) and perform the following
steps:
-
Generate a cross-cluster ticket for the destination cluster for this
user.
For example, to generate a cross-cluster for destination cluster, run the
following command on the source cluster:
source$ /opt/mapr/bin/maprlogin generateticket -type crosscluster -out /tmp/crossclusterticket -user destinationclusteruser
-
Copy the cross-cluster ticket file to any node on the destination cluster
(clusterB).
For example:
source$ scp /tmp/crossclusterticket mapr@<dest-ip>:/tmp/sourceClusterTicketFile
-
Log in to the node on the destination cluster (clusterB) where the cross-cluster
ticket was copied, and perform the following steps:
-
Merge the cross-cluster ticket file with the
/opt/mapr/conf/maprserverticket file on the node.
For example, to merge, run the following command:
dest$ cat /tmp/sourceClusterTicketFile >> /opt/mapr/conf/maprserverticket
-
Copy the
/opt/mapr/conf/maprserverticket file to the CLDB
nodes on the destination cluster.
-
Perform the following step on clusterB to ensure that the
ssl_truststore file has signers for all the clusters. Merge
the ssl_truststore files with the /opt/mapr/server/manageSSLKeys.sh tool.
Use one of the following three ways to merge tickets:
-
Make a copy of the source ssl_truststore.
Create a file with the password of the source truststore.
Finally, merge the source and the destination truststores.
- Copy the
ssl_truststore file from cluster A:
scp mapr@<remote-ip>:/opt/mapr/conf/ssl_truststore /tmp/clusterA_ssl_truststore
- Create a file with password of the source trustore (can be obtained from
the
ssl-client.xml file of clusterA) as the content.
Assume you copied it to file /tmp/stpassword.
- Merge on cluster B:
manageSSLKeys.sh merge /tmp/clusterA_ssl_truststore /opt/mapr/conf/ssl_truststore /tmp/stpassword
-
Use the copytruststore option of manageSSLKeys.sh
and create a copy of the truststore. Then copy it to the destination node
using SCP, and finally run merge without any additional options. For
example:
- Create new
ssl_truststore using the
copytruststore option on cluster A:
manageSSLKeys.sh copytruststore /tmp/clusterA_ssl_truststore
- Copy the
ssl_truststore from cluster A:
scp mapr@<remote-ip>:/opt/mapr/conf/clusterA_ssl_truststore /tmp/clusterA_ssl_truststore
- Merge on cluster B:
manageSSLKeys.sh merge /tmp/clusterA_ssl_truststore /opt/mapr/conf/ssl_truststore
- Use the
copytruststore option of manageSSLKeys.sh and create a custom password for the copy
of truststore. Copy this truststore to the destination node using SCP. Then
create a file with password of the copied truststore as the content, and
pass the filename as the argument to merge. For example:
- Create a custom password for the copy of truststore:
manageSSLKeys.sh copytruststore /tmp/ssl_truststore3 abcdef
- Copy this password to a file:
echo abcdef >/tmp/a
- Copy the
ssl_truststore and password from cluster A
to cluster B:
scp mapr@<remote-ip>:/tmp/ssl_truststore3 /tmp/ssl_truststore3
scp mapr@<remote-ip>:/tmp/a /tmp/a
- Merge on cluster B:
manageSSLKeys.sh merge /tmp/ssl_truststore3 /opt/mapr/conf/ssl_truststore /tmp/a
-
Copy the merged
ssl_truststore file to every node on
clusterB.
-
Optional: If your clusters are secure, configure your
source cluster so that you can use the Control System to set up and administer
table replication from the source to the destination cluster.
These steps make it convenient to use the Control System for setting up and
managing replication involving two secure clusters. However, before following
them, perform these prerequisite tasks.
Note:
- Ensure that both clusters are managed by the same team or group. The
UIDs and GIDs of the users that are able to log in to the Control
System on the source cluster must exactly match their UIDs and GIDs on
the destination cluster. This restriction applies only to access to
both clusters through the Control System, and does not apply to access
to both clusters through the maprcli. If the clusters are managed by
different teams or groups, use the maprcli instead of the Control
System to set up and manage table replication involving two secure
clusters.
- Ensure that the proper file-system and table permissions are in place
on both clusters. Otherwise, any user who can log into the Control
System and has the same UID or GID on the destination cluster will be
able to set up replication either from the source cluster to the
destination cluster or vice versa. A user could create one or more
tables on the destination cluster, enable replication to them from the
source cluster, load the new tables with data from the source cluster,
and start replication. A user could also create tables on the source
cluster, enable replication to them from tables in the destination
cluster, load the new tables with data from the destination cluster,
and start replication.
- On the source cluster, generate a service ticket by using the
maprlogin command:
maprlogin generateticket -type service -cluster <destination cluster>
-user mapr -duration <duration> -out <output folder>
Where
-duration is the length of time before the ticket
expires. You can specify the value in either of these formats:
[Days:]Hours:Minutes
Seconds
- To every node of the source cluster, add the service ticket to the file
/opt/mapr/conf/mapruserticket file that was created when
you secured the source cluster:
at <path and filename of the service ticket> >> /opt/mapr/conf/mapruserticket
- Restart the web server by running the
maprcli node
services command. For the syntax of this command, see node services.
- Add the following two properties to the
core-site.xml
file. For Hadoop 2.7.0, edit the file
/opt/mapr/hadoop/hadoop-2.7.0/etc/hadoop/core-site.xml.
<property>
<name>hadoop.proxyuser.mapr.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.mapr.groups</name>
<value>*</value>
</property>
-
Perform the steps to verify configuration for mirroring.
You can now create mirror volumes on the destination cluster and set up a schedule
to pull data from the volumes on the source cluster. However, you cannot create volumes
on the source cluster that pull data from volumes in the destination cluster, because
the setup described above is unidirectional. To configure the clusters for bidirectional
mirroring, repeat the steps above, by switching the source and destination clusters.
For example, suppose there are two clusters, clusterA and clusterB, and you
performed the steps above for clusterA as the source cluster and clusterB as the
destination cluster. After you complete the steps above, your destination cluster,
clusterB can pull data from volumes on clusterA. For clusterA to mirror data on
clusterB, perform the steps above with clusterB as the source cluster and clusterA as
the destination cluster.