analytics安装出错

各位好,目前在尝试安装analytics,单机版的,采用https://openedx.atlassian.net/wiki/display/OpenOPS/edX+Analytics+Installation 上的方法进行安装。目前安装进行到insights时报错,具体的报错信息如下:
TASK: [insights | create nodeenv] *********************************************
failed:
[localhost] => {“changed”: true, “cmd”:
"/edx/app/insights/venvs/insights/bin/nodeenv
/edx/app/insights/nodeenvs/insights --prebuilt", “delta”:
“0:08:19.337507”, “end”: “2016-01-06 10:55:19.524042”, “rc”: 1, “start”:
“2016-01-06 10:47:00.186535”, “warnings”: []}
stderr: Traceback (most recent call last):
File “/edx/app/insights/venvs/insights/bin/nodeenv”, line 11, in sys.exit(main())
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/nodeenv.py”, line 874, in main
opt.node = get_last_stable_node_version()

File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/nodeenv.py”, line 812, in get_last_stable_node_version
response = urlopen(‘https://%s/dist/latest/’ % (src_domain))
File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “/usr/lib/python2.7/urllib2.py”, line 431, in open response = self._open(req, data)
File “/usr/lib/python2.7/urllib2.py”, line 449, in _open ‘_open’, req)
File “/usr/lib/python2.7/urllib2.py”, line 409, in _call_chain result = func(*args)
File “/usr/lib/python2.7/urllib2.py”, line 1240, in https_open context=self._context)
File “/usr/lib/python2.7/urllib2.py”, line 1197, in do_open raise URLError(err)
urllib2.URLError: urlopen error [Errno 104] Connection reset by peer

FATAL: all hosts have already failed – aborting

还希望得到各位高人的指点。

在这之前也遇到过一些错误,现就一些错误总结如下:
1.sudo via ansible. 修改sudo免密码输入;或者在命令行最后加上–ask-sudo-pass
2.apt is not a legal parameter in an Ansible task or handler.这个错误基本是因为pip版本过低导致,升级过后正常。
3.openssl_md_meth_names 错误。还是pip版本的问题。
4.其他问题,网络被墙,解决之后即可。
5.还有一些问题基本就是看哪一步出错,然后进configuration看配置。

全局翻墙安装

网络解决之后,安装成功!接下来看配置。

基本上参考https://openedx.atlassian.net/wiki/display/OpenOPS/edX+Analytics+Installation 以及google group的相关帖子就能够配置上。有问题你在这里提出。

谢谢Josh!
今天尝试了配置,运行remote-task后出现permission denied错误,查找groups无果。具体错误如下:

具体的步骤是参考atlassian链接上的,
我理解的analytics分为三部分,pipeline,api,dashboard。难点在于pipeline,使用hadoop,hive,sqoop来处理数据,数据的来源是lms的mysql 和 tracking log。然后经hadoop将计算统计好的数据输出到analytics本地数据库,最后api和dashboard负责将数据以页面的形式呈现。
所以,配置上应该分为两部分。
第一,pipeline连接lms端的数据库(我的analytics和lms分别在两台不同的机器上),已将lms端的key复制到analytics机器上,同时lms端的mysql设置权限给analytics。
第二,dashboard和lms端设置oauth2通信。
不知是否理解有误,还是需要有注意的地方?

再者,还有一个问题:若lms端地址改变,是否要重新运行ansibel-playbook呢,还是修改insights.yml配置文件就好,这个我还没尝试。

第一,命令本身有错,要用正确的用户名。

若lms端地址改变,需要改变配置文件,analytics_dashboard/settings/base.py。然后重启服务
sudo /edx/bin/supervisorctl restart insights

