简体   繁体   中英

Executing /usr/bin/R on remote machine via SSH does not work

I want to login to a remote server via ssh and start R afterwards.

ssh -X user@166.167.0.1 '/usr/bin/R'

Fatal error: you must specify '--save', '--no-save' or '--vanilla'

Which tells me that start of R failed.
How can I solve it ?

According to this Q&A in this github

It seems like the source of the problem is not with /usr/bin/R parameters, but with the parameters of the RServe itself.

This is a message from Rserve itself, and in the documentation. eg: You can start Rserve with Rserve(args="--no-save")

Check here under Launching Rserve in the link below https://www.rforge.net/Rserve/doc.html

More info from Rserve docs :

Launching Rserve Rserve comes now as an R package, so one way to start Rserve is from within R, just type

library(Rserve) Rserve()

That command knows how to find Rserve, how to setup the environment and how to start it, regardless of your platform.

Note: depending on how you are running R, it may require additional parameters such as --no-save (R will tell you). In that case you have to pass that parameter in the args argument such as

Rserve(args="--no-save")

However, Rserve is a stand-alone program, so it can be started directly as well. If you installed Rserve from a source package (on unix), type:

 R CMD Rserve

Depending on the purpose and libraries on your computer you may want to add --gui-none or --no-save (see R documentation). Rserve passes any parameters to the underlying R engine except for Rserver-related parameters (see command line arguments). After initialization Rserve daemonizes itself to work as a server. It can be shut down gracefully (ie it will wait until all existing connections are finished) if it recieves shutdown command from an authorized connection. It terminates not so gracefully if it receives usual termination signals.

If no config file is supplied, Rserve accepts no remote connections, requires no authentication and file transfer is enabled. For more details about how to configure Rserve, see below.


Answering the question in the note:

You should configure Rserve on the remote host.
The configuration process can be done once, using Rserve configuration files.

In order to login to the remote host, you can use the following command:

ssh -X user@166.167.0.1

Start Rserve with --no-save parameter:

R CMD Rserve(args="--no-save")

Here is a discussion how to setup Rserve as a service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM