Configuring R Interpreter

  1. Configure Rserve
    nano /scratch/software/R/Rserve.conf (sample file)
    >
    auth required
    plaintext disabled
    pwdfile /scratch/software/R/creds/Rserve.pwd
    remote enable
    switch.qap.tls enable
    tls.port 6311
    qap disable
    interactive no
    rsa.key /scratch/software/R/creds/server.key
    tls.key /scratch/software/R/creds/server.key
    tls.cert /scratch/software/R/creds/server.crt
  2. password file Rserve.pwd:
    >
    oml $5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
    The file contains one line per user, where the first part is the username, and the second part is the password.
    The password can either be plain text or a MD5/SHA1 hash. In this example the password `password` is hashed with SHA1.
    If you use hashed passwords, the password string needs to start with a `$` sign.
  3. SSL Key:
    openssl genrsa -out server.key 2048
    openssl req -new -key server.key -out server.csr # password 1234
    openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  4. Creating Keystore:
    keytool -import -alias <keystore-alias> -file <path-to-server.crt>/server.crt -keystore <output-path-to-keystore/rinterpreterkeystore -storepass <keystore-secret> -noprompt
    eg. keytool -import -alias rserve -file /scratch/software/R/creds/server.crt -keystore /scratch/software/R/creds/rinterpreterkeystore -storepass changeit -noprompt

    Note:

    Steps to enable TLS during R Interpreter Installation
    Steps to enable TLS during R Interpreter Installation:
    1. Download Rserve_1.8-10.tar.gz from this link: https://cran.r-project.org/src/contrib/Archive/Rserve/
    2. Install openssl-devel - [yum install openssl-devel]
    3. Execute below cmd:

      R CMD INSTALL --configure-args="--with-ssl-headers=/usr/include --with-ssl-libraries=/usr/lib64" Rserve_1.8-10.tar.gz

      The below steps can be executed from R session to check that Rserve configuration is working before starting the services:

      Start R from Terminal/Putty and execute the below commands:
      • library(Rserve)
      • Rserve(args="--RS-conf <Rserve.conf file location including file name> --no-save")