Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following deployment patterns are supported for WSO2 ML.

...

By default, WSO2 ML runs with an inbuilt Apache Spark instance. However, when working with big data, you can handle those large data sets in a distributed environment through WSO2 ML. You can carry out data pre-processing and model building processes on an Apache Spark cluster to share the workload between the nodes of the cluster. Using a Spark cluster optimizes the performance and reduces the time consumed to build and train a machine learning model for a large data set.

Follow the steps below to run the ML jobs by connecting WSO2 ML to an external Apache Spark cluster.

Info
  • When following the instructions below you need to use Apache Spark version 1.4.1 with Apache Hadoop version 2.6 and later in the Apache Spark cluster.
  • The Spark deployment pattern can be Standalone, Yarn or Mesos.
  • WSO2 ML is unaware of the underlying configuration of the Spark cluster. It only interacts with the Spark master to which the jobs are submitted.
  1. Press Ctrl+C keys to shutdown the WSO2 ML server. For more information on shutting down WSO2 ML server, see Running the Product

    .

    In the <ML_HOME>/repository/conf/etc/spark-config.xml file, enter the Spark master URL as the value of the < spark.master> property as shown in the example below.

    TipYou can find the Spark Master URL in the Apache Spark Web UI as shown below

    .

    Image Removed

    Code Block
    languagexml
    <property name="spark.master">{SPARK_MASTER_URL}</property>
  2. Create a directory named <SPARK_HOME>/ml/ and copy the following jar files into it. These jar files can be found in the <ML_HOME>/repository/components/plugins directory.
    • org.wso2.carbon.ml.core_1.0.2.jar
    • org.wso2.carbon.ml.commons_1.0.2.jar
    • org.wso2.carbon.ml.database_1.0.2.jar
    • kryo_2.24.0.wso2v1.jar
  3. Create a file named spark-env.sh in the <SPARK_HOME>/conf/ directory and add the following entries.

    Code Block
    languagetext
    SPARK_MASTER_IP=127.0.0.1
    SPARK_CLASSPATH={SPARK_HOME}/ml/org.wso2.carbon.ml.core_1.0.2.jar:{SPARK_HOME}/ml/org.wso2.carbon.ml.commons_1.0.2.jar:{SPARK_HOME}/ml/org.wso2.carbon.ml.database_1.0.2.jar:{SPARK_HOME}/ml/kryo_2.24.0.wso2v1.jar
  4. Restart the external Spark cluster using the following commands:

    Code Block
    {SPARK_HOME}$ ./sbin/stop-all.sh
    {SPARK_HOME}$ ./sbin/start-all.sh 
  5. In the <ML_HOME>/repository/conf/etc/spark-config.xml file, enter the Spark master URL as the value of the < spark.master> property as shown in the example below.

    Tip

    You can find the Spark Master URL in the Apache Spark Web UI as shown below.

    Image Added

    Code Block
    languagexml
    <property name="spark.master">{SPARK_MASTER_URL}</property>
  6. Restart the WSO2 ML server. For more information on restarting WSO2 ML server, see Running the Product.

...