In Microsoft SQL Server, I use the READ_COMMITTED_SNAPSHOT ISOLATION
ALTER DATABASE MyDatabase
SET ALLOW_SNAPSHOT_ISOLATION ON
ALTER DATABASE MyDatabase
SET READ_COMMITTED_SNAPSHOT ON
Run Code Online (Sandbox Code Playgroud)
In Session 1,update the Principal from 4000 to 5000
BEGIN TRAN
Update MyTable Set Principal=5000 Where InvestorId=10
Run Code Online (Sandbox Code Playgroud)
Now in Session 2, I say
Select Principal from MyTable where InvestorId=10
Run Code Online (Sandbox Code Playgroud)
I get 4000, since the Session 1 Transaction is not committed.
If I do not use the READ_COMMITTED_SNAPSHOT isolation mode, and use
sql oracle snapshot-isolation isolation-level read-committed-snapshot
我有一个 Spark + jupyter 的 docker 镜像(https://github.com/zipfian/spark-install)
我有另一个 hadoop 的 docker 镜像。(https://github.com/kiwenlau/hadoop-cluster-docker)
我正在 Ubuntu 中运行上述 2 个镜像中的 2 个容器。对于第一个容器:我能够成功启动 jupyter 并运行 python 代码:
import pyspark
sc = pyspark.sparkcontext('local[*]')
rdd = sc.parallelize(range(1000))
rdd.takeSample(False,5)
Run Code Online (Sandbox Code Playgroud)
对于第二个容器:
在主机 Ubuntu 操作系统中,我能够成功进入
现在我想从 jupyter(在第一个容器中运行)写入 HDFS 文件系统(在第二个容器中运行)。
所以我添加了附加行
rdd.saveAsTextFile("hdfs:///user/root/input/test")
Run Code Online (Sandbox Code Playgroud)
我收到错误:
HDFS URI,无主机:hdfs:///user/root/input/test
我是否错误地给出了 hdfs 路径?
我的理解是,我应该能够从另一个运行 Spark 的容器与运行 hdfs 的 docker 容器进行通信。我错过了什么吗?
谢谢你的时间。
我还没有尝试过 docker compose。