gpt4 book ai didi

python - ckan datapusher/api/3/action/resource_show(由 : [Errno 111] Connection refused) error 引起

转载 作者:行者123 更新时间:2023-11-28 17:25:08 44 4
gpt4 key购买 nike

我正在尝试安装 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 端口的数据推送器正在运行。

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

我的数据推送器是否遗漏了什么?谢谢。

我添加了我的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

最佳答案

正如您在评论中注意到的,问题是数据推送器试图连接到错误的端口:

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。

作为替代解决方法,我发现将端口(与 [server:main] 部分中的 port 配置的端口相同)添加到 ckan。 site_url 使数据推送器使用它而不是默认的 HTTP 端口 (80)。因此,在您的情况下可能是:

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

当然,这只是另一种可能的解决方法; 真正的解决方案是修复数据推送器,以便它从配置中正确读取端口...

关于python - ckan datapusher/api/3/action/resource_show(由 <class 'socket.error' > : [Errno 111] Connection refused) error 引起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39663415/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com