【发布时间】:2015-08-14 23:36:17
【问题描述】:
我刚刚停止在 EC2 Ubuntu 实例上运行 Scala Spray 可执行文件,以启动更新版本的应用程序。当我尝试运行新的可执行文件时,出现以下错误:
ubuntu@ip-172-32-92:~/suredbits-dfs$ ./target/universal/stage/bin/suredbits-dfs [警告] [08/14/2015 03:22:30.314] [NflDbApiApiActorSystemConfig-akka.actor.default-dispatcher-5] [akka://NflDbApiActorSystemConfig/user/IO-HTTP/listener-0] 绑定到 ec2-52 -116-195.us-west-2.compute.amazonaws.com/172.32.92:80 失败
我已通过运行以下命令检查以确保端口 80 已打开且可用:
netstat -anp | grep 80
不返回任何东西。看来我的端口是打开的,而 Scala Spray 只是再次绑定失败。以下是我尝试在可执行文件中启动服务器的方式:
package com.suredbits.dfs
/**
* Created by chris on 8/9/15.
*/
import akka.actor.ActorSystem
import com.github.nfldb.config.{NflDbApiActorSystemConfig, NflDbApiDbConfig}
import com.suredbits.dfs.nfl.scoring.NflPlayerScoringService
import spray.routing.SimpleRoutingApp
object Main extends App with SimpleRoutingApp with NflPlayerScoringService
with NflDbApiDbConfig with NflDbApiActorSystemConfig {
import actorSystem._
/* startServer(interface = "localhost", port = 80) {
path("hello") {
get {
complete {
<h1>Say hello to spray</h1>
}
}
} ~ nflPlayerScoringServiceRoutes
}*/
startServer(interface = "ec2-52-116-195.us-west-2.compute.amazonaws.com", port = 80) {
path("hello") {
get {
complete {
<h1>Say hello to spray</h1>
}
}
} ~ nflPlayerScoringServiceRoutes
}
}
【问题讨论】:
-
尝试启用应该报告底层错误的调试日志记录。
-
尝试使用
sudo运行。 -
@tedder42 这就是问题所在,如果你想写一篇文章,我会将问题奖励给你。
-
@ChrisStewart 完成 - 在我知道它是否有帮助之前,我不想做一个完整的答案。
标签: scala amazon-web-services amazon-ec2 dns spray