I am totally new to Redis and relatively new to R. I need to do an assignment, where I first need to connect to a socket (it streams key-values for stocks).
I installed Redis in my mac using homebrew, and then the package rredis in R.
Everytime I try to connect to local host I get the following error:
redisConnect()
Warning message:
In .openConnection(host = host, port = port, nodelay = nodelay, :
Unable to set nodelay.
If I set nodelay = F
I get connected
Now, I am trying to connect to a specific socket (ip: 88.99.38.191, port:1337)
I get this
redisConnect(host = "88.99.38.191", port = 1337)
Error: Error in doTryCatch(return(expr), name, parentenv, handler):
Unknown message type
Warning message:
In .openConnection(host = host, port = port, nodelay = nodelay, :
Unable to set nodelay.
and if I try to set nodelay = F :
> redisConnect(host = "88.99.38.191", port = 1337, nodelay = F)
Error: Error in doTryCatch(return(expr), name, parentenv, handler): Unknown message type
Warning messages:
1: closing unused connection 12 (->localhost:6379)
2: closing unused connection 11 (->localhost:6379)
3: closing unused connection 10 (->localhost:6379)
4: closing unused connection 9 (->localhost:6379)
Does anyone have anyidea what I do wrong? All guides/ tutorials that I have seen in the web have no problem in default settings of nodelay = T
ps: Please forgive my ignorance, or I there is anysimilar post, I didn't manage to find any.
For those interested the connection to socket is established like this
con <- socketConnection(host="88.99.38.191", port = 1337, blocking=T,
server=FALSE, open="r+")
it has nothing to do with redis. Redis is listening to a local ip, while redisConnect is used in order to connect to remote redis server.
Additional info can be found here.
Related
I'm trying to run a package in R that requires parallel processing (using xcms). I come across this error, which I am aware of other people experiencing (
Errors in makeCluster(multicore): cannot open the connection,
Error in parallel processing: port cannot be open,
Error in socketConnection(master, port = port, blocking = TRUE, open = "a+b", : cannot open the connection in Stan (from R) (the one most similar to mine that doesn't utilize a cluster/Linux and had no answer 7 years ago)
Error in socketConnection(port = port, server = TRUE, blocking = TRUE, : cannot open the connection
The only way I can get the code to run is through disabling parallel processing through
register(SerialParam())
I am using a Windows computer with 11 available cores. Any advice would be appreciated.
I am running into
Error: could not receive data from server: Software caused connection abort (0x00002745/10053)
upon trying to connect to a postgres database using the DBI package in R. Note that i am in a work environment, so subject to a corporate firewall. Can that explain the error or is there something else that could be happening?
Here is the code I'm using
# Connect to trayaway dev
con <- DBI::dbConnect(
RPostgres::Postgres(),
host = host, port = 5432, dbname = "postgres",
user = user, password = password
)
error below:
Error: could not receive data from server: Software caused connection abort (0x00002745/10053)
solution was found- i tried the same code using wiFi and the code works - when hardwired, connection string fails to connect to database - so this is a corporate firewall issue - thank you,
I am trying to connect Rstudio to Presto connectivity and am
receiving the error below. Please help me with support on this issue.
Error in curl::curl_fetch_memory(url, handle = handle) :
Empty reply from server
I am using the below steps, submitting the code to an Rstudio application:
library(RPresto)
library(dbConnect)
conn <- dbConnect(Presto(), catalog = 'ares', schema = 'default',
user = 'onur', host = 'localhost', port = 443,
session.timezone='US/Eastern')
dbListTables(conn, '%_iris')
dbDisconnect(conn)
I run Hadoop cluster (master + 3 slaves)+Hive server and I want to use RHive over it.
I installed R environment on every computer.
Rserve was installed on every node and RHive was installed on the master.
I get error trying to run RHive on master:
> rhive.env()
Hive Home Directory : {Hive home directory}
Hadoop Home Directory : {Hadoop home directory}
Hadoop Conf Directory : {HAdoop configuration directory}
Default RServe List
x.x.x.8 hadoop-slave1 x.x.x.9 hadoop-slave2 x.x.x.10 hadoop-slave3
warning: cant't connect to a Rserver at x.x.x.8 hadoop-slave1:6311
warning: cant't connect to a Rserver at x.x.x.9 hadoop-slave2:6311
warning: cant't connect to a Rserver at x.x.x.10 hadoop-slave3:6311
Disconnected HiveServer and HDFS
Warning messages:
1: In socketConnection(host, port, open = "a+b", blocking = TRUE) :
x.x.x.8 hadoop-slave1:6311 cannot be opened
2: In socketConnection(host, port, open = "a+b", blocking = TRUE) :
x.x.x.9 hadoop-slave2:6311 cannot be opened
3: In socketConnection(host, port, open = "a+b", blocking = TRUE) :
x.x.x.10 hadoop-slave3:6311 cannot be opened
Rserve listens on TCP port 6311 on slave1, slave2 and slave3.
I tested it with:
nc -z hadoop-slave1 6311
Connection to hadoop-slave1 6311 port [tcp/*] succeeded!
What could be connection problem?
RHive calls for Rserve url 'hadoop-slave1:6311' as listed in {hadoop home}/conf/slaves
I opened R and testd connction to this url:
% R
> library("Rserve")
> c <- RSconnect(host = " hadoop-slave1", port = 6311)
then connection failed.
I tried to connect by IP and it succeed!
The problem was DNS configurations!!!
There are 2 possible solutions:
1. fix DNS server, then connecting by name will work
2. open {hadoop home}/conf/slaves and fix slave names to IP's
I have set up an instance to use as a redis worker. All ports are open. When i issue
library("doRedis")
redisWorker(host="ZZZ-23-20-XXX-XXX.compute-1.amazonaws.com", queue="jobs")
i get the error
Error in socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) :
cannot open the connection
In addition: Warning message:
In socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) :
ZZZ-23-20-XXX-XXX.compute-1.amazonaws.com:6379 cannot be opened
Any ideas what could be going on? I have also used the inernal EC2 IP (10.XXX.XXX.ZZZ) still get the same error. The server is up, running and pingable
I am running latest and greatest of R, doRedis,Ubuntu 12.04 all fully updated. This has been discussed before but no solution found. doRedis with strange socket connection error in Ubuntu Linux, R, and RStudio
I have had similar issues although with registerDoRedis() as you cannot set a timeout and I believe the problem is with the timeout value used in the function 'redisConnect'.
In R if you run fix(redisConnect) and you can see the default for timeout is as follows:
redisConnect <- function (host = "localhost", port = 6379, returnRef = FALSE,
timeout = 2147483647L)
It seems this huge timeout value is causing the issue. To check change it on the line it is used from this:
con <- socketConnection(host, port, open = "a+b", blocking = TRUE,
timeout = timeout)
To this:
con <- socketConnection(host, port, open = "a+b", blocking = TRUE,
timeout = 30)
I find that works although as soon as you reload the package the change gets wiped. I just found this today so will submit a bug to the developer. I'm running R 2.15 on OSX by the way.
The function you are using should default to timeout 30, or you can try setting it on the function call to be sure rather than fix()'ing the underlying code.