question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bookie does not start because of UnknownHostException

See original GitHub issue

We are trying to set up Pulsar using 3 systems each with 8GB RAM and AMD A8 processors. We are planning on running bookkeeper, zookeeper, broker on the same machines.

Describe the bug [main] ERROR org.apache.bookkeeper.server.Main - Failed to build bookie server java.net.UnknownHostException: Trying to listen on loopback address, 127.0.1.1:3181 but this is forbidden by default (see ServerConfiguration#getAllowLoopback()).

To Reproduce Steps to reproduce the behavior:

  1. Follow the setup steps given at https://pulsar.apache.org/docs/en/deploy-bare-metal/
  2. We added the servers to the zookeeper.conf file and create data directory and id. We are using the following Zookeper configuration
server.1=10.6.8.14:2888:3888
server.2=10.6.8.13:2888:3888
server.3=10.6.8.15:2888:3888
  1. We initialized cluster metadata as follows in the server.1 machine
bin/pulsar initialize-cluster-metadata --cluster pulsar-cluster-1 --zookeeper 10.6.8.14:2181 --web-service-url http://10.6.8.14:8080,10.6.8.13:8080,10.6.8.15:8080 --broker-service-url pulsar://10.6.8.14:6650,10.6.8.13:6650,10.6.8.15:6650 --configuration-store 10.6.8.14:2181
  1. We changed bookkeeper.conf as follows
zkServers=10.6.8.14:2181,10.6.8.13:2181,10.6.8.15:2181
  1. We started Bookie and got the following error
bin/bookkeeper bookie
JMX enabled by default
JAVA_HOME not set, using java from PATH. (/usr/bin/java)
15:02:38.366 [main] INFO  org.apache.bookkeeper.server.Main - Using configuration file /home/slave1fyp/apache-pulsar-2.4.1/conf/bookkeeper.conf
15:02:38.371 [main] INFO  org.apache.bookkeeper.server.Main - Hello, I'm your bookie, listening on port 3181. Metadata service uri is zk+null://10.6.8.14:2181;10.6.8.13:2181;10.6.8.15:2181/ledgers. Journals are in [data/bookkeeper/journal]. Ledgers are stored in data/bookkeeper/ledgers.
15:02:38.394 [main] INFO  org.apache.bookkeeper.server.Main - Load lifecycle component : org.apache.bookkeeper.server.service.StatsProviderService
15:02:38.741 [main] INFO  org.apache.bookkeeper.proto.BookieServer - {
  "readBufferSizeBytes" : "4096",
  "statsProviderClass" : "org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider",
  "majorCompactionThreshold" : "0.5",
  "numJournalCallbackThreads" : "8",
  "httpServerPort" : "8000",
  "lostBookieRecoveryDelay" : "0",
  "journalAlignmentSize" : "4096",
  "compactionRateByBytes" : "1000000",
  "httpServerClass" : "org.apache.bookkeeper.http.vertx.VertxHttpServer",
  "dbStorage_rocksDB_numFilesInLevel0" : "4",
  "minUsableSizeForIndexFileCreation" : "1073741824",
  "gcOverreplicatedLedgerWaitTime" : "86400000",
  "journalMaxGroupWaitMSec" : "1",
  "dbStorage_rocksDB_numLevels" : "-1",
  "dbStorage_rocksDB_bloomFilterBitsPerKey" : "10",
  "ledgerStorageClass" : "org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage",
  "auditorPeriodicBookieCheckInterval" : "86400",
  "gcWaitTime" : "900000",
  "compactionRate" : "1000",
  "fileInfoFormatVersionToWrite" : "0",
  "entryLogFilePreallocationEnabled" : "true",
  "journalSyncData" : "true",
  "zkServers" : "[10.6.8.14:2181, 10.6.8.13:2181, 10.6.8.15:2181]",
  "compactionRateByEntries" : "1000",
  "dbStorage_rocksDB_maxSizeInLevel1MB" : "256",
  "diskCheckInterval" : "10000",
  "auditorPeriodicCheckInterval" : "604800",
  "dbStorage_rocksDB_writeBufferSizeMB" : "64",
  "autoRecoveryDaemonEnabled" : "true",
  "maxPendingAddRequestsPerThread" : "10000",
  "majorCompactionInterval" : "86400",
  "httpServerEnabled" : "false",
  "flushInterval" : "60000",
  "journalFlushWhenQueueEmpty" : "false",
  "minorCompactionInterval" : "3600",
  "dbStorage_rocksDB_blockCacheSize" : "",
  "isThrottleByBytes" : "false",
  "numAddWorkerThreads" : "0",
  "dbStorage_rocksDB_sstSizeInMB" : "64",
  "journalDirectory" : "data/bookkeeper/journal",
  "journalWriteBufferSizeKB" : "64",
  "diskUsageThreshold" : "0.95",
  "openFileLimit" : "0",
  "prometheusStatsHttpPort" : "8000",
  "zkLedgersRootPath" : "/ledgers",
  "journalMaxSizeMB" : "2048",
  "journalAdaptiveGroupWrites" : "true",
  "openLedgerRereplicationGracePeriod" : "30",
  "ledgerDirectories" : "data/bookkeeper/ledgers",
  "zkTimeout" : "30000",
  "dbStorage_rocksDB_blockSize" : "65536",
  "journalMaxBackups" : "5",
  "maxPendingReadRequestsPerThread" : "2500",
  "useHostNameAsBookieID" : "false",
  "rereplicationEntryBatchSize" : "100",
  "allowLoopback" : "false",
  "readOnlyModeEnabled" : "true",
  "journalRemoveFromPageCache" : "true",
  "dbStorage_readAheadCacheMaxSizeMb" : "",
  "zkEnableSecurity" : "false",
  "numHighPriorityWorkerThreads" : "8",
  "dbStorage_readAheadCacheBatchSize" : "1000",
  "journalFormatVersionToWrite" : "5",
  "writeBufferSizeBytes" : "65536",
  "bookiePort" : "3181",
  "dbStorage_writeCacheMaxSizeMb" : "",
  "pageLimit" : "0",
  "logSizeLimit" : "1073741824",
  "advertisedAddress" : "",
  "bookieDeathWatchInterval" : "1000",
  "numReadWorkerThreads" : "8",
  "minorCompactionThreshold" : "0.2",
  "serverTcpNoDelay" : "true",
  "journalBufferedWritesThreshold" : "524288",
  "compactionMaxOutstandingRequests" : "100000",
  "journalPreAllocSizeMB" : "16"
}
15:02:39.490 [main] ERROR org.apache.bookkeeper.server.Main - Failed to build bookie server
java.net.UnknownHostException: Trying to listen on loopback address, 127.0.1.1:3181 but this is forbidden by default (see ServerConfiguration#getAllowLoopback()).
If this happen, you can consider specifying the network interface to listen on (e.g. listeningInterface=eth0) or specifying the advertised address (e.g. advertisedAddress=172.x.y.z)
	at org.apache.bookkeeper.bookie.Bookie.getBookieAddress(Bookie.java:570) ~[org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.proto.BookieNettyServer.<init>(BookieNettyServer.java:164) ~[org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.proto.BookieServer.<init>(BookieServer.java:104) ~[org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.server.service.BookieService.<init>(BookieService.java:43) ~[org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.server.Main.buildBookieServer(Main.java:301) ~[org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.server.Main.doMain(Main.java:221) [org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.server.Main.main(Main.java:203) [org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]
	at org.apache.bookkeeper.proto.BookieServer.main(BookieServer.java:314) [org.apache.bookkeeper-bookkeeper-server-4.9.2.jar:4.9.2]

Expected behavior Bookkeeper starts

Desktop (please complete the following information):

  • 3 PC’s with 8GB RAM and AMD A8 processors

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jiazhaicommented, Dec 16, 2019

@vishalananth07 sorry, not notice that you are using 3 nodes. For 3 nodes, you should not change allowLoopback to true. How about a try on this?

allowLoopback=false
advertisedAddress=you_bookie_address
useHostNameAsBookieID=false

Then in a clean deploy, all bookie nodess should be identified by their IP:3181

0reactions
vishalananth07commented, Dec 16, 2019

@jiazhai Everything is working perfectly now 😃, Thanks a lot for your patient help and support

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] [pulsar-helm-chart] Shohou opened a new issue #70
**Describe the bug** Pulsar components not starting when user provided zookeepers ... because it's not resolvable at org.apache.zookeeper.
Read more >
ServerConfiguration.getBookiePort - Java - Tabnine
Helper method to startup a new bookie server with the indicated port number. Also, starts the auto recovery * process, if the isAutoRecoveryEnabled...
Read more >
org.apache.bookkeeper.bookie.Bookie.java Source code
Here is the source code for org.apache.bookkeeper.bookie. ... isUnresolved()) { throw new UnknownHostException( "Unable to resolve default hostname: " + ...
Read more >
Problem in JFrames - java - Stack Overflow
So after login is authenticated current JFrame is setVisible(false), and a new JFrame with chat window should be displayed and socket ...
Read more >
Apache Pulsar - global architecture and local setup
I'm really happy to start a whole new chapter on the blog and include ... And it was harder than I expected, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found