WEBOS LG TV: ares-inspect WARN Session#forward() failed forwarding client localPort: 0 => devicePort: 9998 - television

I need to debug app running on the tv
The command I am running
ares-inspect -d webOS_TV -a myapp --open
The error I am getting
> Session#forward() failed forwarding client localPort: 0
> (inCnx.remotePort: 55431 )=> devicePort: 9998 ares-inspect WARN
> Session#forward() failed forwarding client localPort: 0 => devicePort:
> 9998 Session#forward() failed forwarding client localPort: 0
> (inCnx.remotePort: 55432 )=> devicePort: 9998 ares-inspect WARN
> Session#forward() failed forwarding client localPort: 0 => devicePort:
> 9998 Application Debugging - http://localhost:55430 Session#forward()
> failed forwarding client localPort: 0 (inCnx.remotePort: 55438 )=>
> devicePort: 9998 ares-inspect WARN Session#forward() failed forwarding
> client localPort: 0 => devicePort: 9998
Please help
I cannot find any 9998 port running on my TV
ares-novacom -d webOS_TV --r 'netstat -at'
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:1900 0.0.0.0:* LISTEN
tcp 0 0 localhost:43725 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1266 0.0.0.0:* LISTEN
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:afs3-fileserver 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssg_http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssg_https 0.0.0.0:* LISTEN
tcp 0 0 localhost:43259 0.0.0.0:* LISTEN
tcp 0 0 localhost:39547 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1979 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1088 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9922 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1602 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:dial_http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:dial_tvapp 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1927 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:11111 0.0.0.0:* LISTEN
tcp 0 0 192.168.0.106:dial_http 192.168.0.102:47096 ESTABLISHED
tcp 0 0 localhost:39547 localhost:50092 ESTABLISHED
tcp 0 0 localhost:39726 localhost:43259 ESTABLISHED
tcp 0 0 192.168.0.106:ssg_https 192.168.0.103:40102 ESTABLISHED
tcp 0 0 192.168.0.106:ssg_https 192.168.0.103:40056 ESTABLISHED
tcp 0 0 192.168.0.106:57364 192.168.0.103:38520 TIME_WAIT
tcp 0 0 192.168.0.106:9922 192.168.0.107:49603 ESTABLISHED
tcp 1 0 192.168.0.106:41720 192.168.0.1:60440 CLOSE_WAIT
tcp 0 0 192.168.0.106:57352 192.168.0.103:38520 TIME_WAIT
tcp 0 0 192.168.0.106:ssg_https 192.168.0.103:40046 ESTABLISHED
tcp 0 0 192.168.0.106:11111 192.168.0.107:65512 CLOSE_WAIT
tcp 0 0 localhost:50092 localhost:39547 ESTABLISHED
tcp 0 0 192.168.0.106:57358 192.168.0.103:38520 TIME_WAIT
tcp 0 0 localhost:43259 localhost:39726 ESTABLISHED
tcp 224 0 192.168.0.106:11111 192.168.0.107:65511 CLOSE_WAIT
tcp 0 0 :::36718 :::* LISTEN
tcp 0 0 localhost:domain :::* LISTEN
tcp 0 0 :::9922 :::* LISTEN

I had installed the prod app and the local app has the same id so they were conflicted

Related

Can't start Varnish on port 80 CentOS v7.9.2009 kvm [ns] - Error: -a arguments localhost:8443 and localhost:8443 have same address

