25.5.4 Setup Rserve

Rserve helps to access the R software on a Server Computer when there is no R software on client side.

Configuration on Server Side

Install R and Rserve Package

  1. Download R from CRAN. Note steps below are based on R 3.2.0.
  2. Install and launch R 3.2.0. Run script the following script in the R installation's R Console to initiate Rserve package installation.
    install.packages("Rserve")
  3. In the pop-up dialog, select a download channel and click OK to download the package. After downloading, the package will be automatically unpacked and installed.

Create an account

  1. Run the script in R console to get the R library path, then open the path.
    .libPaths()[1] #output could be [1] "C:/Program Files/R/R-3.2.0/library"
  2. Input this path in Windows Explorer and find the Rserve/lib/x64/ subfolder in this path, create a txt file named as RserveAuth.txt, then write the username and password into the file, for example:

    Admin 123456

  3. Create another file named Rserv.txt and write the content below into the file:

    pwdfile RserveAuth.txt
    remote enable
    auth required
    plaintext enable

  4. Change the file extension of Rserv.txt to be conf, so it will be saved as Rserv.conf instead.

Add system path

  1. Click Windows Start button and select Control Panel: System and Security: System. In that opening page, select Advanced system settings to open System Properties dialog.
  2. Click Environment Variables... button on Advanced tab, find variable Path in System variables group and click Edit... button to open Edit System Variable dialog.
  3. Insert the path containing R.dll file, eg., C:\Program Files\R\R-3.2.0\bin\x64, in Variable value: edit box. Then click OK button to exit.
    Systempath.png
  4. Click Windows Start button and select All Programs: Accessories: Command Prompt to launch Command Prompt window, Type
    cd C:\Program Files\R\R-3.2.0\library\Rserve\libs\x64

    you can replace the path if it is not where your Rserve.dll locates, press Enter to go to the path. You may need to restart your computer to apply the settings as to run the following command.

  5. type the content below into the Command window, click Enter.
    Rserve.exe --RS-conf Rserv.conf --RS-port 12306

    It will output message Rserve: Ok, ready to answer queries.

  6. Start a new session of Command prompt and run:
    ipconfig

    to get the Rserve PC IP, e.g: 192.168.18.75

Configure Origin on Client Side

  1. Make sure file ORserve9.dll and ORserve9_64.dll existing in Origin EXE folder, e.g., C:\Program Files\OriginLab\Origin2016, Make sure PC firewall is turned off to unblock Rserve connection.
  2. Make sure the session Command window showing below stayed open.
    RServeConnectionCommandSession.png
  3. Launch Origin 2016 and select Connectivity: Rserve Console to open Connection dialog.
  4. Enter IP(which you get from the Rseve PC like:192.168.18.75) of the machine running Rserve.exe in Server edit box. Port is 12306.
  5. Check the Login with username and password checkbox, and enter Username and Password. In this example, they are Admin and 123456, respectively, as saved in RserveAuth.txt.
    RserveConnectionDialog.png
  6. Click the OK button. You will see the RServe console is initiated:
    RServeDialog.png