まずは、英語には申し訳ありません。 Google翻訳は私に多くの助けをしてくれます。ドッカー上の動脈にakkaリモーティングを使用するとエラーが発生する
私の問題はこれです:
私はakka
とjava
で開発された2つのサンプル・プロジェクトを持っています。たとえば、リモートclient.jarのと例 - リモート-server.jar
私は動脈のシリアル化を使用しています、そして、私はakka-remoting経由でクライアントからサーバーにメッセージを送信しようとしています。
ことをして、クライアントの俳優は次のとおりです。
public class ClientActor extends AbstractActor {
public static Props props() {
return Props.create(ClientActor.class);
}
public ClientActor() {
ActorSelection selection = getContext().system().actorSelection("akka://[email protected]:5001/user/server-process");
selection.tell(new MessageRequest(), getSelf());
}
public Receive createReceive() {
return receiveBuilder().match(MessageResponse.class, msg -> {
System.out.println(msg.getMessage());
}).build();
}
}
私のクライアントの設定:
akka {
loglevel = "DEBUG"
actor {
provider = remote
allow-java-serialization = off
serializers {
java = "akka.serialization.JavaSerializer"
myown = "serializers.ExampleByteBufSerializer"
}
serialization-bindings {
"java.lang.String" = myown
"protocol.MessageRequest" = myown
"protocol.MessageResponse" = myown
"java.lang.Boolean" = myown
}
}
remote {
artery {
enabled = on
canonical.hostname = "192.168.0.250" # external (logical) hostname
canonical.port = 5000 # external (logical) port
bind.hostname = "localhost" # internal (bind) hostname
bind.port = 10000 # internal (bind) port
}
}
}
サーバ俳優は非常にダミーのですが、私はここでそれを貼り付けることが必要であると思ういけません。しかし、その構成は次のとおりです。
akka {
loglevel = "DEBUG"
actor {
provider = remote
allow-java-serialization = off
serializers {
java = "akka.serialization.JavaSerializer"
myown = "serializers.ExampleByteBufSerializer"
}
serialization-bindings {
"java.lang.String" = myown
"protocol.MessageRequest" = myown
"protocol.MessageResponse" = myown
"java.lang.Boolean" = myown
}
}
remote {
artery {
enabled = on
canonical.hostname = "192.168.0.250" # external (logical) hostname
canonical.port = 5001 # external (logical) port
bind.hostname = "localhost" # internal (bind) hostname
bind.port = 10001 # internal (bind) port
}
}
}
両方のjarは、下図のように、同じ「192.168.0.250マシン」上で実行中のドッキングウィンドウインスタンス上に展開されています
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d2970bd20371 openjdk:alpine "sh" 34 minutes ago Up 34 minutes 0.0.0.0:5001->10001/tcp ex-remoting-server
36a67fea8590 openjdk:alpine "sh" 34 minutes ago Up 34 minutes 0.0.0.0:5000->10000/tcp ex-remoting-client
サーバーは、以下のログで、[OK]を起動します:
[DEBUG] [07/04/2017 13:46:18.473] [main] [EventStream(akka://server)] logger log1-Logging$DefaultLogger started
[DEBUG] [07/04/2017 13:46:18.473] [main] [EventStream(akka://server)] Default Loggers started
[DEBUG] [07/04/2017 13:46:18.495] [main] [akka.serialization.Serialization(akka://server)] Replacing JavaSerializer with DisabledJavaSerializer, due to `akka.actor.allow-java-serialization = off`.
[INFO] [07/04/2017 13:46:18.628] [main] [akka.remote.artery.ArteryTransport(akka://server)] Started embedded media driver in directory [/dev/shm/aeron-root-server-efd42dec-452d-406c-8d1d-807e0d8ff7fc]
[INFO] [07/04/2017 13:46:18.693] [main] [akka.remote.artery.ArteryTransport(akka://server)] Remoting started; listening on address: [akka://[email protected]:5001] with UID [-2663186266051514585]
しかし、私は、クライアントを起動しようとすると、私は次のエラーを取得する:
[ERROR] [07/04/2017 14:09:05.250] [client-akka.actor.default-dispatcher-10] [akka://[email protected]:5001/] swallowing exception during message send
io.aeron.exceptions.RegistrationException: Insufficient usable storage for new log of length=50332096 in /dev/shm (shm)
at io.aeron.ClientConductor.onError(ClientConductor.java:285)
at io.aeron.DriverListenerAdapter.onMessage(DriverListenerAdapter.java:79)
at org.agrona.concurrent.broadcast.CopyBroadcastReceiver.receive(CopyBroadcastReceiver.java:100)
at io.aeron.DriverListenerAdapter.pollMessage(DriverListenerAdapter.java:59)
at io.aeron.ClientConductor.doWork(ClientConductor.java:422)
at io.aeron.ClientConductor.awaitResponse(ClientConductor.java:447)
at io.aeron.ClientConductor.addPublication(ClientConductor.java:177)
at io.aeron.Aeron.addPublication(Aeron.java:165)
at akka.remote.artery.AeronSink$$anon$1.<init>(AeronSink.scala:103)
at akka.remote.artery.AeronSink.createLogicAndMaterializedValue(AeronSink.scala:100)
at akka.stream.impl.GraphStageIsland.materializeAtomic(PhasedFusingActorMaterializer.scala:627)
at akka.stream.impl.PhasedFusingActorMaterializer.materialize(PhasedFusingActorMaterializer.scala:458)
at akka.stream.impl.PhasedFusingActorMaterializer.materialize(PhasedFusingActorMaterializer.scala:420)
at akka.stream.impl.PhasedFusingActorMaterializer.materialize(PhasedFusingActorMaterializer.scala:415)
at akka.stream.scaladsl.RunnableGraph.run(Flow.scala:439)
at akka.remote.artery.Association.akka$remote$artery$Association$$runOutboundOrdinaryMessagesStream(Association.scala:570)
at akka.remote.artery.Association.runOutboundStreams(Association.scala:510)
at akka.remote.artery.Association.associate(Association.scala:502)
at akka.remote.artery.AssociationRegistry.association(Association.scala:763)
at akka.remote.artery.ArteryTransport.association(ArteryTransport.scala:932)
at akka.remote.artery.ArteryTransport.send(ArteryTransport.scala:918)
at akka.remote.RemoteActorRef.$bang(RemoteActorRefProvider.scala:563)
at akka.actor.ActorRef.tell(ActorRef.scala:124)
at akka.actor.ActorSelection$.rec$1(ActorSelection.scala:250)
at akka.actor.ActorSelection$.deliverSelection(ActorSelection.scala:254)
at akka.actor.ActorSelection.tell(ActorSelection.scala:45)
at actors.ClientActor.<init>(ClientActor.java:21)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at akka.util.Reflect$.instantiate(Reflect.scala:44)
at akka.actor.NoArgsReflectConstructor.produce(IndirectActorProducer.scala:105)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:563)
at akka.actor.ActorCell.create(ActorCell.scala:589)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:462)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:484)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
私はまた、これらの「ActorSelectionパス」でメッセージを送信しよう:
"akka://[email protected]:5001/user/server-process" "akka://[email protected]:5001/user/server-process" "akka://[email protected]:10001/user/server-process" "akka://[email protected]:10001/user/server-process"
が、エラーがまだ表示されます。
これは、サーバ俳優の俳優のパスがあること、また、明確にすることが重要である:何が不足している
akka://server/user/server-process
?私はakka 2.5.3バージョンを使用しています...
ありがとうございます。