RStudio独立连接到HDFS
我在笔记本电脑(Windown/Mac)上独立安装了R和RStudio,并远程安装了Hadoop集群(Linux)。我想从RStudio连接到HDFS以读取数据,进行处理,然后最后,如果需要,将结果推回到HDFS 我不太确定这是可能的,还是只需要一个服务器版本的RStudio?有谁能建议一下最好的选择吗RStudio独立连接到HDFS,r,hadoop,hdfs,rstudio,R,Hadoop,Hdfs,Rstudio,我在笔记本电脑(Windown/Mac)上独立安装了R和RStudio,并远程安装了Hadoop集群(Linux)。我想从RStudio连接到HDFS以读取数据,进行处理,然后最后,如果需要,将结果推回到HDFS 我不太确定这是可能的,还是只需要一个服务器版本的RStudio?有谁能建议一下最好的选择吗 谢谢它是一个安全的群集吗?如果不是这样的话,这个问题就解决了。使用它,您可以使用以下代码连接到远程群集: library(rwebhdfs) hdfs <- webhdfs("<hd
谢谢它是一个安全的群集吗?如果不是这样的话,这个问题就解决了。使用它,您可以使用以下代码连接到远程群集:
library(rwebhdfs)
hdfs <- webhdfs("<hdfs-webfs-node>", 50070, "<user>")
f <- read_file(hdfs, "/<path>/<to>/<file>")
直接从
没有理由获取RStudio服务器。我希望这为你指明了正确的方向
# WebHDFS url
hdfsUri <- "http://namenodedns:port/webhdfs/v1"
# Uri of the file you want to read
fileUri <- "/user/username/myfile.csv"
# Optional parameter, with the format &name1=value1&name2=value2
optionnalParameters <- ""
# OPEN => read a file
readParameter <- "?op=OPEN"
# Concatenate all the parameters into one uri
uri <- paste0(hdfsUri, fileUri, readParameter, optionnalParameters)
# Read your file with the function you want as long as it supports reading from a connection
data <- read.csv(uri)