Cannot launch flink from local host when trying to run it with webUI - apache-flink

I'm trying to debug my flink from intellij using the flink UI.
the problem it somethims doesn't launched throwing java.net.BindException: Could not start rest endpoint on any port in port range 8081
my piece of code that should let the flink ui run (from windows) is:
String osName = System.getProperty("os.name");
if (osName.toLowerCase().contains("win")) {
Configuration conf = new Configuration();
conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true);
env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf);
} else {
env = StreamExecutionEnvironment.getExecutionEnvironment();
}
can you assist please?

If you cannot bind to a given network port that usually means it has been already taken. So check if there is any process running on that port (old job manager?) and kill it.
Alternatively, you can change the port with
conf.setInteger(RestOptions.PORT, 8082);
or if want to be on the save side specify a range
conf.setString(RestOptions.BIND_PORT, "8081-8099");

One can change the default port mapping in ../conf/flink-conf.yml file.
rest.port: 18081
or use port range e.g.
rest.bind-port: 18080-18090

Related

Node.js application wont start on my public IP

I'm SSHing into a linux shell for a school project. Right now, we're trying to set up a react app for a web frontend. We were able to run the app on localhost easily enough, and all of the functionality seems to be good, but I can't figure out how to get this hosted on the public IP of the computer. We've been using yarn to do all of this, though i've tried other things, so here's some cli output.
path/to/thing# yarn start
yarn run v1.22.5
$ react-scripts start
Attempting to bind to HOST environment variable: public.facing.ip.address //This is a website name
If this was unintentional, check that you haven't mistakenly set it in your shell.
Learn more here: //There was a link here but SO formatting wouln't let me keep it.
Could not find an open port at public.facing.ip.address.
Network error message: listen EADDRNOTAVAIL: address not available public.facing.ip.address //numeric
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
root#computer:path/to/thing#
When I run hostname -I, public.facing.ip.address does not appear at all. So that seems like the obvious issue. The catch here is that we are also running jenkins on a separate port of public.facing.ip.address from this same computer. That was much easier to set up, it just came as something I could start as a service using 'systemctl start jenkins' and up it went onto the public facing IP. I set all that up and I can access it just fine, etc. The best I can do with this is modify the HOST variable either in the terminal or the .env file, then yarn starts a development server on localhost (which I can't access since I'm on a different network SSHing into this computer)
How do I make yarn host our webapp on the public facing IP?
open your router page, there should be dmz host option somewhere, point it to your local ip address
My networking inexperience was the culprit. Instead of using HOST=path.to.public.ip, the solution was to use HOST=0.0.0.0.

Appium local testing

I would like to run local server tests on real devices using appium. Are there any existing capabilities which i could use to do so ? I basicall have a server running on a port on my local machine but would like to test it on a real device.
For example i want to test http://locahost:3000 on a real device. how can this port be avaialble on the real mobile device? I know Browser/Stack or Sauce labs implement this using their own local binaries. Can this be done with appium ?
Note: I have my grid setup ready with real devices configured and i can run other tests normally.
EDIT: Just to make it clear and to avoid irrelevant answers. I am looking for something like network sharing from the machine where the tests are invoked to run on real devices. i want to to test a server which is hosted locally and not avilable on the internet.
In order to test on real device, your device must be connected to your computer. To run the test on multiple devices, multiple instance of appium server must be run. You must use device udid in DesiredCapabilities to run the test on the specific device.
To run the appium server in port 3000 you must run the following command in terminal:
appium -a 127.0.0.1 -p 3000 --session-override
Appium server must be installed in your system in order to run above command.
Using port 3000 is not recommended as other program may be using the same port.
To run the app in real device you can define your AppiumDriver and DesiredCapabilities like following:
public class Test1(){
public static AppiumDriver<MobileElement> driver;
public static void main(String[] args){
DesiredCapabilities caps=new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.UDID, "your device udid");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "android device");
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
caps.setCapability("appPackage", appPackage);
caps.setCapability("appActivity", appActivity);
caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, "uiautomator2");
try{
driver == new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:3000/wd/hub"), caps);
}catch(Exception e){
e.printStackTrace();
}
}
Please check below link to apply proxy settings in Appium.
https://www.npmjs.com/package/appium-proxy#setup-a-basic-appium-proxy

