我正在尝试安装ckan 2.2.1 + pgsql 9.1 + solr 3.6 + rhel 6.6。
我设置了文件存储和数据存储插件。我尝试在ckan web中使用“上传到数据存储区”菜单。然后我收到了这个错误。
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:PASS@localhost/ckan_default
ckan.datastore.write_url = postgresql://ckan_default:PASS@localhost/datastore_default
ckan.datastore.read_url = postgresql://datastore_default:PASS@localhost/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 sr@latin 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 :(得分:2)
正如您在评论中注意到的那样,问题是数据传输器正在尝试连接到错误的端口:
ConnectionError:HTTPConnectionPool(host =&#39; default.ckan.com&#39;, port = 80 ):使用url超出最大重试次数:/ api / 3 / action / resource_show(导致通过:[Errno 111]连接拒绝)
您已经找到了一种可行的解决方法:将CKAN的端口更改为80。
作为替代解决方法,我发现将端口(在port
部分中配置了[server:main]
的端口)添加到ckan.site_url
会使数据传输器使用它而不是默认HTTP港口(80)。所以,在你的情况下,它可能是:
ckan.site_url = http://default.ckan.com:5000
当然,这只是另一种可行的解决方法; 真正的解决方案是修复datapusher,以便它从配置中正确读取端口...