First of all, I will assume that you know how to use pydevd to remote debug normal python program. If you do not know that, you can read the corresponding docs on Pycharm official website.

If you know very well how to remote debug normal python programs and you are trying to remote debug neutron, you can continue.

To remote debug neutron, only three additional things need to be done:

1. Change the worker numbers of neutron api server.

You need to edit /etc/neutron/neutron.conf to set api_worker = -1. Because by default, neutron will start multi-workers.

2. Config your IDE (my case it is PyCharm).

In Pycharm you need to set

File->Build, Extension, Debugger->Python Debuger->Gevent Compatible

3. In neutron code, You need to edit neutron/common/eventlet_utils.py

On the server, the absolute path will be the neutron install location. Like /usr/lib/python2.7/site-packages/neutron/common/eventlet_utils.py

Change the

eventlet.monkey_patch

to

eventlet.monkey_patch(os=False, thread=False)

The reason to do this is very well explained in the code comment

import os

import eventlet

def monkey_patch():
if os.name == 'nt':
# eventlet monkey patching the os and thread modules causes
# subprocess.Popen to fail on Windows when using pipes due
# to missing non-blocking IO support.
#
# bug report on eventlet:
# https://bitbucket.org/eventlet/eventlet/issue/132/
# eventletmonkey_patch-breaks
eventlet.monkey_patch(os=False, thread=False)
else:
eventlet.monkey_patch(os=False, thread=False)

OK now. You can remote debug as you did.

How to remote debug neutron的更多相关文章

  1. iOS web remote debug 正确的姿势

    在使用iOS Remote debug需要做以下准备 1. iOS devices 开启java script and web inspector 开启方式如下: 2. mac OS 自带的Safar ...

  2. Java:Remote Debug

    Java  Remote Debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,add ...

  3. [Reomting Debug] 巧用VS 的remote debug 功能远程调试程序 经验分享.

    前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...

  4. paip. java resin 远程 调试 java resin remote debug

    paip. java resin 远程 调试 java resin remote debug 作者Attilax  艾龙,  EMAIL:1466519819@qq.com 来源:attilax的专栏 ...

  5. How to use VS2012 remote debug Windows Azure Cloud Services

    Background: Windows Azure Cloud Services 可以在本地调试,使用Visual Studio 2012 + 模拟器 Emulator.但是模拟器的工作状态和环境和真 ...

  6. VS 开发工具中的Remote Debug 功能远程调试程序经验分享

    前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...

  7. Tomcat Remote Debug操作和原理

    操作篇 这部分主要讲,如何开启tomcat远程调试,并佐以实例.本文方式适用于windows和linux. 假设有两台机器,A是tomcat服务器所在机器,B是IDE安装机器.A和B可以是同一台机器, ...

  8. vscode local attach 和 remote debug

    VSCode是MS推出的一款免费的开源并跨平台的轻量级代码编辑器,内置Git和Debug等常用功能,强大的插件扩展功能以及简单的配置几乎可以打造成任意编程语言的IDE.本文简单聊一下其本地attach ...

  9. QT Creator 环境使用 remote debug 调试 arm 程序

    这里使用的 4.8.5 QTE 环境,之前尝试过远程使用 GDB 来调试板子上的 QT 程序,但是没成功.没有调试手段比较痛苦,今天又花了点时间,居然搞定了.粗做记录. 工具版本: 1. QtCrea ...

随机推荐

  1. asp IIS网站的配置(Win7下启用IIS7配置ASP运行环境)

    其实win7下的IIS7配置过程是非常简单的.下面让seo博客来详细的介绍一下win7下配置IIS7环境运行ASP网站的方法,以供初接触者参考   第一次在windows7下配置IIS,虽然有丰富的x ...

  2. Log4net快速搭建

    nuget安装log4net 2018.12.10当前版本为2.0.8 找到所在项目的[Properties->AssemblyInfo] 在底部加上 [assembly: log4net.Co ...

  3. COGS.1200 ganggang的烦恼

    背景 Zhang Gangrui 年纪大了,记性不好,保险箱的密码记不住了,他只记得密码是一个数的阶乘各个位的数相加的和,最后还有个T或F,代表这个数是否为素数,正好,你到他家去了,他请你帮他这个忙, ...

  4. Windows bat 设置代理

    转自tt-0411 @echo off cls color 0A Echo The program is running... Echo Setting the ip and dns... netsh ...

  5. 慎将MBTI测试用于招聘或就业:4星|《人格魅力修炼指南》

    人格魅力修炼指南:成为理想中的自己,就靠它了!(<哈佛商业评论>增刊) <哈佛商业评论>的11篇领导者人格魅力相关的文章.比较专业. 一些重要的信息:慎将MBTI测试用于“招聘 ...

  6. Android(java)学习笔记189:ContentProvider使用(银行数据库创建和增删改查的案例)

    1. Android的四大组件: (1)Activity  用户交互的UI界面 (2)Service  后台运行的服务 (3)BroadcastReceiver 广播接收者 (4)ContentPro ...

  7. 学生管理系统之Java+Mysql

    主页面: 代码如下:package appstu.view; import java.awt.BorderLayout;import java.awt.Dimension;import java.aw ...

  8. webgl 的空间变换(下):空间变换

    在网上看了很多关于在三维世界中怎么把一个顶点经过一步步变化,最终呈现在我们的屏幕上的. 其实很多博客或者书籍已经讲的很清楚了,那为什么我还要特别再写一次博客来阐述自己观点呢?(这里只针对那些学习web ...

  9. Spring Cloud练习1

    pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="htt ...

  10. Linux下MySQL 5.7的初始化

    要用管理员账号运行. systemctl start mysql#启动MySQL服务 mysqld_safe --user=mysql &#启动MySQL服务(安全方式) mysql -u r ...