我想在2台计算机,localhost和远程计算机上配置Akka群集。
我有以下java文件
public class ShardingApp {
public static void main(String[] args) {
startup( );
}
public static void startup( ) {
Config remotingConf = ConfigFactory.parseString(
" akka.remote {"+
" enabled-transports = [\"akka.remote.netty.tcp\"]\n"+
" netty.tcp {"+
" hostname = \"127.0.0.1\"\n"+
" port = "+ 2551+"\n"+
" bind-port = "+ 2551+"\n"+
" }"+
" }");
Config config = remotingConf.withFallback(ConfigFactory.load("application.conf"));
ActorSystem system = ActorSystem.create("ShardingSystem", config);
system.eventStream().setLogLevel(Logging.DebugLevel());
ActorSystem.create();
}
}
这是我的Application.conf
akka {
actor {
provider = "akka.cluster.ClusterActorRefProvider"
}
cluster {
seed-nodes = [
"akka.tcp://ShardingSystem@10.15.70.101:2551"]
# auto downing is NOT safe for production deployments.
# you may want to use it during development, read more about it in the docs.
#auto-down-unreachable-after = 10s
}
}
我在远程计算机10.15.70.101上启动它,但它绑定到端口:122248 为什么?