How do I configure the studio server port and its interpreter’s default port to available ports?

To reconfigure port numbers:

  1. Run the command install.sh -u to change the current studio port to the desired port number in the configuration files/tables.
  2. Run the t startup.sh script of Studio at the location: OFS_MMG/mmg-studio/bin/ and modify the line numbers 24/25 of OFS-MMG/mmg-studio/bin/startup.sh to specify the interpreter name and port number.

    DS version 22.4.3

    nohup "$DIR"/datastudio --jdbc -1 --eventjdbc -1 --shell -1 --eventshell -1 --graalvm -1 --eventgraalvm -1 --pgx -1 --eventpgx -1 --external --port 8008 --jdbc 3011 --eventjdbc 3031 --python 3012 --eventpython 3032 --markdown 3009 --eventmarkdown 3029 --spark 3014 --eventspark 3034 &> "$DIR"/nohup.out &

    For PGX Interpreter, modify: OFS_MMG/mmg-studio/interpreter-server/pgx-interpreter-22.4.3/bin/pgx-interpreter file "${1:-7022}" "${2:-7042}" values to "${1:-3022}" "${2:-3042}"

    DS version 23.3.5

    nohup "$DIR"/datastudio --jdbc -1 --shell -1 --external --port 8008 --jdbc 3011 --python 3012 --markdown 3009 --spark 3014 --pgx 3022 &> "$DIR"/nohup.out

    For event ports in DS 23.3.5

    Set the environment variables DS_EVENT_HANDLER_HOST and DS_EVENT_HANDLER_PORT before launching the interpreters, else, default values will be used. You can modify these ports in the startup.sh of the Studio.

    Example:

    export DS_EVENT_HANDLER_HOST=localhost

    export DS_EVENT_HANDLER_PORT=3432

    To change the ports configured for events in the Data Studio server, modify the following server configuration:

    studio-server:

    thrift-server:

    enabled: true

    port: <desired port -defaulted to 8432>

    mode: TCP

    NOTE:

    ************

    Python Interpreter

    Beginning with Data Studio 21.4.0, 6012 is default port on which the REST server for the Python interpreter listens. To overwrite this, set the STUDIO_INTERPRETER_PYTHON_INTERPRETER_REST_SERVER_PORT environment variable.

    PGX-Python Interpreter

    Beginning with Data Studio 23.1.0, 6022 is the default port on which the REST server for the PGX-Python interpreter listens. To overwrite this, set the STUDIO_INTERPRETER_PGX_PYTHON_INTERPRETER_REST_SERVER_PORT environment variable.

    Modify the startup.sh to:

    export STUDIO_INTERPRETER_PYTHON_INTERPRETER_REST_SERVER_PORT=3038

    export STUDIO_INTERPRETER_PGX_PYTHON_INTERPRETER_REST_SERVER_PORT=3039

    This configuration changes the default interpreter ports to new ports.

  3. Ports mentioned in the interpreter json files should be reconfigured. The interpreter file location is: “OFS_MMG/mmg-studio/server/builtin/interpreters/<interpreter>.json” file.
  4. Execute startup.sh and check the studio/interpreter ports.
  5. Similarly, execute ./datastudio.sh –help from OFS_MMG/mmg-studio/bin/ for all available options.
DS Studio Server port and its interpreters default port can be reconfigured to any available ports by following these steps:
  1. Change the Datastudio URL with the desired DS port. install.sh -u must be triggered to change the current studio port to 8008 in the configuration files/tables.
  2. After successful execution of install.sh. The ports can be updated by the user in the startup.sh of studio in the path OFS_MMG/mmg-studio/bin/.
    1. Edit line no 24/25 of OFS-MMG/mmg-studio/bin/startup.sh and change as below by specifying the interpreter name and port to be modified.
      • In DS version 22.4.3

        nohup "$DIR"/datastudio --jdbc -1 --eventjdbc -1 --shell -1 --eventshell -1 --graalvm -1 --eventgraalvm -1 --pgx -1 --eventpgx -1 --external --port 8008 --jdbc 3011 --eventjdbc 3031 --python 3012 --eventpython 3032 --markdown 3009 --eventmarkdown 3029 --spark 3014 --eventspark 3034 &> "$DIR"/nohup.out

        For PGX Interpreter

        Change it directly in the OFS_MMG/mmg-studio/interpreter-server/pgx-interpreter-22.4.3/bin/pgx-interpreter file "${1:-7022}" "${2:-7042}" values to "${1:-3022}" "${2:-3042}"

      • In DS version 23.3.5
        nohup "$DIR"/datastudio --jdbc -1 --shell -1 --external --port 8008 --jdbc 3011 --python 3012 --markdown 3009 --spark 3014 --pgx 3022 &> "$DIR"/nohup.out & For event ports in DS 23.3.5 You need to set the environment variables DS_EVENT_HANDLER_HOST and DS_EVENT_HANDLER_PORT before interpreters are launched. Otherwise, the default values are used. This can be mentioned in the startup.sh of studio. example:
        • export DS_EVENT_HANDLER_HOST=localhost
        • export DS_EVENT_HANDLER_PORT=3432
        In order to change the port listening for events in the Data Studio server, adapt following server configuration:
        • studio-server:
          • thrift-server:
            • enabled: true
            • port: <desired port -defaulted to 8432>
            • mode: TCP
      • Generic Notes

        Python Interpreter

        Starting from Data Studio 21.4.0, the REST server for the Python interpreter listens on port 6012 by default. One can overwrite this by setting the STUDIO_INTERPRETER_PYTHON_INTERPRETER_REST_SERVER_PORT environment variable.

        PGX-Python Interpreter

        Starting from Data Studio 23.1.0, the REST server for the PGX-Python interpreter listens on port 6022 by default. One can overwrite this by setting the STUDIO_INTERPRETER_PGX_PYTHON_INTERPRETER_REST_SERVER_PORT environment variable.

        The above can be mentioned in the startup.sh of studio as export STUDIO_INTERPRETER_PYTHON_INTERPRETER_REST_SERVER_PORT=3038 export STUDIO_INTERPRETER_PGX_PYTHON_INTERPRETER_REST_SERVER_PORT=3039

        The above configuration will change the default interpreter ports and reconfigure to listen to the new ports. (For example: As mentioned in the below table).

    2. Ports mentioned in the interpreter json files also needs to be reconfigured. The interpreter file locations can be found at “OFS_MMG/mmg-studio/server/builtin/interpreters/<interpreter>.json” file.
    3. Execute startup.sh and check the studio/interpreter ports.
    4. Similarly you can execute as ./datastudio.sh –help from OFS_MMG/mmg-studio/bin/ location for all the available options.
    The above steps will reconfigure Server/Interpreter to these ports:
    • Server/Interpreters Modified Port
    • DS Studio port 8008
    • Jdbc 3011
    • eventjdbc 3031
    • python 3012
    • eventpython 3032
    • markdown 3009
    • eventmarkdown 3029
    • spark 3014
    • eventspark 3034
    • pgx 3022
    • eventpgx 3042