[Go] Use Eclipse+pydev to remotely debug OpenStack

Source: Internet
Author: User

Zhang Hua posted: 2014-01-17
Copyright notice: Can be reproduced arbitrarily, please be sure to use hyperlinks in the form of the original source of the article and the author's information and this copyright notice (http://blog.csdn.net/quqi99)

1, for the WSGI web app to be debugged remotely, add the following code, where 172.16.1.122 is the IP address of the remote installation of the Eclipse machine.
Import PYDEVD
Pydevd.settrace (' 172.16.1.122 ', 1234, Stdouttoserver=false, Stderrtoserver=false)
If you use Monkey_patch, remember to set thread to Flase, Eventlet.monkey_patch (Os=false, Thread=false)

For example, if we want to debug Nova-compute, we can start the service as follows, it will automatically do as above set
Nova-compute--remote_debug-host 172.16.1.122--remote_debug-port 1234

2, Eclipse end, set environment variables first
Import Sys
Sys.path.append ('/bak/java/eclipse/plugins/org.python.pydev_3.1.0.201312121632/pysrc/')
Or:
Export pythonpath=/bak/java/eclipse/plugins/org.python.pydev_3.1.0.201312121632/pysrc/: $PYTHONPATH
or add a external Libraries in the Pydev-pythonpath of the properties of the Eclipse engineering point right-hand side, either way.

3,eclipse side, next to ensure that the eclipse side also has the same code, if in different directories, you can use modify/bak/java/eclipse/plugins/org.python.pydev_3.1.0.201312121632/ pysrc/pydevd_file_utils.py file:
Paths_from_eclipse_to_python = [(R '/bak/openstack ', R '/server_side/openstack ')]

4, after starting the remote Nova-compute service (after Pydevd.settrace), in the local eclipse into the "Debug" view will see a "Pydev:start the PyDev Server" button and then click on it, At this point eclipse is connected to the remote.
The rest of the set breakpoint set breakpoint, usually what to do on the How to do.

Reference:
Http://pydev.org/manual_adv_remote_debugger.html

Transferred from: http://blog.csdn.net/quqi99/article/details/18404807

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.