...
In the
<DAS_HOME>/repository/conf/analytics/analytics-config.xml
file check whether the shards are properly allocated.Code Block language xml <!-- The number of index data replicas the system should keep, for H/A, this should be at least 1, e.g. the value 0 means there aren't any copies of the data --> <indexReplicationFactor>1</indexReplicationFactor> <!-- The number of index shards, should be equal or higher to the number of indexing nodes that is going to be working, ideal count being 'number of indexing nodes * [CPU cores used for indexing per node]' --> <shardCount>6</shardCount>
Check the logs that are printed when the cluster is initilized. The log must be similar to the example shown below.
Code Block language powershell TID: [-1] [] [2017-05-12 13:17:27,538] INFO {org.wso2.carbon.analytics.dataservice.core.indexing.IndexNodeCoordinator} - Indexing Initialized: CLUSTERED {0={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.3.24.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.3.24.67]:4000}, 1={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.3.24.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.3.24.67]:4000}, 2={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.3.24.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.3.24.67]:4000}, 3={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.3.24.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.3.24.67]:4000}, 4={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.3.24.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.3.24.67]:4000}, 5={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.3.24.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.3.24.67]:4000}} | Current Node Indexing: Yes {org.wso2.carbon.analytics.dataservice.core.indexing.IndexNodeCoordinator}
Here,
{0={c13d3a23-b15a-4b9c-ac8f-a30df2811c98=Member [10.36.241.70]:4000 this, bc751d36-d345-4b8f-b133-b77793f04805=Member [10.36.241.67]:4000}
means that the shard 0 is allocated to two nodes, and their IDs arec13d3a23-b15a-4b9c-ac8f-a30df2811c98
andbc751d36-d345-4b8f-b133-b77793f04805
. The IPs of the two nodes are also mentioned in the log line. For a correctly configured two-node DAS cluster, this log line must contain all six shards (from 0 to 5) and the node IDs to which they are allocated.Info This log line does not contain both the node IDs when you initially set up the cluster and start the first server because the other node has not joined the cluster. The log line is printed with the complete mapping of shards to node IDs only after the 2nd node joins the cluster.
The two node IDs mentioned in the log line must match the IDs mentioned in the
my-node-id.dat
of both DAS nodes. If there are more than two unique IDs in a 2 node cluster, the shard allocation may have been affectedand affected and it mayneed to be corrected.
...
One reason
...
to have more than
...
one node ID is to allow the cluster to be reconfigured with new DAS packs without clearing the data sources configured in the
analytics-datasources.xml
file.
...
When a new DAS pack
...
that points to the same analytics data sources is started, a new
...
ID is generated and the new DAS pack
...
is considered the third node
...
to join the cluster. When
...
you re-
...
configure the cluster with new DAS packs,
...
make sure
...
the older
...
IDs are first backed up and restored in the new packs. For more information, see Backing up and Restoring Analytics Data. If the two node cluster already
...
has more than
...
two unique
...
IDs ( a result of starting a new DAS pack with a new
...
ID),
...
remove the unnecessary/additional
...
IDs by following the steps given below.
Keep backup of the current
my-node-id.dat
of both nodes
.
- Separate
out - the
ids which - IDs that do not match with
the - the
my-node-id.dat
of
both - the
- the two nodes.
- Shut down both the nodes.
Replace the
my-node-id.dat
of either DAS node with one of the non-matching/unnecessary/additional node
IDs.
Info Make sure that you keep a backup of the
my-node-id.dat
before doing this
.
- Start the DAS node mentioned in
- substep d with the
-DdisableIndexing=
true
property. This
- property removes the node
- ID that
- you enter in the
my-node-id.dat
from the indexing cluster. - Repeat
- substeps c, d, and
- e for all the additional node
- IDs.
- Restore the two node
- IDs you backed up
- in substep d.
Clean the - Clear the information in the in the
<DAS_HOME>/repository/data
folder- Clear the information in the in the
- Go to
- directory.
Open the
<DAS_HOME>/repository/conf/analytics/local-shard-allocation
-config.conf
file and
update the content
as follows:
Info This must be done for both the nodes.
Code Block 0,INIT
1,INIT
2,INIT
3,INIT
4,INIT
5,INIT
Start both the
nodes
, and cheeck the content of the the
<DAS_HOME>/repository/conf/analytics/local-shard-allocation-config.conf
file. It should be changed as follows.
Code Block 0,NORMAL
1,NORMAL
2,NORMAL
3,NORMAL
4,NORMAL
5,NORMAL
Info The nodes in this example are configured with six shards and one replicas for each shard. This step must change based on the number of shards and replicas
configured.
Indexing in Spark Environment
...