locked
How to Choose R Server's R as Default in Operationalization, Remote R Workspace and RStudio Server? RRS feed

  • Question

  • Hello.

    So I've set up an Azure Data Science Virtual Machine on Linux (Ubuntu) and I've executed the following on the terminal to enable Remote R workspace, RStudio Server, R Server Operationalization and hadoop:

    sudo apt update sudo apt -y upgrade # Hadoop is installed but doesn't seem to appear on the PATH or have its environment variable set by default sudo echo "" >> ~/.bashrc sudo echo "export PATH="'$'"PATH:/opt/hadoop/hadoop-2.7.4/bin" >> ~/.bashrc sudo echo "export HADOOP_HOME=/opt/hadoop/hadoop-2.7.4" >> ~/.bashrc # source ~/.bashrc #Setting up a password as none exists to begin with because of private key selection in the installation #RStudio Server requires a password though

    "MyPassword\nMyPassword"\n" | sudo passwd sshuser #Unfortunately hadoop fails on Data Science Virtual Machine #error: mkdir: Call From IM-DSonUbuntu/192.168.5.4 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused # hadoop fs -mkdir /user/RevoShare/rserve2 # hadoop fs -chmod uog+rwx /user/RevoShare/rserve2 sudo mkdir -p /var/RevoShare/rserve2 sudo chmod uog+rwx /var/RevoShare/rserve2 # hadoop fs -mkdir /user/RevoShare/sshuser # hadoop fs -chmod uog+rwx /user/RevoShare/sshuser sudo mkdir -p /var/RevoShare/sshuser sudo chmod uog+rwx /var/RevoShare/sshuser #Setting up R Server Operationalisation cd /opt/microsoft/mlserver/9.2.1/o16n sudo dotnet Microsoft.MLServer.Utils.AdminUtil/Microsoft.MLServer.Utils.AdminUtil.dll -silentoneboxinstall MyPassword #They say this Data Science Virtual Machine already has RStudio Server, but even though the port 8787 is open, it's nowhere to be found! So installing it now, and after the installation it's accessible by refreshing the page that failed before. #Perhaps it's not installed then? Or a service is not running like it shoudl? #https://www.rstudio.com/products/rstudio/download-server/ wget https://download2.rstudio.org/rstudio-server-1.1.414-amd64.deb yes | sudo gdebi rstudio-server-1.1.414-amd64.deb #They are small, leave them for debug reasons - lets have evidence the script run thus far. #sudo rm rstudio-server-1.1.414-amd64.deb # Remote R workspace Service needs dotnet sdk curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt update sudo apt -y install dotnet-sdk-2.0.0 sudo apt install libxml2-dev #Downloading and installing the Remote R service wget -O rtvs-daemon.tar.gz https://aka.ms/r-remote-services-linux-binary-current tar -xvzf rtvs-daemon.tar.gz sudo ./rtvs-install -s sudo systemctl enable rtvsd sudo systemctl start rtvsd #sudo rm rtvs-daemon.tar.gz #sudo rm rtvs-install #Fixing Remote R: For some reason, even though 'sudo systemctl enable rtvsd' runs, after every reboot the service won't become automatically active. So let's fix that. wget https://sa0im0general.blob.core.windows.net/general-blob-container/StartRemoteRAfterReboot.sh sudo mv StartRemoteRAfterReboot.sh /var/RevoShare/StartRemoteRAfterReboot.sh sudo /sbin/shutdown -r 5 sudo chown root /etc/rc.local sudo chmod 755 /etc/rc.local sudo systemctl enable rc-local.service sudo -s sudo find /etc/ -name "rc.local" -exec sed -i 's/exit 0//g' {} \; sudo echo "" >> /etc/rc.local sudo echo "sh /var/RevoShare/StartRemoteRAfterReboot.sh" >> /etc/rc.local sudo echo "exit 0" >> /etc/rc.local exit

    The problem is that even though "which R" points to R Server's R, i.e. typing "sudo R" will show the message "Loading Microsoft R Server packages, version 9.2.1." and will load packages like RevoScaleR, everything else fails to do so.

    Accessing the RStudio Server with http://THE-IP-GOES-HERE.westeurope.cloudapp.azure.com:8787 and logging in with the initial user ("sshuser") (or with any other user for that matter) will NOT load R Server and RevoScaleR rx functions are unavailable

    Using my local Visual Studio 2017 to access the remote workspace via "Add connection" on "Workspaces" tab loads MRO and says:

    Installed R versions:
        [0] Microsoft R Open '3.4.1.1347' (Default)

    And finally, when I use R Server's Operationalisation and log in with "mrsdeploy" package's "remoteLogin()" R Server packages like RevoScaleR are not loaded again, so things like "rxSummary(~., data=iris)" fail with error 'could not find function "rxSummary"'

    The exact same thing happened with I deployed from azure a "Machine Learning Server 9.2.1 on Linux (Ubuntu)".

    I don't want to just use the regular open source R, I want to be able to use the R Server - that's why I deployed this VM. How can I make it so that everything loads R Server's R, not Microsoft R Open? (Like I'm able to do from terminal using "R")



    Saturday, January 27, 2018 7:26 PM

Answers

All replies