2016-05-12 7 views
4

Ich versuche, einen Spark-Cluster mit OpenStack zu konfigurieren. Derzeit habe ich zwei ServerSpark-Cluster Master-IP-Adresse, die nicht an Floating-IP bindet

namens
  • Funken Master (IP: 192.xx1, floating IP: 87.xx1)
  • Funken Slave-1 (IP: 192.xx2, floating IP: 87.xx2)

Ich stoße auf Probleme, wenn ich versuche, diese Floating-IPs im Vergleich zu den öffentlichen Standard-IPs zu verwenden.

Auf der Funken Master-Maschine, der Hostname ist Funken Master und /etc/hosts sieht aus wie

127.0.0.1 localhost 
127.0.1.1 spark-master 

Die einzige zu spark-env.sh vorgenommene Änderung export SPARK_MASTER_IP='192.x.x.1' ist. Wenn ich ./sbin/start-master.sh ausführen, kann ich die Web-Benutzeroberfläche anzeigen.

Die Sache ist, ich sehe die Web-UI mit der Floating-IP 87.x.x.1, und dort listet sie die Master-URL: func: //192.x.x.1: 7077.

Vom Slave kann ich ./sbin/start-slave.sh spark://192.x.x.1:7077 ausführen und es verbindet erfolgreich.

Wenn ich versuche, die Floating-IP zu verwenden, indem spark-env.sh auf dem Master zu export SPARK_MASTER_IP='87.x.x.1' Wechsel dann bekomme ich folgende Fehlerprotokoll

Spark Command: /usr/lib/jvm/java-7-openjdk-amd64/bin/java -cp /usr/local/spark-1.6.1-bin-hadoop2.6/conf/:/usr/local/spark-1.6.1-bin-hadoop2.6/lib/spark-assembly-1.6.1-hadoop2.6.0.jar:/usr/local/spark-1.6.1-bin-hadoop2.6/lib/datanucleus-core-3.2.10.jar:/usr/local/spark-1.6.1-bin-hadoop2.6/lib/datanucleus-api-jdo-3.2.6.jar:/usr/local/spark-1.6.1-bin-hadoop2.6/lib/datanucleus-rdbms-3.2.9.jar -Xms1g -Xmx1g -XX:MaxPermSize=256m org.apache.spark.deploy.master.Master --ip 87.x.x.1 --port 7077 --webui-port 8080 
======================================== 
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties 
16/05/12 15:05:33 INFO Master: Registered signal handlers for [TERM, HUP, INT] 
16/05/12 15:05:33 WARN Utils: Your hostname, spark-master resolves to a loopback address: 127.0.1.1; using 192.x.x.1 instead (on interface eth0) 
16/05/12 15:05:33 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address 
16/05/12 15:05:33 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
16/05/12 15:05:33 INFO SecurityManager: Changing view acls to: ubuntu 
16/05/12 15:05:33 INFO SecurityManager: Changing modify acls to: ubuntu 
16/05/12 15:05:33 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(ubuntu); users with modify permissions: Set(ubuntu) 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7077. Attempting port 7078. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7078. Attempting port 7079. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7079. Attempting port 7080. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7080. Attempting port 7081. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7081. Attempting port 7082. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7082. Attempting port 7083. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7083. Attempting port 7084. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7084. Attempting port 7085. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7085. Attempting port 7086. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7086. Attempting port 7087. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7087. Attempting port 7088. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7088. Attempting port 7089. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7089. Attempting port 7090. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7090. Attempting port 7091. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7091. Attempting port 7092. 
16/05/12 15:05:33 WARN Utils: Service 'sparkMaster' could not bind on port 7092. Attempting port 7093. 
Exception in thread "main" java.net.BindException: Cannot assign requested address: Service 'sparkMaster' failed after 16 retries! 
    at sun.nio.ch.Net.bind0(Native Method) 
    at sun.nio.ch.Net.bind(Net.java:463) 
    at sun.nio.ch.Net.bind(Net.java:455) 
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) 
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) 
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125) 
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:485) 
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1089) 
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:430) 
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:415) 
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:903) 
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198) 
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:348) 
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357) 
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) 
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111) 
    at java.lang.Thread.run(Thread.java:745) 

Offensichtlich ist die Gerichte zum Mitnehmen hier für mich die Linie

Ihr Hostname, Sparkmaster löst eine Loopbackadresse: 127.0.1.1; mit 192.xx1 statt (auf eth0) 16.05.12 15.05.33 WARN Utils: Set SPARK_LOCAL_IP, wenn Sie an eine andere Adresse

