connection refused error when running Nutch 2

2019-04-07 16:03发布

I am trying to run Nutch 2 crawler on my system but I get the following error:

Exception in thread "main" org.apache.gora.util.GoraException: java.io.IOException: java.sql.SQLTransientConnectionException: java.net.ConnectException: Connection refused
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:167)
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:135)
at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:69)
at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:243)
at org.apache.nutch.crawl.Crawler.runTool(Crawler.java:68)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:136)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:250)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.Crawler.main(Crawler.java:257)
Caused by: java.io.IOException: java.sql.SQLTr
ansientConnectionException: java.net.ConnectException: Connection refused
    at org.apache.gora.sql.store.SqlStore.getConnection(SqlStore.java:747)
    at org.apache.gora.sql.store.SqlStore.initialize(SqlStore.java:160)
    at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:102)
    at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:161)
    ... 8 more
Caused by: java.sql.SQLTransientConnectionException: java.net.ConnectException: Connection refused
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:620)
    at java.sql.DriverManager.getConnection(DriverManager.java:200)
    at org.apache.gora.sql.store.SqlStore.getConnection(SqlStore.java:739)
    ... 11 more
Caused by: org.hsqldb.HsqlException: java.net.ConnectException: Connection refused
    at org.hsqldb.ClientConnection.openConnection(Unknown Source)
    at org.hsqldb.ClientConnection.initConnection(Unknown Source)
    at org.hsqldb.ClientConnection.<init>(Unknown Source)
    ... 17 more
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
    at java.net.Socket.connect(Socket.java:546)
    at java.net.Socket.connect(Socket.java:495)
    at java.net.Socket.<init>(Socket.java:392)
    at java.net.Socket.<init>(Socket.java:206)
    at org.hsqldb.server.HsqlSocketFactory.createSocket(Unknown Source)
    ... 20 more

what is the problem? my internet connection is direct.

2条回答
SAY GOODBYE
2楼-- · 2019-04-07 16:41

I had the same error. I changed the connection URL from

<property name="connection.url">jdbc:hsqldb:hsql://localhost</property>

to

<property name="connection.url">jdbc:hsqldb:mem://localhost</property>

and it did the trick.

查看更多
叛逆
3楼-- · 2019-04-07 16:49

Had the same error. I forgot 'configuration' tag at conf/nutch-site.xml:

<configuration>
    <property>
        <name>storage.data.store.class</name>
        <value>org.apache.gora.hbase.store.HBaseStore</value>
        <description>Default class for storing data</description>
    </property>
</configuration>
查看更多
登录 后发表回答