我使用的是CentOS 7,我必须确保端口2888和3888是开放的.
我读过这篇文章,但这没有用,因为在CentOS 7操作系统上没有iptables save命令.
有人告诉我,上面的URL对CentOS 7无效,我应该遵循这个.但是这篇文章并不清楚我究竟需要执行什么命令.
我也找到了
firewall-cmd --zone=public --add-port=2888/tcp
Run Code Online (Sandbox Code Playgroud)
但这并不能重新启动.
那么我怎样才能打开端口并使其重新启动?
有什么办法可以看到已经退出的容器的日志吗?
我可以使用已退出容器的容器ID,docker ps -a但我想知道它运行时发生了什么.
我使用redux编写了一个容器组件,我对mapDispathToProps的实现看起来像这样
const mapDispatchToProps = (dispatch, ownProps) => {
return {
onChange: (newValue) => {
dispatch(updateAttributeSelection('genre', newValue));
dispatch(getTableData(newValue, ownProps.currentYear));
}
}
}
Run Code Online (Sandbox Code Playgroud)
问题是,为了获取getTableData,我需要一些其他组件的状态.如何在此方法中访问状态对象?
我写了这段代码
IQueryable<Site> sites = context.MainTable.Include("RelatedTable");
if (!string.IsNullOrEmpty(param1)) {
sites = sites.Where(s => s.RelatedTable != null && s.RelatedTable.Any(p => p.Name == param1.ToLower() && p.PolicyType == "primary"));
}
foreach (string secondaryPolicy in secondaryPolicies)
{
sites = sites.Where(s => s.RelatedTable != null && s.RelatedTable.Any(p => p.Name == secondaryPolicy.ToLower() && p.PolicyType == "secondary"));
}
return sites.ToList();
Run Code Online (Sandbox Code Playgroud)
但是ToList在线上我得到了例外
无法比较'System.Collections.Generic.ICollection`1 [[Project1,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null]]'类型的元素.仅支持基本类型,枚举类型和实体类型.
我已经使用本教程安装了Hadoop和HDFS
http://codesfusion.blogspot.com/2013/10/setup-hadoop-2x-220-on-ubuntu.html
Run Code Online (Sandbox Code Playgroud)
一切都好.
我也能够创建目录并使用它们
hadoop fs -mkdir /tmp
hadoop fs -mkdir /small
Run Code Online (Sandbox Code Playgroud)
我也可以说
hadoop fs -ls /
Run Code Online (Sandbox Code Playgroud)
但是我正在按照培训师的指导进行操作
hadoop fs -mkdir temp
hadoop fs -ls
Run Code Online (Sandbox Code Playgroud)
现在在我的机器上,当我发出上述命令时,它说
ls: `.': No such file or directory
Run Code Online (Sandbox Code Playgroud)
在我的训练视频中,命令hadoop fs -ls完美运行.我为什么要指定"/"?
我也在所有命令中收到此警告
13/12/28 20:23:52 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Run Code Online (Sandbox Code Playgroud)
但在我的培训师视频中没有这样的警告.
我的配置文件与上面的教程完全一样,我也可以看到所有管理UI
http://abhishek-pc:8042/
http://abhishek-pc:50070/
http://abhishek-pc:8088/
Run Code Online (Sandbox Code Playgroud)
所以我的问题是我的配置有什么问题,为什么我的系统表现与培训视频不同?
我已经使用cloudera manager安装了cloudera CDH 5.
我很容易做到
hadoop fs -ls /input/war-and-peace.txt
hadoop fs -cat /input/war-and-peace.txt
Run Code Online (Sandbox Code Playgroud)
以上命令将在控制台上打印整个txt文件.
现在我启动火花壳然后说
val textFile = sc.textFile("hdfs://input/war-and-peace.txt")
textFile.count
Run Code Online (Sandbox Code Playgroud)
现在我收到一个错误
Spark上下文可用作sc.
scala> val textFile = sc.textFile("hdfs://input/war-and-peace.txt")
2014-12-14 15:14:57,874 INFO [main] storage.MemoryStore (Logging.scala:logInfo(59)) - ensureFreeSpace(177621) called with curMem=0, maxMem=278302556
2014-12-14 15:14:57,877 INFO [main] storage.MemoryStore (Logging.scala:logInfo(59)) - Block broadcast_0 stored as values in memory (estimated size 173.5 KB, free 265.2 MB)
textFile: org.apache.spark.rdd.RDD[String] = hdfs://input/war-and-peace.txt MappedRDD[1] at textFile at <console>:12
scala> textFile.count
2014-12-14 15:15:21,791 INFO [main] ipc.Client (Client.java:handleConnectionTimeout(814)) - Retrying connect …Run Code Online (Sandbox Code Playgroud) 我发现了JavaScript数组操作Unshift,shift,push,pop
但是,所有这些操作都会改变数组.
有没有办法可以使用这些功能而不会对原始数据造成变异?
不知何故,我觉得阅读数据不应该导致变异.
我写的这段代码完美无缺
class Items(tag: Tag) extends Table[Item](tag, "ITEMS") {
def id = column[Long]("ITEMS_ID", O.PrimaryKey, O.AutoInc)
def name = column[String]("ITEMS_NAME")
def price = column[Double]("ITEMS_PRICE")
def * = (id, name, price) <> ((Item.apply _).tupled, Item.unapply _)
}
object Shop extends Shop{
val items = TableQuery[Items]
val db = Database.forConfig("h2mem1")
def create(name: String, price: Double) : Int = {
val action = items ++= Seq(Item(0, name, price))
val future1 = db.run(action)
val future2 = future1 map {result =>
result map {x => x}
} …Run Code Online (Sandbox Code Playgroud) 目前我正在运行我的程序
val conf = new SparkConf()
.setAppName("Test Data Analysis")
.setMaster("local[*]")
.set("spark.executor.memory", "32g")
.set("spark.driver.memory", "32g")
.set("spark.driver.maxResultSize", "4g")
Run Code Online (Sandbox Code Playgroud)
即使我在5台机器的集群上运行(每台机器有376 GB的物理RAM).我的程序出错了java.lang.OutOfMemoryError: Java heap space
我的数据大小很大......但是没有那么大,超过32 GB的Executor内存*5节点.
我怀疑这可能是因为我使用"本地"作为我的主人.我见过文档说使用spark://machinename:7070
但是我想了解我的群集...如何确定此URL和端口
编辑:我可以看到文档谈到运行名为"spark-master.sh"的东西,以便将节点作为主节点.
在我的情况下,火花集群由其他人设置/维护,因此我不想通过启动我自己的主服务器来更改拓扑.
如何查询并找出哪个节点是现有主节点.
我已经尝试在群集中拾取一个随机节点,然后尝试'spark:// node:7077',但这不起作用并给出错误
[15/11/03 20:06:21 WARN AppClient$ClientActor: Could not connect to
akka.tcp://sparkMaster@node:7077:
akka.remote.EndpointAssociationException: Association failed with
[akka.tcp://sparkMaster@node:7077]
Run Code Online (Sandbox Code Playgroud) 我使用Spark 1.3.0和Spark Avro 1.0.0.我正在使用存储库页面上的示例.以下代码运行良好
val df = sqlContext.read.avro("src/test/resources/episodes.avro")
df.filter("doctor > 5").write.avro("/tmp/output")
Run Code Online (Sandbox Code Playgroud)
但是如果我需要查看doctor字符串是否包含子字符串呢?因为我们在字符串中编写表达式.我怎么做"包含"?
apache-spark ×3
hadoop ×2
scala ×2
arrays ×1
c# ×1
centos ×1
cloudera-cdh ×1
dataframe ×1
docker ×1
firewall ×1
hdfs ×1
javascript ×1
linq ×1
port ×1
react-redux ×1
redux ×1
slick ×1
slick-3.0 ×1