Would you guys please help. I installed Varnish before & worked following: https://computingforgeeks.com/install-varnish-cache-for-apache-nginx-on-centos/. It recently doesn't work anymore. Have no idea why.
[root#ns ~]# systemctl status varnish.service
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
Loaded: loaded (/usr/lib/systemd/system/varnish.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-03-02 08:41:43 UTC; 10s ago
Process: 22134 ExecStart=/usr/sbin/varnishd -a :80 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m (code=exited, status=255)
Mar 02 08:41:42 [nameserver url] systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Mar 02 08:41:42 [nameserver url] varnishd[22134]: (-? gives usage)
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service: control process exited, code=exited status=255
Mar 02 08:41:43 [nameserver url] systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Mar 02 08:41:43 [nameserver url] systemd[1]: Unit varnish.service entered failed state.
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service failed.
I guess the issue is:
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Ran netstat -ltnp to check ports :8443
[root#ns ~]# netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 1866/perl
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 612/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1444/pure-ftpd (SER
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1750/sshd
tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2077 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2078 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:446 0.0.0.0:* LISTEN 1488/docstore
tcp 0 0 0.0.0.0:52223 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2079 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:52224 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2080 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52227 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:52228 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52229 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52230 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52231 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 0.0.0.0:52232 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2090 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2091 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1718/redis-server 1
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 1443/memcached
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 822/exim
tcp6 0 0 :::110 :::* LISTEN 1461/dovecot
tcp6 0 0 ::1:783 :::* LISTEN 1866/perl
tcp6 0 0 :::143 :::* LISTEN 1461/dovecot
tcp6 0 0 :::111 :::* LISTEN 612/rpcbind
tcp6 0 0 :::8080 :::* LISTEN 21294/httpd
tcp6 0 0 :::465 :::* LISTEN 822/exim
tcp6 0 0 :::53 :::* LISTEN 1720/pdns_server
tcp6 0 0 :::21 :::* LISTEN 1444/pure-ftpd (SER
tcp6 0 0 :::4949 :::* LISTEN 847/perl
tcp6 0 0 :::22 :::* LISTEN 1750/sshd
tcp6 0 0 :::25 :::* LISTEN 822/exim
tcp6 0 0 :::443 :::* LISTEN 21294/httpd
tcp6 0 0 :::52223 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52224 :::* LISTEN 2190/im360: master
tcp6 0 0 :::993 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52227 :::* LISTEN 2190/im360: master
tcp6 0 0 :::995 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52228 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52229 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52230 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52231 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52232 :::* LISTEN 2190/im360: master
tcp6 0 0 :::3306 :::* LISTEN 2008/mysqld
tcp6 0 0 :::11211 :::* LISTEN 1443/memcached
tcp6 0 0 :::587 :::* LISTEN 822/exim
But I found no such port. Tried to restart Apache, and server and varnish. No help. Have you guys met the similar issue? How can I fix this? Thank you in advance
I run the default varnish service config file using:
$ sudo vi /etc/systemd/system/multi-user.target.wants/varnish.service
ExecStart=/usr/sbin/varnishd \
-a :80 \
-a localhost:8443,PROXY \
-p feature=+http2 \
-f /etc/varnish/default.vcl \
-s malloc,256m
ExecReload=/usr/sbin/varnishreload
I think the issue is this one. Remove and Varnish works again. But I am not sure if it cause trouble somewhere else.
-a localhost:8443,PROXY \

ERROR: transport error 202: bind failed: Cannot assign requested address

When I am trying to use sbt shell in intelliJ it appears the following error message:
Do I miss any settings?
Update
netstat -planet
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:41351 0.0.0.0:* LISTEN 1000 353424 573/java
tcp 0 0 127.0.0.1:63342 0.0.0.0:* LISTEN 1000 355674 573/java
tcp 0 0 0.0.0.0:33295 0.0.0.0:* LISTEN 1000 354289 573/java
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 101 16065 -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 0 34359 -
tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN 1000 354471 573/java
tcp 0 0 10.0.2.15:42510 151.101.193.69:443 ESTABLISHED 1000 305742 5102/chromium-brows
tcp 0 0 10.0.2.15:44344 104.66.167.140:443 ESTABLISHED 1000 345081 5102/chromium-brows
tcp 0 0 10.0.2.15:37646 198.252.206.25:443 ESTABLISHED 1000 353330 5102/chromium-brows
tcp 0 0 10.0.2.15:41480 104.16.29.34:443 ESTABLISHED 1000 349198 5102/chromium-brows
tcp 564 0 10.0.2.15:43148 172.217.168.42:443 ESTABLISHED 1000 377410 5102/chromium-brows
tcp 0 0 10.0.2.15:59768 54.246.222.93:443 ESTABLISHED 1000 368480 5102/chromium-brows
tcp 0 0 10.0.2.15:40474 216.58.215.226:443 ESTABLISHED 1000 327204 5102/chromium-brows
tcp 0 0 10.0.2.15:37728 198.252.206.25:443 ESTABLISHED 1000 376381 5102/chromium-brows
tcp 0 0 10.0.2.15:40470 216.58.215.226:443 ESTABLISHED 1000 327196 5102/chromium-brows
tcp 0 0 10.0.2.15:56458 34.193.164.107:443 ESTABLISHED 1000 352517 5102/chromium-brows
tcp 0 0 10.0.2.15:52954 91.228.74.181:443 ESTABLISHED 1000 377413 5102/chromium-brows
tcp 0 0 10.0.2.15:52956 91.228.74.181:443 ESTABLISHED 1000 377416 5102/chromium-brows
tcp 0 0 10.0.2.15:39020 172.217.168.66:443 ESTABLISHED 1000 324280 5102/chromium-brows
tcp 0 0 10.0.2.15:39324 216.58.215.230:443 ESTABLISHED 1000 375801 5102/chromium-brows
tcp 0 0 10.0.2.15:38640 172.217.168.38:443 ESTABLISHED 1000 352610 5102/chromium-brows
tcp 0 0 10.0.2.15:50876 172.217.168.46:443 ESTABLISHED 1000 343823 5102/chromium-brows
tcp 0 0 10.0.2.15:36630 198.252.206.25:443 ESTABLISHED 1000 327486 5102/chromium-brows
tcp 0 0 10.0.2.15:40544 216.58.215.227:443 ESTABLISHED 1000 318302 5102/chromium-brows
tcp 0 0 10.0.2.15:47506 151.101.194.49:443 ESTABLISHED 1000 353343 5102/chromium-brows
tcp 311 0 10.0.2.15:38920 13.32.166.42:443 ESTABLISHED 1000 377418 5102/chromium-brows
tcp 0 0 10.0.2.15:54224 192.30.253.125:443 ESTABLISHED 1000 317858 5102/chromium-brows
tcp 0 0 10.0.2.15:49846 172.217.168.46:443 ESTABLISHED 1000 327213 5102/chromium-brows
tcp 0 0 10.0.2.15:56456 34.193.164.107:443 ESTABLISHED 1000 351738 5102/chromium-brows
tcp 32 0 10.0.2.15:42114 52.207.55.4:443 CLOSE_WAIT 1000 374681 5102/chromium-brows
tcp6 0 0 :::43209 :::* LISTEN 1000 355214 772/java
tcp6 0 0 ::1:631 :::* LISTEN 0 34358 -
tcp6 0 0 127.0.0.1:30107 :::* LISTEN 1000 355213 772/java
tcp6 0 0 127.0.0.1:43906 127.0.0.1:33295 TIME_WAIT 0 0 -
tcp6 0 0 127.0.0.1:43904 127.0.0.1:33295 TIME_WAIT 0 0 -
tcp6 0 0 127.0.0.1:43922 127.0.0.1:33295 TIME_WAIT 0 0 -
Update 2
What do I have to set:
This used to (2015) suggest a port already in used (as in ensime/ensime-server issue 921)
You have the same error with JBoss for instance
ERROR: transport error 202: bind failed: Cannot assign requested address
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
Make sure there isn't already an sbt shell running elsewhere (netstat -planet).

haproxy - not reusing connections

I have a simple setup of 12 backend nodes (named backend1 to backend12) behind HAProxy loadbalancer. If I understand the HAProxy default mode it should use http persistent connections - the problem is that in my case it seems to be not working properly based on what I am seeing using netstat tool.
Below is the snippet of netstat commands during simple loadtest execution against single backend node behind HAProxy (the other one is set to MAINT state). Loadbalancer IP inside my network is 10.254.1.39
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 171 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED on (0,18/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 171 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED on (0,20/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED on (0,20/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 88 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED on (0,20/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED off (0.00/0/0)
tcp 0 170 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED on (0,19/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED on (0,21/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 171 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED on (0,20/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED on (0,19/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED on (0,21/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 170 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED on (0,20/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED off (0.00/0/0)
tcp 0 170 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED on (0,18/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED on (0,21/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED on (0,22/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:58272 ESTABLISHED off (0.00/0/0)
tcp 0 170 10.254.1.12:9091 10.254.1.39:58188 ESTABLISHED on (0,18/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58424 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58492 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58620 ESTABLISHED off (0.00/0/0)
tcp 0 170 10.254.1.12:9091 10.254.1.39:58643 ESTABLISHED on (0,19/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:58333 ESTABLISHED off (0.00/0/0)
I can see that in time more connections are opened but old ones are kept and being reused. The same thing is if I put backend1 to MAINT and enable only backend2
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39458 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 171 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED on (0,21/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39458 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED on (0,19/0/0)
tcp 0 171 10.254.1.13:9091 10.254.1.39:39458 ESTABLISHED on (0,20/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.13:9091 10.254.1.39:39458 ESTABLISHED on (0,19/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39526 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39610 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39458 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39526 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:39610 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39671 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39374 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39458 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:39526 ESTABLISHED off (0.00/0/0)
The problem starts when I put both backends (and more) to READY.
Output from backend1:
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:59570 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:59574 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:59709 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:59706 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:60209 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:60212 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:60212 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:60826 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:60813 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:60831 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:60833 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:33498 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:33502 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:33500 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:33504 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:33507 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:34042 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:34039 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:34032 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:34036 ESTABLISHED on (0,18/0/0)
tcp 0 170 10.254.1.12:9091 10.254.1.39:34036 ESTABLISHED on (0,18/0/0)
tcp 96 0 10.254.1.12:9091 10.254.1.39:34045 ESTABLISHED off (0.00/0/0)
ubuntu#backend1:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.12:9091 10.254.1.39:38181 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38150 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38167 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38163 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38179 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38170 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38130 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38172 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38139 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38176 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:35450 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38158 ESTABLISHED off (0.00/0/0)
tcp 0 171 10.254.1.12:9091 10.254.1.39:38137 ESTABLISHED on (0,20/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38177 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38144 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38125 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38144 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.12:9091 10.254.1.39:38125 ESTABLISHED off (0.00/0/0)
and from backend2
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:52464 ESTABLISHED off (0.00/0/0)
tcp 0 170 10.254.1.13:9091 10.254.1.39:52466 ESTABLISHED on (0,20/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:52628 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:52631 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:53127 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:53138 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:53137 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:53134 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:53819 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:53828 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:53826 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:53821 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 170 10.254.1.13:9091 10.254.1.39:54736 ESTABLISHED on (0,18/0/0)
tcp 0 171 10.254.1.13:9091 10.254.1.39:54728 ESTABLISHED on (0,18/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:54711 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:54738 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 170 10.254.1.13:9091 10.254.1.39:55342 ESTABLISHED on (0,18/0/0)
tcp 0 171 10.254.1.13:9091 10.254.1.39:55344 ESTABLISHED on (0,20/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:55340 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:55339 ESTABLISHED off (0.00/0/0)
ubuntu#backend2:~$ netstat -tao | grep 39:
tcp 0 0 10.254.1.13:9091 10.254.1.39:59507 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59502 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59489 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59491 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59471 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59497 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59493 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59509 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59457 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59479 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59511 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59470 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59505 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59465 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59488 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.254.1.13:9091 10.254.1.39:59513 ESTABLISHED off (0.00/0/0)
Looking at the port numbers on loadbalancer side (10.254.1.39) they are changing which means that the connections are closed and reopened again. The question is - why? I assume that if connections are reused in single node case my backend server (which is spray-can: http://spray.io/) is capable of working with http persistent connections.
Here is my HAProxy configuration:
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 4096
contimeout 5000
clitimeout 50000
srvtimeout 50000
frontend lb
bind *:8080
acl read_model_acl path_beg /check
use_backend read_models if read_model_acl
backend read_models
balance roundrobin
server read-model1 10.254.1.12:9091 check
server read-model2 10.254.1.13:9091 check
#more servers

SMTP & POP3 SSL Connection

I am using libetpan-1.0 open source (mail library stuff) for SMTP & POP3 access in "C" language. I have problem with SSL connection in SMTP & POP3. When i make SSL connection & connection gets fail, my socket is stay in CLOSE_WAIT state. This results in memory leak after a long time. Here is my output of command "netstat -an". I am running this application in ARM board. Can anyone tell me, what i should do? Thanks in advance.
Here is my code that i am trying.
pSmtp = mailsmtp_new(0, NULL); (Create new object)
if (SMTP_NO_ERROR != mailsmtp_ssl_connect(pSmtp, "smtp.gmail.com", 465))
{
mailsmtp_free(pSmtp);
}
else
{
// Send Mail
}
So doesn't my work is over after i call function "mailsmtp_free(pSmtp)" or
i have do other stuff to close connection.
~#netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
tcp 1 0 192.168.51.151:4928 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4934 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2883 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4139 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4140 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2745 TIME_WAIT
tcp 1 0 192.168.51.151:4142 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4143 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3132 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3133 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3134 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3135 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3131 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2115 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3136 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3137 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2761 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2757 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2753 TIME_WAIT
tcp 1 0 192.168.51.151:4083 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4082 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4081 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4080 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4085 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4084 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4075 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4074 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4073 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4072 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4079 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4078 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4077 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4076 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2493 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2492 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2495 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2496 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52577 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52581 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52585 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52565 TIME_WAIT
tcp 1 0 192.168.51.151:3978 63.250.193.228:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52569 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52573 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52609 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2748 TIME_WAIT
tcp 1 0 192.168.51.151:2743 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2742 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2744 98.139.211.125:465 CLOSE_WAIT
tcp 94 0 192.168.51.151:3650 74.125.129.108:587 CLOSE_WAIT
tcp 95 0 192.168.51.151:3655 74.125.129.108:587 CLOSE_WAIT
tcp 1 0 192.168.51.151:2250 63.250.193.228:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52578 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52582 TIME_WAIT
tcp 95 0 192.168.51.151:4618 74.125.129.108:587 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52586 TIME_WAIT
tcp 95 0 192.168.51.151:4615 74.125.129.108:587 CLOSE_WAIT
tcp 1 0 192.168.51.151:4353 98.139.211.125:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52590 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52594 TIME_WAIT
tcp 1 0 192.168.51.151:2769 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52598 TIME_WAIT
udp 0 0 0.0.0.0:2048 0.0.0.0:*
udp 0 0 0.0.0.0:2049 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 6 [ ] DGRAM 1262 /dev/log
unix 2 [ ] DGRAM 1993
unix 2 [ ] DGRAM 1513
unix 2 [ ] DGRAM 1511
unix 2 [ ] DGRAM 1492
You need to close them on your side.
CLOSE_WAIT means the remote side has closed the connection, but your side hasn't.
See accepted answer here

MongoDB Map Reduce

Hi I had following document in collection
{
"_id" : ObjectId("5236b303e4b074ca9f4ed453")
"Commands":{
"netstat -tulpn":"Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2285/mysqld
tcp 0 0 0.0.0.0:63342 0.0.0.0:* LISTEN 3992/java
tcp 0 0 0.0.0.0:33359 0.0.0.0:* LISTEN 1913/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1794/rpcbind
tcp 0 0 0.0.0.0:3216 0.0.0.0:* LISTEN 3485/skype
tcp 0 0 0.0.0.0:28017 0.0.0.0:* LISTEN 3821/mongod
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2628/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2147/sshd
tcp 0 0 127.0.0.1:44567 0.0.0.0:* LISTEN 11436/GoogleTalkPlu
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1987/cupsd
tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN 3992/java
tcp 0 0 127.0.0.1:55777 0.0.0.0:* LISTEN 11436/GoogleTalkPlu
tcp 0 0 127.0.0.1:6311 0.0.0.0:* LISTEN 5088/Rserve
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 3821/mongod
tcp 0 0 127.0.0.1:9001 0.0.0.0:* LISTEN 2382/java
tcp 0 0 :::111 :::* LISTEN 1794/rpcbind
tcp 0 0 :::22 :::* LISTEN 2147/sshd
tcp 0 0 :::36441 :::* LISTEN 1913/rpc.statd
udp 0 0 0.0.0.0:111 0.0.0.0:* 1794/rpcbind
udp 0 0 127.0.0.1:39287 0.0.0.0:* 3485/skype
udp 0 0 0.0.0.0:631 0.0.0.0:* 1987/cupsd
udp 0 0 0.0.0.0:3216 0.0.0.0:* 3485/skype
udp 0 0 0.0.0.0:52777 0.0.0.0:* 1913/rpc.statd
udp 0 0 0.0.0.0:817 0.0.0.0:* 1913/rpc.statd
udp 0 0 192.168.122.1:53 0.0.0.0:* 2628/dnsmasq
udp 0 0 0.0.0.0:697 0.0.0.0:* 1794/rpcbind
udp 0 0 0.0.0.0:67 0.0.0.0:* 2628/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 18609/dhclient
udp 0 0 :::111 :::* 1794/rpcbind
udp 0 0 :::697 :::* 1794/rpcbind
udp 0 0 :::47419 :::* 1913/rpc.statd "
}
}
and my map reduce code was given below
var mapfunction = function(){
var key,values;
for (var i in this.Commands) {
key = {id:this._id};
values = {commands:this.Commands};
emit(key,values);
}
}
var reducefunction = function(key,values){
var reduced = {netstat:[]};
for(var i =0 ; i< values.length;i++){
reduced.netstat = values[i].commands.netstat -tulpn;
}
return reduced;
}
db.collectioname.mapReduce(mapfunction,reducefunction,{
out: {replace:"final"}
})
When I was run this code mongoshell it shows following error
"JavaScript execution failed: map reduce failed:{
"errmsg" : "exception: JavaScript execution failed: ReferenceError: tulpn is not defined near '.netstat -tulpn; ' (line 5)",
"code" : 16722,
"ok" : 0
}
Can any one tell me why mongo map reduced not worked on key which contains spaces in two words? Any one knows how to solved this issues?
Try values[i].commands['netstat -tulpn'] instead of values[i].commands.netstat -tulpn.