成功通过lms端认证,跳转到dashboard时又报以下错误:
Jan 12 09:17:36 edx [service_variant=insights][django.request][env:no_env] ERROR [edx 7646] [base.py:231] - Internal Server Error: /complete/edx-oidc/
Traceback (most recent call last):
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/core/handlers/base.py”, line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/decorators/cache.py”, line 52, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/decorators/csrf.py”, line 57, in wrapped_view
return view_func(*args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/apps/django_app/utils.py”, line 52, in wrapper
return func(request, backend, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/apps/django_app/views.py”, line 28, in complete
redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/actions.py”, line 40, in do_complete
user = backend.complete(user=user, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/base.py”, line 40, in complete
return self.auth_complete(*args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/auth_backends/backends.py”, line 58, in auth_complete
user = super(EdXOpenIdConnect, self).auth_complete(*args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/oauth.py”, line 368, in auth_complete
method=self.ACCESS_TOKEN_METHOD
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/open_id.py”, line 361, in request_access_token
self.id_token = self.validate_and_return_id_token(response[‘id_token’])
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/open_id.py”, line 336, in validate_and_return_id_token
raise AuthTokenError(self, err)
AuthTokenError: Token error: Signature verification failed

按照google讨论组设置过两端的时间,已经一致了还这样。。还有一种错是AuthCanceled: Authentication process canceled
两个错误交替出现,不定时出现。
https://groups.google.com/forum/#!topic/openedx-ops/rcda7xp7s1c
https://groups.google.com/forum/#!topicsearchin/openedx-ops/AuthCanceled$3A$20Authentication$20process$20canceled/openedx-ops/7JAPqYMLKh4

参考配置:

https://openedx.atlassian.net/wiki/pages/viewpage.action?spaceKey=AN&title=Configuring+Insights+for+Open+ID+Connect+SSO+with+LMS

Nice job

修改配置不需要重新运行ansible。改yml即可。

两边的时间确实有一个google讨论贴说过,所以你需要设置两遍的ntpserver。

根据你的log来看,应该还是验证错误。inSight的配置文件中关于key和secret有很多个字段混淆,你可以多试试。

再次仔细检查了配置,成功了!
进入具体的课程下面的具体项时,又出现500error了。:flushed:
报错如下:
Jan 13 15:59:52 edx [service_variant=insights][django.request][env:no_env] ERROR [edx 25237] [base.py:231] - Internal Server Error: /courses/edX/DemoX/Demo_Course/engagement/content/
Traceback (most recent call last):
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/core/handlers/base.py”, line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/generic/base.py”, line 69, in view
return self.dispatch(request, *args, **kwargs)
File “/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/courses/views/init.py”, line 61, in dispatch
return super(CourseAPIMixin, self).dispatch(request, *args, **kwargs)
File “/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/courses/views/init.py”, line 397, in dispatch
return super(CourseView, self).dispatch(request, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/braces/views.py”, line 107, in dispatch
request, *args, **kwargs)
File “/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/courses/views/init.py”, line 236, in dispatch
return super(CourseValidMixin, self).dispatch(request, *args, **kwargs)
File “/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/courses/views/init.py”, line 252, in dispatch
return super(CoursePermissionMixin, self).dispatch(request, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/generic/base.py”, line 87, in dispatch
return handler(request, *args, **kwargs)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/generic/base.py”, line 154, in get
context = self.get_context_data(**kwargs)
File “/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/courses/views/engagement.py”, line 49, in get_context_data
summary, trends = self.presenter.get_summary_and_trend_data()
File “/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/courses/presenters/engagement.py”, line 127, in get_summary_and_trend_data
api_trends = self.course.activity(start_date=None, end_date=end_date)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/analyticsclient/course.py”, line 83, in activity
return self.client.get(path, data_format=data_format)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/analyticsclient/client.py”, line 62, in get
response = self._request(resource, timeout=timeout, data_format=data_format)
File “/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/analyticsclient/client.py”, line 140, in _request
raise ClientError(’{0} “{1}”’.format(message, resource))
ClientError: Unable to retrieve resource “courses/edX/DemoX/Demo_Course/activity/?end_date=2016-01-14&activity_type=any”

继续看问题所在。

500 error就是没有数据导致。你可以检查一下mysql里面有没有运算结果。

Powered by eduStack & ifLab