Azkaban Execute error

Got following Error when Executing flow.
Error submitting flow bar. azkaban.executor.ExecutorManagerException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:10000 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
I changed some lines in azkaban.properties.
default.timezone.id=Asia/Tokyo
jetty.port=8081
executor.port=10000
azkaban using azkaban-solo-server.
It looks as though the azkaban-web-server is not able to contact the azkaban-exec-server. The azkaban executor is a separate process from the azkaban web interface and uses a separate configuration.
Firstly, confirm that the executor is running and listening on the correct port. eg. for a non-windows environment:
$ ps -elf | grep azkaban-exec-server
If it's not running, then it will need to be started. If it is running, then you need to ensure that the listening port of the executor is the same as the executor port configured in the azkaban-web-server azkaban.properties. You can do this by checking the -Dexecutorport argument to the running azkaban-exec-server process or by checking the executor.port value in the azkaban-exec-server azkaban.properties.
If this value differs from the executor.port value in the azkaban-web-server azkaban.properties then you need to ensure that the values match (either by modifying executor.port in the azkaban-web-server or azkaban-exec-server azkaban.properties) and that the relevant service(s) get restarted following any configuration changes.

flink - zeppelin - not responding

I am unable to run flink (1.0.3) process in zepplin. It is pending and web ui is not recording the process: both in cluster and local mode. Flink itself works fine in command line and intellij. I built zeppelin as mvn clean package.
Has anyone had a similar issue? Do I need to amend zeppelin-env.sh to rectify filk? I am unable to kill process in zeppelin web ui had to use ./bin/zeppelin-daemon.sh restart
I am using Flink 1.2 but I had the same problem.
I did two thing and it worked for me.
First of all, update your version. After, in the Interpreter I changed the value host = local to your localhost IP address.
Second, kill all the procces of Flink in terminal, just use web ui of Zeppelin.
You can check everything is going fine writting:
%flink
senv
res0: org.apache.flink.streaming.api.scala.StreamExecutionEnvironment = org.apache.flink.streaming.api.scala.StreamExecutionEnvironment#48388d9f
Let me know how it is going.
Regards! :)

How to use taskqueues with GAE 1.7.7 behind a proxy

I upgraded to GAE 1.7.7 today and found out that task queues stopped working on my development setup.
I'm using https on my development environment through an nginx set up to proxy the connections from fakedomain.local:80 and fakedomain.local:443 to localhost:8080 (where GAE listens).
With this setup, taskqueues end up being created to be executed at fakedomain.local:80. This used to work because the request would be picked up by nginx, but the version 1.7.7 of the development server seems to have a port registry which won't serve a request unless the port is known (if I understand google.appengine.tools.devappserver2.Dispatcher._resolve_target correctly). Of course, GAE listens on port 8080 and my tasks marked to run on fakedomain.local:80 never get executed (GAE logs this error: An error occured while sending the task "task1" (Url: "...") in queue...).
I tried patching dispatcher.py:577 so instead of raising a ServerDoesNotExistError when the port is not known it will just use the default server. With this modification I can get the taskqueues running again, but I'd rather use a solution which doesn't involve changing GAE's code.
How can I make GAE register the port 80 and 443 in version 1.7.7? Alternatively, is there a way I could specify the complete target URL for the task? (ie fakedomain.local:8080/my_task, instead of just /mytask).
taskqueue.add(target=taskqueue.DEFAULT_APP_VERSION, ...)
will run it on your default app, which should do exactly what you want.
taskqueue.DEFAULT_APP_VERSION =>
app_identity.get_default_version_hostname() =>
environ['DEFAULT_VERSION_HOSTNAME'] =>
'%s:%s' % (environ['SERVER_NAME'], server_port)

Resources