Orion iot Agent не запускается

Я не могу запустить свой Iot Agent. Раньше это работало. В чем может быть проблема?

Вот мой стартовый скрипт (брокер контекста работает под 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 & 

Вот мой файл config.json:

   {
       "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/"
   }

Вот мой журнал, когда я пытаюсь его запустить:

[root@localhost iot]# sudo ./ini_iotagent.sh
log4cplus:ERROR No appenders could be found for logger (main).
log4cplus:ERROR Please initialize the log4cplus system properly.
FATAL - ======= IoTAgent StartingWebServer: 192.168.1.126 ========
DEBUG - RestHandle constructor
INFO - type_store:mongodb
DEBUG - Setting function get in cache to find in mongo
DEBUG - Check tables in mongo
DEBUG - in storage no host defined, using localhost by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 with { 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 by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 with { 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 get in cache to find in mongo
DEBUG - Check tables in mongo
DEBUG - in storage no host defined, using localhost by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 with { 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 by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 with { 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 for HTTP resource: /iot
INFO - Loaded static web service for resource (/iot)
INFO - Added request handler for HTTP resource: /iot/ngsi
INFO - Loaded static web service for 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 get in cache to find in mongo
DEBUG - Check tables in mongo
DEBUG - in storage no host defined, using localhost by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 with { 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 by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 with { 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 for HTTP resource: /iot/kuraResources
INFO - Loaded web service plug-in for 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 to 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> to 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 to 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> to 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 to 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> to 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 to 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 to 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> to url base /iot
DEBUG - Added url /iot/agents/<agent>/services/<service>
DEBUG - Load timezone database /etc/iot/date_time_zonespec.csv
ERROR - OAuth for northbound is not configured
DEBUG - START PLUGIN UL2.0
DEBUG - Registering /iot/kuraResources
DEBUG - Add url  to 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> to url base /iot
DEBUG - Added url /iot/ngsi/kuraResources/<operation>
INFO - Init vector of services names by 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 for northbound is not configured
INFO - Start thread registrations
DEBUG - Sending all register from devices collection
DEBUG - in storage no host defined, using localhost by default
DEBUG - in storage no port defined, using 27017 by default
DEBUG - in storage no timeout defined, using 0 by 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 to bind to port 80: bind: Cannot assign requested address
HTTPFilter DESTRUCTOR 0
DEBUG - Destructor iota::UL20Service::UL20Service
HTTPFilter DESTRUCTOR 0
FATAL - bind: Cannot assign requested address

Порт 80 не используется другим процессом. Я протестировал другой порт, но ошибка осталась:

# 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

person sabrina2020    schedule 17.07.2015    source источник


Ответы (2)


Похоже, что порт 80 используется другим процессом.

Вы можете узнать, какой процесс прослушивает порт 80, выполнив эту команду:

netstat -lnp | grep 80

Если порт 80 используется, вы можете запустить iotagent на другом порту, например на порту 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 &
person rbanos    schedule 20.07.2015
comment
нет, порт 80 не используется, и я пробовал другой порт, но та же ошибка осталась :( - person sabrina2020; 20.07.2015

Я ошибался насчет IP-адреса Iot-агента, указанного в сценарии запуска.

Спасибо за вашу помощь.

person sabrina2020    schedule 20.07.2015