i can't start iot agent. used work. problem?
here start script (the context broker running under 192.168.1.126):
export ld_library_path=/usr/local/iot/lib /usr/local/iot/bin/iotagent -i 192.168.1.126 -p 80 -v debug -d /usr/local/iot/lib -c /etc/iot/config.json & here config.json file:
{ "resources": [ { "resource": "/iot/kuraresources", "options": { "filename": "ul20service" } } ], "timezones": "/etc/iot/date_time_zonespec.csv", "storage": { "type": "mongodb", "dbname": "iot" }, "ngsi_url": { "cbroker": "http://192.168.1.126:1026", "updatecontext": "/ngsi10/updatecontext", "registercontext": "/ngsi9/registercontext", "querycontext": "/ngsi10/querycontext" }, "timeout": 11, "dir_log": "/var/log/" } here log when try start it:
[root@localhost iot]# sudo ./ini_iotagent.sh log4cplus:error no appenders found logger (main). log4cplus:error please initialize log4cplus system properly. fatal - ======= iotagent startingwebserver: 192.168.1.126 ======== debug - resthandle constructor info - type_store:mongodb debug - setting function in cache find in mongo debug - check tables in mongo debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 [root@localhost iot]# debug - |event=end-alarm|code=100|origin= 127.0.0.1:27017|info=mongoconnection ok debug - collection:ensureindex|bbdd=iot.device|index={ ns: "iot.device", name: "shardkey", v: 1, unique: true, key: { device_id: 1, service: 1, service_path: 1 } } debug - insert in iot.system.indexes { ns: "iot.device", name: "shardkey", v: 1, unique: true, key: { device_id: 1, service: 1, service_path: 1 } } debug - |event=end-alarm|code=100|origin=127.0.0.1:27017|info={ "connectionid" : 32, "n" : 0, "syncmillis" : 0, "writtento" : null, "err" : null, "ok" : 1 } debug - mongo operation ok debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 debug - |event=end-alarm|code=100|origin= 127.0.0.1:27017|info=mongoconnection ok debug - collection:ensureindex|bbdd=iot.service|index={ ns: "iot.service", name: "shardkey", v: 1, unique: true, key: { service: 1, service_path: 1, resource: 1 } } debug - insert in iot.system.indexes { ns: "iot.service", name: "shardkey", v: 1, unique: true, key: { service: 1, service_path: 1, resource: 1 } } debug - |event=end-alarm|code=100|origin=127.0.0.1:27017|info={ "connectionid" : 33, "n" : 0, "syncmillis" : 0, "writtento" : null, "err" : null, "ok" : 1 } debug - mongo operation ok debug - iota::adminservice::adminservice debug - resthandle constructor info - type_store:mongodb debug - setting function in cache find in mongo debug - check tables in mongo debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 debug - |event=end-alarm|code=100|origin= 127.0.0.1:27017|info=mongoconnection ok debug - collection:ensureindex|bbdd=iot.device|index={ ns: "iot.device", name: "shardkey", v: 1, unique: true, key: { device_id: 1, service: 1, service_path: 1 } } debug - insert in iot.system.indexes { ns: "iot.device", name: "shardkey", v: 1, unique: true, key: { device_id: 1, service: 1, service_path: 1 } } debug - |event=end-alarm|code=100|origin=127.0.0.1:27017|info={ "connectionid" : 34, "n" : 0, "syncmillis" : 0, "writtento" : null, "err" : null, "ok" : 1 } debug - mongo operation ok debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 debug - |event=end-alarm|code=100|origin= 127.0.0.1:27017|info=mongoconnection ok debug - collection:ensureindex|bbdd=iot.service|index={ ns: "iot.service", name: "shardkey", v: 1, unique: true, key: { service: 1, service_path: 1, resource: 1 } } debug - insert in iot.system.indexes { ns: "iot.service", name: "shardkey", v: 1, unique: true, key: { service: 1, service_path: 1, resource: 1 } } debug - |event=end-alarm|code=100|origin=127.0.0.1:27017|info={ "connectionid" : 35, "n" : 0, "syncmillis" : 0, "writtento" : null, "err" : null, "ok" : 1 } debug - mongo operation ok debug - iota::ngsiservice::ngsiservice info - added request handler http resource: /iot info - loaded static web service resource (/iot) info - added request handler http resource: /iot/ngsi info - loaded static web service resource (/iot/ngsi) debug - registering /iot/ngsi debug - config file /etc/iot/config.json debug - starting___ /iot/kuraresources debug - resthandle constructor info - type_store:mongodb debug - setting function in cache find in mongo debug - check tables in mongo debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 debug - |event=end-alarm|code=100|origin= 127.0.0.1:27017|info=mongoconnection ok debug - collection:ensureindex|bbdd=iot.device|index={ ns: "iot.device", name: "shardkey", v: 1, unique: true, key: { device_id: 1, service: 1, service_path: 1 } } debug - insert in iot.system.indexes { ns: "iot.device", name: "shardkey", v: 1, unique: true, key: { device_id: 1, service: 1, service_path: 1 } } debug - |event=end-alarm|code=100|origin=127.0.0.1:27017|info={ "connectionid" : 36, "n" : 0, "syncmillis" : 0, "writtento" : null, "err" : null, "ok" : 1 } debug - mongo operation ok debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 debug - |event=end-alarm|code=100|origin= 127.0.0.1:27017|info=mongoconnection ok debug - collection:ensureindex|bbdd=iot.service|index={ ns: "iot.service", name: "shardkey", v: 1, unique: true, key: { service: 1, service_path: 1, resource: 1 } } debug - insert in iot.system.indexes { ns: "iot.service", name: "shardkey", v: 1, unique: true, key: { service: 1, service_path: 1, resource: 1 } } debug - |event=end-alarm|code=100|origin=127.0.0.1:27017|info={ "connectionid" : 37, "n" : 0, "syncmillis" : 0, "writtento" : null, "err" : null, "ok" : 1 } debug - mongo operation ok debug - iota::ul20service::ul20service info - added request handler http resource: /iot/kuraresources info - loaded web service plug-in resource (/iot/kuraresources): ul20service debug - set_service_option: filename ul20service fatal - bad argument: filename info - starting server on port 80 debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /agents url base /iot debug - added url /iot/agents debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /agents/<agent> url base /iot debug - added url /iot/agents/<agent> debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /devices url base /iot debug - added url /iot/devices debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /devices/<device> url base /iot debug - added url /iot/devices/<device> debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /services url base /iot debug - added url /iot/services debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /services/<service> url base /iot debug - added url /iot/services/<service> debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /about url base /iot debug - added url /iot/about debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /agents/<agent>/services url base /iot debug - added url /iot/agents/<agent>/services debug - registering /iot debug - no internal stats information in configuration file /iot info - no internal stats information in configuration file /iot debug - add url /agents/<agent>/services/<service> url base /iot debug - added url /iot/agents/<agent>/services/<service> debug - load timezone database /etc/iot/date_time_zonespec.csv error - oauth northbound not configured debug - start plugin ul2.0 debug - registering /iot/kuraresources debug - add url url base /iot debug - added url /iot/kuraresources debug - registering /iot/ngsi debug - no internal stats information in configuration file /iot/ngsi info - no internal stats information in configuration file /iot/ngsi debug - add url /iot/kuraresources/<operation> url base /iot debug - added url /iot/ngsi/kuraresources/<operation> info - init vector of services names resource: /iot/kuraresources debug - admin service ip: 192.168.1.126 debug - admin service port: 80 debug - providingapp: http://192.168.1.126:80/iot/ngsi/kuraresources debug - start ngsiservice info - oauth northbound not configured info - start thread registrations debug - sending register devices collection debug - in storage no host defined, using localhost default debug - in storage no port defined, using 27017 default debug - in storage no timeout defined, using 0 default debug - in storage no user defined, mongo without auth debug - in storage no pwd defined, mongo without auth debug - conex mongo dbclientconnection 127.0.0.1:27017/iot timeout in seconds:0 error - unable bind port 80: bind: cannot assign requested address httpfilter destructor 0 debug - destructor iota::ul20service::ul20service httpfilter destructor 0 fatal - bind: cannot assign requested address port 80 not used process. tested port error remained:
# netstat -lnp | grep 80 unix 2 [ acc ] stream listening 18076 1102/master public/pickup unix 2 [ acc ] stream listening 18083 1102/master public/qmgr unix 2 [ acc ] stream listening 18091 1102/master private/rewrite unix 2 [ acc ] stream listening 18094 1102/master private/bounce unix 2 [ acc ] stream listening 18097 1102/master private/defer unix 2 [ acc ] stream listening 18080 1102/master public/cleanup unix 2 [ acc ] stream listening 18087 1102/master private/tlsmgr unix 2 [ acc ] stream listening 20780 2380/ibus-daemon @/tmp/dbus-r1ju4xhn unix 2 [ acc ] stream listening 13805 1/systemd /var/run/dbus/system_bus_socket
it seems port 80 being used process.
you know process listening on port 80, executing command:
netstat -lnp | grep 80 if port 80 in use, can start iotagent on port, example port 8080:
/usr/local/iot/bin/iotagent -i 192.168.1.126 -p 8080 -v debug -d /usr/local/iot/lib -c /etc/iot/config.json &
Comments
Post a Comment