aber egal binden müssen, was Ansatz, den ich dann versuchen, und nehme ich einfach mehr Fehler.

Wenn ich gesetzt beide export SPARK_MASTER_IP='87.x.x.1' und export SPARK_LOCAL_IP='87.x.x.1' und versuchen ./sbin/start-master.sh bekomme ich folgende Fehlerprotokoll

16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7077. Attempting port 7078. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7078. Attempting port 7079. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7079. Attempting port 7080. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7080. Attempting port 7081. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7081. Attempting port 7082. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7082. Attempting port 7083. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7083. Attempting port 7084. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7084. Attempting port 7085. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7085. Attempting port 7086. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7086. Attempting port 7087. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7087. Attempting port 7088. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7088. Attempting port 7089. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7089. Attempting port 7090. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7090. Attempting port 7091. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7091. Attempting port 7092. 
16/05/17 11:00:55 WARN Utils: Service 'sparkMaster' could not bind on port 7092. Attempting port 7093. 
Exception in thread "main" java.net.BindException: Cannot assign requested address: Service 'sparkMaster' failed after 16 retries! 

Dies trotz der Tatsache, meine Sicherheitsgruppe

ALLOW IPv4 443/tcp from 0.0.0.0/0 
ALLOW IPv4 80/tcp from 0.0.0.0/0 
ALLOW IPv4 8081/tcp from 0.0.0.0/0 
ALLOW IPv4 8080/tcp from 0.0.0.0/0 
ALLOW IPv4 18080/tcp from 0.0.0.0/0 
ALLOW IPv4 7077/tcp from 0.0.0.0/0 
ALLOW IPv4 4040/tcp from 0.0.0.0/0 
ALLOW IPv4 to 0.0.0.0/0 
ALLOW IPv6 to ::/0 
ALLOW IPv4 22/tcp from 0.0.0.0/0 
+0

Konnten Sie Ihr Problem lösen? Ich kann einen Cluster von Computern erstellen, die dasselbe private Netzwerk teilen, aber wenn ich versuche, ähnliche Dinge zu tun (Zuweisung von öffentlichen IP-Adressen an Knoten), funktioniert es nicht. Link zu meiner Frage: https://stackoverflow.com/questions/48020657/how-to-bind-public-ip-to-spark-nodes-in-amazon-ec2 – user3086871

Antwort

2

korrekt scheint Wie in Protokolle erscheint,

Ihr Hostname, Spark-Master löst zu einem Loopback ein dresse: 127.0.1.1; mit 192.xx1 statt (auf eth0)

Funken automatisch versuchen, die IP-Adresse des Host zu bekommen, und es nutzt die anderen IP 192.x.x.1 anstatt die floating IP 87.x.x.1

dieses Problem, das Sie zu beheben sollte SPARK_LOCAL_IP=87.x.x.1 (vorzugsweise in Funken-env.sh) und starten Sie Ihren Master wieder

+0

Also, wenn ich 'SPARK_LOCAL_IP = 87.xx1 setzen 'setze ich auch' SPARK_MASTER_IP = 87.xx1' im selben * spark-env.sh *? –

+0

Ja, das ist genau das, was ich meinte – user1314742

+0

Könnten Sie Spark zwingen, IPV4 zu benutzen? Fügen Sie in spark-env.sh die folgende Zeile hinzu: 'Export SPARK_DAEMON_JAVA_OPTS =" - Djava.net.preferIPv4Stack = true "' – user1314742

3

ich einen Funken Cluster (Standalone-Cluster) auf Openstack gesetzt habe mich und in meinem/etc/hosts-Datei auf dem Master, ich habe:

127.0.0.1 localhost

192.168.1.2 spark-master statt 127.0.0.1

Jetzt, da ich ein virtuelles privates Netzwerk für meinen Master und meine Slaves habe, arbeite ich nur mit den privaten IPs. Die einzige Zeit, die ich die Floating-IP verwende, ist auf meinem Host-Computer, wenn ich spark-supply starten --master funke: // spark-master (spark-master wird hier in die Floating-IP aufgelöst). Ich glaube nicht, dass Sie versuchen müssen, die Floating IP zu binden. Ich hoffe das hilft!

Bruno

+0

Was setzen Sie 'SPARK_LOCAL_IP' und' SPARK_MASTER_IP' in der Datei conf? –

+0

Ich habe SPARK_LOCAL_IP nicht gesetzt, aber in meiner Datei conf, in spark.master habe ich: funken: // spark-master: 7077 (spark-master ist 192.168.1.2), hoffe es hilft! –