python - Scrapy Clusters kafka_monitor.py interrupted -
scrapy clusters great new way scale large, continuous scrapy projects. setup within vm , runs several instances different tools.
i've built vm out , installed necessary tools such redis, kafka, , zookeeper.
i'm stuck on simple line prior first test crawl , don't know if it's python issue, installation issue, or what.
when try
python kafka_monitor.py run
i get:
traceback (most recent call last): file "kafka_monitor.py", line 512, in sys.exit(main())
file "kafka_monitor.py", line 497, in main kafka_monitor.run()
file "kafka_monitor.py", line 413, in run self._setup_kafka()
file "kafka_monitor.py", line 232, in _setup_kafka ret_val = _hidden_setup()
file "/usr/local/lib/python2.7/dist-packages/scutils/method_timer.py", line 46, in f2 retval = f(*args)
file "kafka_monitor.py", line 218, in _hidden_setup self.kafka_conn = kafkaclient(self.settings['kafka_hosts'])typeerror: ____init___() takes 1 argument (2 given)
the settings.py
includes:
kafka_hosts = 'localhost:9092' kafka_incoming_topic = 'demo.incoming' kafka_group = 'demo-group' kafka_feed_timeout = 5 kafka_conn_timeout = 5
and instructed quick start made localsettings.py
well
# here, 'scdev' host kafka, redis, , zookeeper redis_host = 'scdev' kafka_hosts = 'scdev:9092' zookeeper_hosts = 'scdev:2181'
even if go kafka_monitor.py
, change line 218 (from intital error traceback above)
from:
self.kafka_conn = kafkaclient(self.settings['kafka_hosts'])
to:
self.kafka_conn = kafkaclient(self.settings['scdev:9092'])
i receive same error.
success!
@madison bahmer steering me in right direction. want clarify how got run.
the first line of actual code (so line 3) in kafka_monitor.py
reads:
from kafka.client import kafkaclient
i changed to:
from kafka import kafkaclient
this got work!
is short-sighted solution? break in future without:
from kafka.client import kafkaclient
i don't know i'll update in future if problems specific arrise.
Comments
Post a Comment