2016-09-23 94 views
3

我想安裝ckan 2.2.1 + pgsql 9.1 + solr 3.6 + rhel 6.6。ckan datapusher/api/3/action/resource_show(引起<class'socket.error'>:[Errno 111] Connection refused)error

我設置了文件存儲和數據存儲插件。我試圖在ckan網站上使用'上傳到數據存儲'菜單。那麼我得到了這個錯誤。

2016-09-23 23:16:54,655 INFO [ckan.lib.base] /dataset/datastore/resource_data/7a82b5c2-d68c-4bed-b5c6-fcc460011455 render time 0.363 seconds 
Job "push_to_datastore (trigger: RunTriggerNow, run = True, next run at: None)" raised an exception 
Traceback (most recent call last): 
    File "/usr/lib/ckan/default/lib/python2.7/site-packages/apscheduler/scheduler.py", line 512, in _run_job 
    retval = job.func(*job.args, **job.kwargs) 
    File "/usr/lib/ckan/default/src/ckan/datapusher/datapusher/jobs.py", line 300, in push_to_datastore 
    resource = get_resource(resource_id, ckan_url, api_key) 
    File "/usr/lib/ckan/default/src/ckan/datapusher/datapusher/jobs.py", line 250, in get_resource 
    'Authorization': api_key} 
    File "/usr/lib/ckan/default/lib/python2.7/site-packages/requests/api.py", line 87, in post 
    return request('post', url, data=data, **kwargs) 
    File "/usr/lib/ckan/default/lib/python2.7/site-packages/requests/api.py", line 44, in request 
    return session.request(method=method, url=url, **kwargs) 
    File "/usr/lib/ckan/default/lib/python2.7/site-packages/requests/sessions.py", line 279, in request 
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) 
    File "/usr/lib/ckan/default/lib/python2.7/site-packages/requests/sessions.py", line 374, in send 
    r = adapter.send(request, **kwargs) 
    File "/usr/lib/ckan/default/lib/python2.7/site-packages/requests/adapters.py", line 209, in send 
    raise ConnectionError(e) 
ConnectionError: HTTPConnectionPool(host='default.ckan.com', port=80): Max retries exceeded with url: /api/3/action/resource_show (Caused by <class 'socket.error'>: [Errno 111] Connection refused) 

ckan,solr運行良好。帶有8800端口的datapusher正在運行。

$ curl localhost:8800 
{ 
    "help": "\n  Get help at:\n  http://ckan-service-provider.readthedocs.org/." 
} 

我是否缺少我的datapusher的東西? 謝謝。

我說我的ini

cache_dir = /tmp/%(ckan.site_id)s/ 
beaker.session.key = ckan 
beaker.session.secret = CkL+a+Nc6grW1jBM/Ts69mRsE 
app_instance_uuid = {f41a65ac-4a33-44fe-bb03-af15b456978e} 
who.config_file = %(here)s/who.ini 
who.log_level = warning 
who.log_file = %(cache_dir)s/who_log.ini 
sqlalchemy.url = postgresql://ckan_default:[email protected]/ckan_default 
ckan.datastore.write_url = postgresql://ckan_default:[email protected]/datastore_default 
ckan.datastore.read_url = postgresql://datastore_default:[email protected]/datastore_default 
ckan.datastore.default_fts_lang = english 
ckan.datastore.default_fts_index_method = gist 
ckan.site_url = http://ckan.daniel.com 
ckan.auth.anon_create_dataset = false 
ckan.auth.create_unowned_dataset = false 
ckan.auth.create_dataset_if_not_in_organization = false 
ckan.auth.user_create_groups = false 
ckan.auth.user_create_organizations = false 
ckan.auth.user_delete_groups = true 
ckan.auth.user_delete_organizations = true 
ckan.auth.create_user_via_api = false 
ckan.auth.create_user_via_web = true 
ckan.auth.roles_that_cascade_to_sub_groups = admin 
ckan.site_id = default 
solr_url = http://127.0.0.1:8983/solr/ckan 
ckan.plugins = stats text_view image_view recline_view datastore datapusher 
ckan.views.default_views = image_view text_view recline_view 
ckan.site_title = CKAN 
ckan.site_logo = /base/images/ckan-logo.png 
ckan.site_description = 
ckan.favicon = /images/icons/ckan.ico 
ckan.gravatar_default = identicon 
ckan.preview.direct = png jpg gif csv 
ckan.preview.loadable = html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json 
ckan.locale_default = en 
ckan.locale_order = en pt_BR ja it cs_CZ ca es fr el sv sr [email protected] no sk fi ru de pl nl bg ko_KR hu sa sl lv 
ckan.locales_offered = 
ckan.locales_filtered_out = en_GB 
ckan.feeds.authority_name = 
ckan.feeds.date = 
ckan.feeds.author_name = 
ckan.feeds.author_link = 
ckan.storage_path = /usr/lib/ckan/korea/src/ckan/filestore 
ckan.max_resource_size = 10 
ckan.max_image_size = 5 
ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 
ckan.datapusher.url = http://ckan.daniel.com:8800/ 
ckan.hide_activity_from_users = %(ckan.site_id)s 
+0

你可以發佈您的production.ini/development.ini?看起來像ckan.site_url可能是錯誤的。 –

+0

我將我的ini添加到 – Daniel

+1

我通過將端口從5000更改爲80來解決此問題,並以root身份啓動ckan。但我有另一個問題。當我點擊「上傳到數據存儲」時,我可以看到「AttributeError:'模塊'對象沒有屬性'ReadError'」錯誤。 – Daniel

回答

2

正如您在您的評論注意到,問題是的datapusher試圖連接到錯誤的端口

ConnectionError: HTTPConnectionPool(host='default.ckan.com', port=80): Max retries exceeded with url: /api/3/action/resource_show (Caused by : [Errno 111] Connection refused)

你已經找到了可能的解決方法:將CKAN的端口更改爲80.

作爲替代解決方法,我發現添加端口(同一個conf在[server:main]部分配置爲port)至ckan.site_url使得數據壓縮器使用它而不是默認的HTTP端口(80)。所以,你的情況可能是:

ckan.site_url = http://default.ckan.com:5000 

當然,這只是另一種可能的解決方法; 真正的解決方案將修復datapusher,以便它正確地從配置讀取端口...

相關問題