{"id":34811,"date":"2023-06-05T18:53:50","date_gmt":"2023-10-08T13:16:25","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/"},"modified":"2024-04-30T07:27:18","modified_gmt":"2024-04-29T23:27:18","slug":"%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/","title":{"rendered":"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e"},"content":{"rendered":"<p>\u6a31\u82b1VPS\u7684\u8bd5\u7528\u671f\u4e3a\u4e24\u5468\uff0c\u4f46\u6211\u8fd8\u65e0\u6cd5\u5c06\u7a0b\u5e8f\u5e38\u9a7b\u3002<\/p>\n<p>\u3067\u3001\u3055\u3063\u3055\u3068\u6700\u512a\u5148\u3067\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5e38\u99d0\u3000\u304c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3000\u8abf\u3079\u305f\u65b9\u304c\u3044\u3044\u3068\u601d\u3046\u3093\u3060\u304c\u3001<br \/>\n\u305d\u306e\u4ed6\u306e\u53ef\u80fd\u6027\u3092\u6f70\u3057\u3066\u3044\u304f\u306e\u306b\u3000\u8a18\u4e8b\uff1c\u305d\u306e\uff11\uff1e\uff5e\uff1c\u305d\u306e\uff15\uff1e\u3000\u307e\u3067\u304b\u304b\u3063\u305f\u3002<\/p>\n<p>\u4e0a\u4e00\u7bc7\u6587\u7ae0\uff1ahttp:\/\/qiita.com\/muzudho1\/items\/8f940f8b4c679c23a174<\/p>\n<h1>\u6211\u60f3\u505a\u7684\u4e8b\u60c5 (w\u01d2 zu\u00f2 de<\/h1>\n<p>\u7b2c\u4e8c\u8ba1\u5212<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u5c06\u68cb\u30d7\u30ed\u30b0\u30e9\u30e0\u3000\u3092\u5e38\u99d0\u3055\u305b\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30d6\u30e9\u30a6\u30b6\u3067\u306e\u30da\u30fc\u30b8\u30fb\u30a2\u30af\u30bb\u30b9\u306e\u5ea6\u306bPHP\u306f\u3000\u6307\u3057\u624b\u30d6\u30ed\u30fc\u30ab\u30fc\u4e09\u6cb3\u5c4b\u3000\u3092\u8d77\u52d5\u3057\u3066\u3001\u30ad\u30e5\u30fc\u5f85\u3061\u3000\u3055\u305b\u3001\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u5c06\u68cb\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3000\u6307\u3057\u624b\u306e\u304a\u4f3a\u3044\u3092\u7acb\u3066\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">PHP\u306f\u3001\u6307\u3057\u624b\u30d6\u30ed\u30fc\u30ab\u30fc\u4e09\u6cb3\u5c4b\u3000\u304c\u6301\u3063\u3066\u304d\u305f\u6307\u3057\u624b\u3092\u3000PHP\u3067\u51fa\u529b\u3059\u308b<\/ul>\n<p>\u8ba1\u5212\u4e00<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u5c06\u68cb\u30d7\u30ed\u30b0\u30e9\u30e0\u3000\u3092\u5e38\u99d0\u3055\u305b\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b2\u30fc\u30e0\u30b5\u30fc\u30d0\u30fc\u3000\u3092\u5e38\u99d0\u3055\u305b\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b2\u30fc\u30e0\u30b5\u30fc\u30d0\u30fc\u306f\u3000\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u5c06\u68cb\u30d7\u30ed\u30b0\u30e9\u30e0\u3000\u3068\u5c40\u9762\u691c\u8a0e\u304c\u3067\u304d\u308b\u3082\u306e\u3068\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30d6\u30e9\u30a6\u30b6\u3067\u306e\u30da\u30fc\u30b8\u30fb\u30a2\u30af\u30bb\u30b9\u306e\u5ea6\u306bPHP\u306f\u3000\u7121\u9650\u30eb\u30fc\u30d7\u306b\u5165\u308a\u3000\u30b2\u30fc\u30e0\u30b5\u30fc\u30d0\u30fc\u306b\u30d7\u30ed\u30bb\u30b9\u9593\u901a\u4fe1\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u306b\u6307\u3057\u624b\u304c\u5165\u3063\u3066\u3044\u308c\u3070\u3000\u7121\u9650\u30eb\u30fc\u30d7\u3092\u51fa\u3066\u3000\u6307\u3057\u624b\u3092 PHP\u3067\u51fa\u529b\u3059\u308b<\/ul>\n<p>\u3067\u3001\u30d7\u30e9\u30f3\uff11\u306f\u3000\u305d\u308c\u304c\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u8a71\u3057\u304c\u3000\u3048\u3093\u3048\u3093\u3068\u3000\u8a18\u4e8b\uff1c\u305d\u306e\uff11\uff1e\uff5e\uff1c\u305d\u306e\uff13\uff1e\u3000\u3050\u3089\u3044\u306b\u66f8\u3044\u3066\u3042\u3063\u305f\u306e\u3060\u3063\u305f\u3002<\/p>\n<p>\u6b8b\u3063\u3066\u308b\u306e\u306f\u3000\u30d7\u30e9\u30f3\uff12\u3002<\/p>\n<p>\u8abf\u3079\u3066\u307f\u308b\u3002<\/p>\n<h1>\u8ba1\u7b97\u673a\u5c06\u65e0\u6cd5\u5e38\u9a7b\u5c06\u68cb\u7a0b\u5e8f\u3002<\/h1>\n<p>PuTTY\u3067\u9060\u9694\u30ed\u30b0\u30a4\u30f3\u3057\u3001PHP\u3067\u7121\u9650\u30eb\u30fc\u30d7\u3092\u66f8\u3044\u3066\u3000\u30d0\u30c3\u30af\u30b0\u30e9\u30f3\u30c9\u5b9f\u884c\u3057\u3066\u3082\u3000\u30ed\u30b0\u30a2\u30a6\u30c8\u3059\u308b\u3068\u3000\u30b8\u30e7\u30d6\u306f\u6d88\u3048\u3066\u3057\u307e\u3046\u3002<\/p>\n<p>\u305d\u3053\u3067 Cron \u3092\u4f7f\u3063\u3066\u3000\u7121\u9650\u30eb\u30fc\u30d7PHP\u3000\u3092\u5b9f\u884c\u3059\u308b\u3093\u3060\u304c\u3001\u3059\u3050\u3000S \uff08\u505c\u6b62\uff09\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>Apache \u306f\u5e38\u99d0\u3057\u3066\u3044\u308b\u3002<br \/>\nPuTTY \u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u30fb\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u3082 \u30d6\u30e9\u30a6\u30b6\u3067 http:\/\/\u2605.\u2605.\u2605.\u2605\/index.php \u3068\u3067\u3082\u6253\u3066\u3070\u753b\u9762\u306f\u51fa\u3066\u304f\u308b\u3002<\/p>\n<p>\u5e38\u99d0\u306f\u3067\u304d\u308b\u3088\u3046\u3060\u3002<br \/>\n\u3069\u3046\u3084\u3063\u3066\u5e38\u99d0\u3059\u308b\u306e\u304b\u3002<\/p>\n<p>Windows 10 \u3060\u3068 \u30bf\u30b9\u30af\u30d0\u30fc\u306e\u300c\u4f55\u3067\u3082\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u300d\u3068\u66f8\u3044\u3066\u3042\u308b\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306b \u300c\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u306e\u7ba1\u7406\u300d\u3068\u6253\u3061\u8fbc\u3093\u3067 [\u30b5\u30fc\u30d3\u30b9\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3] &#8211; [\u30b5\u30fc\u30d3\u30b9]\u3000\u3068\u9032\u3093\u3067\u3044\u3051\u3070\u3001\u5e38\u99d0\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u89a7\u304c\u51fa\u3066\u304f\u308b\u3002<\/p>\n<p>Ubuntu16.04 \u3060\u3068<\/p>\n<pre class=\"post-pre\"><code>ps aux\r\n<\/code><\/pre>\n<p>\u3068\u6253\u3061\u8fbc\u3081\u3070\u3000\u30d7\u30ed\u30bb\u30b9\u306e\u4e00\u89a7\u304c\u898b\u308c\u308b\u3093\u3060\u304c\u3001\u3053\u308c\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4e00\u89a7\u3067\u306f\u306a\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep apache\r\n<\/code><\/pre>\n<p>\u8f93\u5165&#8221;\u3068&#8221;\u7684\u8bdd\uff0c\u4f8b\u5982<\/p>\n<pre class=\"post-pre\"><code>www-data  2776  0.0  0.2 352548  2496 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nroot     11959  0.0  0.0 351884    76 ?        Ss   Mar07   0:34 \/usr\/sbin\/apache2 -k start\r\nwww-data 11965  0.0  0.0 352296   148 ?        S    Mar07   0:14 \/usr\/sbin\/apache2 -k start\r\nroot     19418  0.0  0.0  12936   980 pts\/2    S+   03:16   0:00 grep --color=auto apache\r\nwww-data 29283  0.0  0.1 352164  2004 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29284  0.0  0.0 352164   556 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29285  0.0  0.1 352164  1944 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29286  0.0  0.0 352164     0 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29287  0.0  0.1 352164  1776 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29318  0.0  0.2 352164  2508 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 31812  0.0  0.1 352164  1116 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\n<\/code><\/pre>\n<p>\u3068\u51fa\u3066\u304d\u3066\u3001\u3053\u306e\u3046\u3061\u300ccolor=auto apache\u300d\u3068\u3044\u3046\u306e\u306f apache\u306e\u6587\u5b57\u8272\u3092\u8d64\u8272\u306b\u3057\u307e\u3057\u3087\u3046\u3001\u3068\u3044\u3046\u4eca\u53e9\u3044\u305f\u3070\u304b\u308a\u306e\u30b3\u30de\u30f3\u30c9\u3060\u304b\u3089\u7121\u8996\u3059\u308b\u3068\u3057\u3066\u3001<\/p>\n<p>\u542f\u52a8Apache2\u7684\u547d\u4ee4\u662f\/usr\/sbin\/apache2 -k start\u3002<\/p>\n<p>\u901a\u8fc7\u6b64\u547d\u4ee4\u53ef\u4ee5\u786e\u5b9a\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002<\/p>\n<p>\u7136\u800c\u4ed4\u7ec6\u770b\uff0c\u5927\u5bb6\u90fd\u662fS\u578b\u7684\u5462\u3002<\/p>\n<pre class=\"post-pre\"><code>www-data 15221  197 27.6 712928 281056 pts\/3   Rsl+ Mar09 458:47 .\/release\r\n<\/code><\/pre>\n<p>\u3053\u308c\u306a\u3093\u304b\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3000\u53e9\u304d\u8d77\u3053\u3057\u305f\u3000\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u5c06\u68cb\u30bd\u30d5\u30c8\u306e\u3000\u6280\u5de7\u3000\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306a\u3093\u3058\u3083\u306a\u3044\u304b\uff1f<\/p>\n<p>Rsl+ \u662f\u4ec0\u4e48\u60c5\u51b5\uff1f<\/p>\n<p>\u300cps\u547d\u4ee4\u6458\u8981\u300d\uff08Qiita\uff09<br \/>\nhttp:\/\/qiita.com\/shell\/items\/68ed71a7f018e5688f73<\/p>\n<p>\u300cS\u300d\u4e0d\u662f\u505c\u6b62\u800c\u662f\u7761\u7720\u55ce\u2026\u2026\u3002<\/p>\n<pre class=\"post-pre\"><code># kill 15221\r\n<\/code><\/pre>\n<p>\u90a3\u5c31\u662f\u8bf4\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux\r\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\r\nroot         1  0.0  0.1  37448  1872 ?        Ss   Mar04   0:56 \/lib\/systemd\/systemd --system --deserialize 19\r\nroot         2  0.0  0.0      0     0 ?        S    Mar04   0:00 [kthreadd]\r\nroot         3  0.0  0.0      0     0 ?        S    Mar04   0:03 [ksoftirqd\/0]\r\nroot         5  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kworker\/0:0H]\r\nroot         7  0.0  0.0      0     0 ?        S    Mar04   1:52 [rcu_sched]\r\nroot         8  0.0  0.0      0     0 ?        S    Mar04   2:16 [rcuos\/0]\r\nroot         9  0.0  0.0      0     0 ?        S    Mar04   0:18 [rcuos\/1]\r\nroot        10  0.0  0.0      0     0 ?        S    Mar04   0:00 [rcu_bh]\r\nroot        11  0.0  0.0      0     0 ?        S    Mar04   0:00 [rcuob\/0]\r\nroot        12  0.0  0.0      0     0 ?        S    Mar04   0:00 [rcuob\/1]\r\nroot        13  0.0  0.0      0     0 ?        S    Mar04   0:05 [migration\/0]\r\nroot        14  0.0  0.0      0     0 ?        S    Mar04   0:10 [watchdog\/0]\r\nroot        15  0.0  0.0      0     0 ?        S    Mar04   0:07 [watchdog\/1]\r\nroot        16  0.0  0.0      0     0 ?        S    Mar04   0:01 [migration\/1]\r\nroot        17  0.0  0.0      0     0 ?        S    Mar04   0:01 [ksoftirqd\/1]\r\nroot        19  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kworker\/1:0H]\r\nroot        20  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [khelper]\r\nroot        21  0.0  0.0      0     0 ?        S    Mar04   0:00 [kdevtmpfs]\r\nroot        22  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [netns]\r\nroot        23  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [writeback]\r\nroot        24  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kintegrityd]\r\nroot        25  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [bioset]\r\nroot        27  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kblockd]\r\nroot        28  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [ata_sff]\r\nroot        29  0.0  0.0      0     0 ?        S    Mar04   0:00 [khubd]\r\nroot        30  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [md]\r\nroot        31  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [devfreq_wq]\r\nroot        35  0.0  0.0      0     0 ?        S    Mar04   0:02 [khungtaskd]\r\nroot        36  0.0  0.0      0     0 ?        S    Mar04   3:27 [kswapd0]\r\nroot        37  0.0  0.0      0     0 ?        SN   Mar04   0:00 [ksmd]\r\nroot        38  0.0  0.0      0     0 ?        SN   Mar04   0:11 [khugepaged]\r\nroot        39  0.0  0.0      0     0 ?        S    Mar04   0:00 [fsnotify_mark]\r\nroot        40  0.0  0.0      0     0 ?        S    Mar04   0:00 [ecryptfs-kthrea]\r\nroot        41  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [crypto]\r\nroot        53  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kthrotld]\r\nroot        55  0.0  0.0      0     0 ?        S    Mar04   0:00 [vballoon]\r\nroot        56  0.0  0.0      0     0 ?        S    Mar04   0:00 [scsi_eh_0]\r\nroot        57  0.0  0.0      0     0 ?        S    Mar04   0:00 [scsi_eh_1]\r\nroot        77  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [deferwq]\r\nroot        78  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [charger_manager]\r\nroot       115  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kpsmoused]\r\nroot       141  0.0  0.0      0     0 ?        S    Mar04   0:36 [jbd2\/vda1-8]\r\nroot       142  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [ext4-rsv-conver]\r\nroot       185  0.0  0.0  29480  1012 ?        Ss   Mar04   0:47 \/lib\/systemd\/systemd-journald\r\nroot       196  0.0  0.0      0     0 ?        S    Mar04   0:00 [kauditd]\r\nroot       234  0.0  0.0  43808     8 ?        Ss   Mar04   0:03 \/lib\/systemd\/systemd-udevd\r\nsystemd+   417  0.0  0.0 100316    60 ?        Ssl  Mar04   0:03 \/lib\/systemd\/systemd-timesyncd\r\nsyslog     443  0.0  0.0 256388   376 ?        Ssl  Mar04   0:39 \/usr\/sbin\/rsyslogd -n\r\nroot       453  0.0  0.0  29872     4 ?        Ss   Mar04   0:00 \/sbin\/cgmanager -m name=systemd\r\nroot       469  0.0  0.0 232308   236 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot       488  0.0  0.0      0     0 ?        S&lt;   Mar04   0:00 [kvm-irqfd-clean]\r\nroot       490  0.0  0.1 274560  1356 ?        Ssl  Mar04   1:03 \/usr\/lib\/accountsservice\/accounts-daemon\r\nroot       494  0.0  0.0  28540   880 ?        Ss   Mar04   0:13 \/lib\/systemd\/systemd-logind\r\nmessage+   515  0.0  0.0  43020   636 ?        Ss   Mar04   0:22 \/usr\/bin\/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-a\r\nroot       551  0.0  0.0  19592   304 ?        Ss   Mar04   0:56 \/usr\/sbin\/irqbalance --pid=\/var\/run\/irqbalance.pid\r\nroot       709  0.0  0.0  65512   332 ?        Ss   Mar04   0:04 \/usr\/sbin\/sshd -D\r\nmemcache   714  0.0  0.0 340888   540 ?        Ssl  Mar04   1:32 \/usr\/bin\/memcached -m 64 -p 11211 -u memcache -l 160.16.83.155\r\nmysql      715  0.1  0.0 1302112    0 ?        Ssl  Mar04  11:35 \/usr\/sbin\/mysqld\r\nroot       757  0.0  0.0  14468     0 ttyS0    Ss+  Mar04   0:00 \/sbin\/agetty --keep-baud 115200 38400 9600 ttyS0 vt220\r\nroot       758  0.0  0.0  14652     0 tty1     Ss+  Mar04   0:00 \/sbin\/agetty --noclear tty1 linux\r\nroot      1878  0.0  0.0 232308   108 ?        S    Mar09   0:03 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nwww-data  2776  0.0  0.2 352548  2496 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nroot      2866  0.0  0.0      0     0 ?        S    Mar07   0:00 [kworker\/0:2]\r\nroot      2957  0.0  0.0 232308    40 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      4784  0.0  0.0 232308    92 ?        S    Mar09   0:03 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      4945  0.0  0.0 232308   104 ?        S    Mar08   0:09 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      5693  0.0  0.0      0     0 ?        S    Mar07   0:49 [kworker\/0:0]\r\nroot      5916  0.0  0.0 232308   172 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      6091  0.0  0.0 311040   312 ?        Ss   Mar07   0:49 php-fpm: master process (\/etc\/php\/7.0\/fpm\/php-fpm.conf)\r\nwww-data  6094  0.0  0.0 311040     0 ?        S    Mar07   0:00 php-fpm: pool www\r\nwww-data  6095  0.0  0.0 311040     0 ?        S    Mar07   0:00 php-fpm: pool www\r\nroot      6301  0.0  0.0 232308   260 ?        S    Mar08   0:10 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      6856  0.0  0.0 232308   112 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      7280  0.0  0.0      0     0 ?        S    Mar07   0:18 [kworker\/1:1]\r\nroot      7795  0.0  0.0 232308   112 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      8303  0.0  0.0 232308   132 ?        S    Mar08   0:09 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      8732  0.0  0.0 232308   132 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      9246  0.0  0.0 232308    80 ?        S    Mar08   0:09 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      9664  0.0  0.0 232308   272 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     10278  0.0  0.0 232308    52 ?        S    Mar08   0:08 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     10632  0.0  0.0 232308   124 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     11364  0.0  0.0 232308   276 ?        S    Mar08   0:08 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     11567  0.0  0.0 232308    72 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     11959  0.0  0.0 351884    76 ?        Ss   Mar07   0:34 \/usr\/sbin\/apache2 -k start\r\nwww-data 11965  0.0  0.0 352296   148 ?        S    Mar07   0:14 \/usr\/sbin\/apache2 -k start\r\nroot     12122  0.0  0.0   4500     0 ?        S    Mar07   0:00 \/bin\/sh \/usr\/sbin\/rabbitmq-server\r\nroot     12129  0.0  0.0  55128     0 ?        S    Mar07   0:00 su rabbitmq -s \/bin\/sh -c \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 12130  0.0  0.0   4500     8 ?        Ss   Mar07   0:00 sh -c \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 12131  0.0  0.0   4500     0 ?        S    Mar07   0:00 \/bin\/sh -e \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 12237  0.6  1.8 2812192 19272 ?       Sl   Mar07  25:13 \/usr\/lib\/erlang\/erts-8.1\/bin\/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -\r\nrabbitmq 12333  0.0  0.0   4356    72 ?        Ss   Mar07   0:16 erl_child_setup 1024\r\nrabbitmq 12343  0.0  0.0  13676    36 ?        Ss   Mar07   0:00 inet_gethost 4\r\nrabbitmq 12344  0.0  0.0  15796   228 ?        S    Mar07   0:01 inet_gethost 4\r\nroot     12376  0.0  0.0 232308    76 ?        S    Mar08   0:08 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     12582  0.0  0.0 232308   164 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     12714  0.0  0.0  99616   332 ?        Ss   Mar09   0:00 sshd: \u2605user [priv]\r\n\u2605user    12738  0.0  0.0  99616   524 ?        S    Mar09   0:01 sshd: \u2605user@pts\/2\r\n\u2605user    12742  0.0  0.0  21484     0 pts\/2    Ss   Mar09   0:00 -bash\r\nroot     12760  0.0  0.0  55780     4 pts\/2    S    Mar09   0:00 sudo su -\r\nroot     12761  0.0  0.0  55128     0 pts\/2    S    Mar09   0:00 su -\r\nroot     12762  0.0  0.1  21508  1348 pts\/2    S    Mar09   0:00 -su\r\nroot     13304  0.0  0.0 232308   180 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     13713  0.0  0.0 232308    72 ?        S    Mar09   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     14237  0.0  0.0 232308   100 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     14600  0.0  0.0  99528   164 ?        Ss   Mar09   0:00 sshd: \u2605user [priv]\r\n\u2605user    14616  0.0  0.0  99528   584 ?        S    Mar09   0:00 sshd: \u2605user@notty\r\n\u2605user    14617  0.0  0.0  12876   256 ?        Ss   Mar09   0:00 \/usr\/lib\/openssh\/sftp-server\r\nroot     14706  0.0  0.0 232308   136 ?        S    Mar09   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     15183  0.0  0.0 232308   204 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     15608  0.0  0.0      0     0 ?        S    Mar09   0:00 [kworker\/u4:2]\r\nroot     15780  0.0  0.0      0     0 ?        S    00:04   0:00 [kworker\/u4:0]\r\nroot     15791  0.0  0.0 232308    80 ?        S    00:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     16115  0.0  0.0 232308    80 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     16778  0.0  0.0 232308    60 ?        S    01:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     17059  0.0  0.0 232308    76 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     17726  0.0  0.0      0     0 ?        S&lt;   02:00   0:00 [kworker\/u5:2]\r\nroot     17967  0.0  0.0 232308   256 ?        S    02:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     17993  0.0  0.0 232308   252 ?        S    Mar08   0:06 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     18025  0.0  0.0      0     0 ?        S&lt;   02:07   0:00 [kworker\/u5:0]\r\nroot     18398  0.0  0.0      0     0 ?        S    02:24   0:00 [kworker\/1:0]\r\nroot     19047  0.0  0.0 232308    76 ?        S    Mar08   0:06 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     19194  0.0  1.3 232308 14048 ?        S    03:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     19518  0.0  0.0   6004   632 ?        S    03:23   0:00 sleep 1m\r\nroot     19529  0.0  0.1  36076  1700 pts\/2    R+   03:24   0:00 ps aux\r\nroot     20097  0.0  0.0 232308   212 ?        S    Mar08   0:06 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     21104  0.0  0.0 232308   224 ?        S    Mar08   0:05 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     22197  0.0  0.0 232308   264 ?        S    Mar09   0:05 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     22468  0.0  0.0  11332   556 ?        S    Mar07   0:04 \/bin\/bash .\/loop8.sh\r\n\u2605user    22666  0.0  0.0  45240     0 ?        Ss   Mar06   0:00 \/lib\/systemd\/systemd --user\r\n\u2605user    22667  0.0  0.0  63256     4 ?        S    Mar06   0:00 (sd-pam)\r\nroot     23284  0.0  0.0 232308    96 ?        S    Mar09   0:05 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     24410  0.0  0.0 232308   192 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     25393  0.0  0.0 232308   196 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     26650  0.0  0.0 232308   232 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nrabbitmq 27670  0.0  0.0  13848    64 ?        S    Mar06   0:11 \/usr\/lib\/erlang\/erts-8.1\/bin\/epmd -daemon\r\nroot     27756  0.0  0.0 232308   228 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     28734  0.0  0.0 232308   128 ?        S    Mar09   0:03 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nwww-data 29283  0.0  0.1 352164  2004 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29284  0.0  0.1 352164  1300 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29285  0.0  0.1 352164  1944 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29286  0.0  0.1 352556  1956 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29287  0.0  0.1 352164  1776 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nwww-data 29318  0.0  0.2 352164  2508 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nroot     29957  0.0  0.0 232308    84 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     30931  0.0  0.0 232308    40 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     31317  0.0  0.0  27720   300 ?        Ss   Mar08   0:02 \/usr\/sbin\/cron -f\r\nwww-data 31812  0.0  0.1 352164  1116 ?        S    Mar09   0:00 \/usr\/sbin\/apache2 -k start\r\nroot     31947  0.0  0.0 232308   180 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\n<\/code><\/pre>\n<p>\u3088\u304f\u898b\u308b\u3068 dequeueBroker.php \u304c\u3000\u305f\u304f\u3055\u3093\u3000\u5e38\u99d0\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u5514\uff0c\u8981\u4e0d\u8981\u5c1d\u8bd5\u4e00\u6b21\u5c06 dequeueBroker.php \u5168\u90e8_kill\u6389\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep dequeueBroker.php\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>root       469  0.0  0.0 232308   236 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      1878  0.0  0.0 232308   108 ?        S    Mar09   0:03 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      2957  0.0  0.0 232308    40 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      4784  0.0  0.0 232308    92 ?        S    Mar09   0:03 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      4945  0.0  0.0 232308   104 ?        S    Mar08   0:09 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      5916  0.0  0.0 232308   172 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      6301  0.0  0.0 232308   260 ?        S    Mar08   0:10 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      6856  0.0  0.0 232308   112 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      7795  0.0  0.0 232308   112 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      8303  0.0  0.0 232308   132 ?        S    Mar08   0:09 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      8732  0.0  0.0 232308   132 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      9246  0.0  0.0 232308    80 ?        S    Mar08   0:09 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot      9664  0.0  0.0 232308   272 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     10278  0.0  0.0 232308    52 ?        S    Mar08   0:08 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     10632  0.0  0.0 232308   124 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     11364  0.0  0.0 232308   276 ?        S    Mar08   0:08 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     11567  0.0  0.0 232308    72 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     12376  0.0  0.0 232308    76 ?        S    Mar08   0:08 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     12582  0.0  0.0 232308   164 ?        S    Mar09   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     13304  0.0  0.0 232308   180 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     13713  0.0  0.0 232308    72 ?        S    Mar09   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     14237  0.0  0.0 232308   100 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     14706  0.0  0.0 232308   136 ?        S    Mar09   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     15183  0.0  0.0 232308   204 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     15791  0.0  0.0 232308    80 ?        S    00:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     16115  0.0  0.0 232308    80 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     16778  0.0  0.0 232308    60 ?        S    01:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     17059  0.0  0.0 232308    76 ?        S    Mar08   0:07 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     17967  0.0  0.0 232308   256 ?        S    02:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     17993  0.0  0.0 232308   252 ?        S    Mar08   0:06 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     19047  0.0  0.0 232308    76 ?        S    Mar08   0:06 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     19194  0.0  1.3 232308 14048 ?        S    03:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     19588  0.0  0.0  13068   984 pts\/2    S+   03:29   0:00 grep --color=auto dequeueBroker.php\r\nroot     20097  0.0  0.0 232308   212 ?        S    Mar08   0:06 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     21104  0.0  0.0 232308   224 ?        S    Mar08   0:05 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     22197  0.0  0.0 232308   264 ?        S    Mar09   0:05 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     23284  0.0  0.0 232308    96 ?        S    Mar09   0:05 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     24410  0.0  0.0 232308   192 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     25393  0.0  0.0 232308   196 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     26650  0.0  0.0 232308   232 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     27756  0.0  0.0 232308   228 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     28734  0.0  0.0 232308   128 ?        S    Mar09   0:03 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     29957  0.0  0.0 232308    84 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     30931  0.0  0.0 232308    40 ?        S    Mar09   0:04 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     31947  0.0  0.0 232308   180 ?        S    Mar09   0:02 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\n<\/code><\/pre>\n<p>\u6211\u8bb0\u5f97\u6709\u4e00\u4e2a\u547d\u4ee4\u53ef\u4ee5\u63d0\u53d6\u7279\u5b9a\u5217\uff0c\u4f46\u7531\u4e8e\u6211\u4e0d\u8bb0\u5f97\u4e86\uff0c\u6240\u4ee5\u8981\u53bb\u641c\u7d22\u4e00\u4e0b\u3002<\/p>\n<p>\u300c\u5229\u7528Linux\u547d\u4ee4\u7075\u6d3b\u64cd\u4f5c\u6587\u672c\u6570\u636e\u300d\uff08\u68e0\u679c\u98ce\u5473\uff09<\/p>\n<p>\u3048\u3048\u3063\uff01 cat \u3068 cut \u304c\u3042\u308b\u306e\uff01\uff1f<\/p>\n<p>cat \u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u62bd\u51fa\u3059\u308b\u65b9\u6cd5\u306a\u3093\u304b\u7121\u3044\u3088\u306a\u3001\u3068\u304b\u601d\u3063\u3066\u305f\u3093\u3060\u304c\u3002<br \/>\n\u3058\u3083\u3042\u3001\u3053\u3046\u3057\u305f\u3089\u3069\u3046\u304b\uff1f<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep dequeueBroker.php | cut -f 2\r\n<\/code><\/pre>\n<p>\u4e0d\u884c\uff0c\u51fa\u5c40\u4e86\u3002\u4ec0\u4e48\u90fd\u6ca1\u6709\u3002<\/p>\n<p>\u4f7f\u7528cut\u547d\u4ee4\u65f6\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684\u7a7a\u683c\u6216\u5236\u8868\u7b26\u4f5c\u4e3a\u5206\u9694\u7b26\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p>\u8fd9\u7c7b\u535a\u5ba2\u6587\u7ae0\uff0c\u5982\u679c\u5728IT\u7c7b\u516c\u53f8\u5de5\u4f5c\u5c31\u65e0\u6cd5\u4ece\u5b89\u5168\u6027\u89d2\u5ea6\u6765\u9605\u8bfb\uff0c\u800c\u5728\u975eIT\u7c7b\u516c\u53f8\u5de5\u4f5c\u5c31\u53ef\u4ee5\u9605\u8bfb\u3002\u4e0d\u77e5\u9053\u4ec0\u4e48\u662fIT\u7c7b&#8230;&#8230;\u901a\u8fc7\u5207\u5272\u6bcf\u4e2a\u98ce\u9669\u6765\u5b9e\u73b0\u6700\u5b8c\u5584\u7684\u5b89\u5168\uff0c\u4f46\u6b63\u662fIT\u6280\u672f\u7684\u4e00\u6b21\u4e11\u95fb\u5e7f\u6cdb\u4f20\u64ad\u9020\u5c31\u4e86\u5f53\u524d\u7684IT\u884c\u4e1a\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u8fd9\u6837\u884c\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep dequeueBroker.php | sed 's\/[\\t ]\\+\/\\t\/g' | cut -f 2\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>469\r\n1878\r\n2957\r\n4784\r\n4945\r\n5916\r\n6301\r\n6856\r\n7795\r\n8303\r\n8732\r\n9246\r\n9664\r\n10278\r\n10632\r\n11364\r\n11567\r\n12376\r\n12582\r\n13304\r\n13713\r\n14237\r\n14706\r\n15183\r\n15791\r\n16115\r\n16778\r\n17059\r\n17967\r\n17993\r\n19047\r\n19194\r\n19795\r\n20097\r\n21104\r\n22197\r\n23284\r\n24410\r\n25393\r\n26650\r\n27756\r\n28734\r\n29957\r\n30931\r\n31947\r\n<\/code><\/pre>\n<p>\u592a\u68d2\u4e86\uff01<\/p>\n<p>\u90a3\u4f60\u4e0d\u80fd\u7528for\u5faa\u73af\u6765\u6267\u884ckill\u561b\uff1f<\/p>\n<p>\u5c06\u591a\u4e2a\u8fdb\u7a0b\u96c6\u4e2d\u6740\u6b7b\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5982\u679c\u6211\u7406\u89e3\u5f97\u6b63\u786e\u7684\u8bdd\uff0c\u9605\u8bfb\u8fd9\u4e2a\u7684\u610f\u601d\u662f\u6740\u6b7b\u5bf9\u65b9\u3002\u5bf9\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code>kill `ps aux | grep dequeueBroker.php | sed 's\/[\\t ]\\+\/\\t\/g' | cut -f 2`\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># kill `ps aux | grep dequeueBroker.php | sed 's\/[\\t ]\\+\/\\t\/g' | cut -f 2`\r\n-su: kill: (19870) - No such process\r\n<\/code><\/pre>\n<p>\u4ec0\u4e48\uff1f ?)<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep dequeueBroker.php\r\nroot     19889  0.0  0.0  12936   984 pts\/2    S+   03:45   0:00 grep --color=auto dequeueBroker.php\r\n<\/code><\/pre>\n<p>\u5509\uff0c\u96be\u9053\u4e0d\u662f\u6d88\u5931\u4e86\u5417\uff1f<\/p>\n<p>\u90a3\u4e48\uff0c\u8ba9\u6211\u4eec\u8bd5\u7740\u5728\u540e\u53f0\u542f\u52a8\u6d6e\u304b\u3080\u702c\u3002<\/p>\n<pre class=\"post-pre\"><code># cd \/home\/\u2605user\/shogi\/ukamuse_sdt4\/bin\r\n# .\/apery &amp;\r\n[1] 20023\r\n# ps aux | grep apery\r\nroot     20023  0.8 14.0 1325848 142852 pts\/2  Tl   03:54   0:00 .\/apery\r\nroot     20033  0.0  0.0  12936   984 pts\/2    S+   03:55   0:00 grep --color=auto apery\r\n\r\n[1]+  Stopped                 .\/apery\r\n<\/code><\/pre>\n<p>\u6211\u4e0d\u61c2\u8fd9\u662f\u4ec0\u4e48\u610f\u601d\u3002\u5199\u7740&#8221;Stopped&#8221;\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep apery\r\nroot     20023  0.1 14.0 1325848 142852 pts\/2  Tl   03:54   0:00 .\/apery\r\nroot     20055  0.0  0.0  12936   988 pts\/2    S+   03:56   0:00 grep --color=auto apery\r\n<\/code><\/pre>\n<p>\u518d\u770b\u4e00\u6b21\uff0c\u4f3c\u4e4e\u8fd8\u6709\u5c1a\u672a\u7ed3\u675f\u7684\/apery\u8fdb\u7a0b\u3002TL\u6b63\u5728\u505c\u6b62\u4e2d\uff0c\u53ef\u80fd\u662f\u6b63\u5728\u751f\u6210\u65b0\u7684\u8fdb\u7a0b\u5427\u3002\u8fd9\u662f\u4ec0\u4e48\u60c5\u51b5\uff1f<\/p>\n<p>\u8ba9\u6211\u4eec\u4ece\u8d85\u7ea7\u7528\u6237\u548c\u4e00\u822c\u767b\u5f55\u8d26\u6237\u4e2d\u6ce8\u9500\u4ee5\u5c1d\u8bd5\u3002<\/p>\n<pre class=\"post-pre\"><code># logout\r\nThere are stopped jobs.\r\n# logout\r\n# logout\r\n<\/code><\/pre>\n<p>\u55ef\uff1f<\/p>\n<h1>\u91cd\u65b0\u767b\u5f55<\/h1>\n<p>\u8fdb\u884c\u9a8c\u8bc1\uff0c\u7136\u540e\u53ef\u4ee5\u8bbf\u95ee\u7cfb\u7edf\u3002<\/p>\n<pre class=\"post-pre\"><code>$ sudo su -\r\n<\/code><\/pre>\n<p>\u5f9e&#8230;\u51fa\u767c<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep apery\r\nroot     20182  0.0  0.0  12936   988 pts\/2    S+   04:02   0:00 grep --color=auto apery\r\n<\/code><\/pre>\n<p>.\/apery \u4e0d\u89c1\u4e86\u3002\u5982\u679c\u9000\u51fa\u767b\u5f55\uff0c\u4efb\u52a1\u4f1a\u505c\u6b62\u5417\uff1f<br \/>\n\u90a3\u63a5\u4e0b\u6765\u7684\u3002<\/p>\n<p>\u300c\u3010nohup\u3011\u5373\u4f7f\u6ce8\u9500\u4e5f\u80fd\u7ee7\u7eed\u6267\u884c\u547d\u4ee4\u300d\uff08ITPro\uff09<\/p>\n<p>\u6765\u6e90\uff1ahttp:\/\/itpro.nikkeibp.co.jp\/article\/COLUMN\/20060227\/230850\/<\/p>\n<pre class=\"post-pre\"><code># cd \/home\/\u2605user\/shogi\/ukamuse_sdt4\/bin\r\n# nohup .\/apery &amp;\r\n[1] 20237\r\nroot@\u2605:\/home\/\u2605user\/shogi\/ukamuse_sdt4\/bin# nohup: ignoring input and appending output to 'nohup.out'\r\n<\/code><\/pre>\n<p>\u8fd9\u662f\u4ec0\u4e48\u5462\uff1f<\/p>\n<p>\u5982\u679c\u8f93\u5165\u88ab\u5ffd\u7565\u7684\u8bdd\uff0c\u90a3\u4e0d\u662f\u4f1a\u5f88\u56f0\u6270\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code>nohup php .\/apery &gt; apery.out.log 2&gt; apery.err.log &lt; \/dev\/null &amp;\r\n<\/code><\/pre>\n<p>\u6a19\u6e96\u5165\u529b\u306f\u3000\u4f55\u306b\u3057\u305f\u3089\u3044\u3044\u3093\u3060\uff1f<br \/>\n\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u5c06\u68cb\u30bd\u30d5\u30c8\u306f\u3000\u6a19\u6e96\u5165\u529b\u304b\u3089\u3000\u30b3\u30de\u30f3\u30c9\u3092\u53d7\u3051\u4ed8\u3051\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u9589\u3058\u3066\u3057\u307e\u3046\u3068\u3000\u5f79\u306b\u7acb\u305f\u306a\u3044\u3002<\/p>\n<p>\u305d\u308c\u306f\u3000\u3042\u3068\u3067\u8003\u3048\u308b\u3068\u3057\u3066\u3001 nohup \u3067\u5b9f\u884c\u3057\u305f\u30b3\u30de\u30f3\u30c9\u304c\u3001\u30ed\u30b0\u30a2\u30a6\u30c8\u5f8c\u3082\u6b8b\u3063\u3066\u3044\u308b\u306e\u304b\u8abf\u3079\u3066\u307f\u305f\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep apery      root     20436  0.0  0.0  12936   984 pts\/2    S+   04:15   0:00 grep --color=auto apery\r\n[1]+  Done                    nohup .\/apery\r\n<\/code><\/pre>\n<p>Done \u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1fnohup \u662f\u4e0d\u662f Done \u7684\u539f\u56e0\u5462\uff1f<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep apery\r\nroot     20447  0.0  0.0  12936   988 pts\/2    S+   04:16   0:00 grep --color=auto apery\r\n<\/code><\/pre>\n<p>\u96be\u9053\u662f\u56e0\u4e3a\u6ca1\u6709\u6267\u884c&#8221;.\/apery&#8221;\u547d\u4ee4\uff0c\u6240\u4ee5\u5728\u6ce8\u9500\u671f\u95f4\u6d88\u5931\u4e86\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u4f7f\u7528nohup\u53ef\u4ee5\u5728\u540e\u53f0\u8fd0\u884c\u4ec0\u4e48\u5462\uff1f<\/p>\n<p>\u300cPHP\u7684while\u5faa\u73af\u548c\u65e0\u9650\u5faa\u73af\u300d\uff08\u96f6\u7f16\u7a0b\u535a\u5ba2-\u4ece\u96f6\u5f00\u59cb\u7684\u7f16\u7a0b\u5b66\u4e60\uff09<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"gVSKeEOLQv\"><p><a href=\"https:\/\/zeropuro.com\/blog\/?p=248\">PHP while\u6587\u3068\u7121\u9650\u30eb\u30fc\u30d7<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u57cb\u3081\u8fbc\u307e\u308c\u305f WordPress \u306e\u6295\u7a3f\" src=\"https:\/\/zeropuro.com\/blog\/?p=248&#038;embed=true#?secret=gVSKeEOLQv\" data-secret=\"gVSKeEOLQv\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>loop28.php<\/p>\n<pre class=\"post-pre\"><code>&lt;?php\r\nwhile(true){\r\n  sleep(1);\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># php loop28.php &amp;\r\n[1] 20615\r\n# ps aux | grep php\r\nroot      6091  0.0  0.0 311040   312 ?        Ss   Mar07   0:50 php-fpm: master process (\/etc\/php\/7.0\/fpm\/php-fpm.conf)\r\nwww-data  6094  0.0  0.0 311040     0 ?        S    Mar07   0:00 php-fpm: pool www\r\nwww-data  6095  0.0  0.0 311040     0 ?        S    Mar07   0:00 php-fpm: pool www\r\nroot     20224  0.0  1.3 232308 14048 ?        S    04:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     20615  0.1  1.3 230188 13304 pts\/2    S    04:27   0:00 php loop28.php\r\nroot     20622  0.0  0.0  12936   988 pts\/2    S+   04:28   0:00 grep --color=auto php\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c\u6211\u8bd5\u7740\u6ce8\u9500\u4e00\u4e0b\u8d26\u6237\u3002<\/p>\n<pre class=\"post-pre\"><code># logout\r\n# logout\r\n<\/code><\/pre>\n<p>\u521a\u624d\u662f\u4e09\u6b21\uff0c\u800c\u8fd9\u6b21\u53ea\u6709\u4e24\u6b21\u3002\u4e0d\u77e5\u9053\u6709\u4ec0\u4e48\u533a\u522b\u5462\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep php\r\nroot      6091  0.0  0.0 311040   312 ?        Ss   Mar07   0:50 php-fpm: master process (\/etc\/php\/7.0\/fpm\/php-fpm.conf)\r\nwww-data  6094  0.0  0.0 311040     0 ?        S    Mar07   0:00 php-fpm: pool www\r\nwww-data  6095  0.0  0.0 311040     0 ?        S    Mar07   0:00 php-fpm: pool www\r\nroot     20224  0.0  1.3 232308 14048 ?        S    04:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     20615  0.0  1.3 230188 13304 ?        S    04:27   0:00 php loop28.php\r\nroot     20743  0.0  0.0  12936   984 pts\/3    S+   04:33   0:00 grep --color=auto php\r\n<\/code><\/pre>\n<p>\u542c\u8bf4\u8fd9\u6b21\u9700\u8981 loop28.php\u3002<\/p>\n<p>\u5982\u679cPHP\u548cC#\u3001C++\u80fd\u591f\u8fdb\u884c\u8fdb\u7a0b\u95f4\u901a\u4fe1\u7684\u8bdd\uff0c\u90a3\u4e8b\u60c5\u5c31\u7b80\u5355\u4e86\u3002\u4f46\u662f\uff0c\u6b63\u5982\u6211\u5728\u6587\u7ae0\u300a\u7b2c1\u7bc7\u300b\u81f3\u300a\u7b2c3\u7bc7\u300b\u4e2d\u6240\u5199\u9053\uff0cPHP\u548cC#\u4e4b\u95f4\u7684\u7a0b\u5e8f\u95f4\u901a\u4fe1\u5374\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<h1>C++ \u7684\u65e0\u9650\u5faa\u73af\u80fd\u591f\u5e38\u9a7b\u5417\uff1f<\/h1>\n<p>\u300c\u65f6\u95f4\u00b7\u65f6\u523b\u5904\u7406\uff084\uff09\u300d\uff08LinuxC\uff09<\/p>\n<p>\u4e0d\u884c\uff0c\u4e0d\u80fd\u5728Windows\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>\u300c\u6beb\u79d2\u7ea7\u7684\u7761\u7720\u300d\uff08\u6765\u81ea Stack Overflow\uff09<br \/>\nhttp:\/\/stackoverflow.com\/questions\/4184468\/\u6beb\u79d2\u7ea7\u7684\u7761\u7720<\/p>\n<p>\u597d\u5427\uff0c\u8fd9\u6837\u5427\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/ Cpp_Tamesi28.cpp : Defines the entry point for the console application.\r\n\/\/\r\n\r\n#include &lt;chrono&gt;\r\n#include &lt;thread&gt;\r\n\r\n#if WINDOWS\r\n#include \"stdafx.h\"\r\n#endif\r\n\r\nint main(void)\r\n{\r\n    for (;;) {\r\n        std::this_thread::sleep_for(std::chrono::seconds(1));\r\n    }\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<p>\u5982\u4f55\u5728 Visual Studio 2015 C++ \u4e2d\u5c06\u9884\u5904\u7406\u5668\u5b9a\u4e49\u4f5c\u4e3a\u547d\u4ee4\u884c\u53c2\u6570\u9644\u52a0\uff1f<\/p>\n<p>\u300c\/D\uff08\u9884\u5904\u7406\u5668\u5b9a\u4e49\uff09\u300d\uff08MSDN\uff09<\/p>\n<p>\u4ece\u4e3b\u83dc\u5355\u7684[\u9879\u76ee]\u9009\u9879\u4e2d\uff0c\u6253\u5f00\u9879\u76ee\u7684\u5c5e\u6027\u9875\u9762\uff0c\u7136\u540e\u4f9d\u6b21\u70b9\u51fb[\u914d\u7f6e\u5c5e\u6027] &#8211; [C\/C++] &#8211; [\u9884\u5904\u7406\u5668] &#8211; [\u9884\u5904\u7406\u5668\u5b9a\u4e49]\u3002<\/p>\n<pre class=\"post-pre\"><code>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)\r\n<\/code><\/pre>\n<p>\u5728\u672b\u5c3e\u52a0\u4e0aWINDOWS\u7684\u6807\u5fd7\u3002<\/p>\n<pre class=\"post-pre\"><code>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);WINDOWS\r\n<\/code><\/pre>\n<p>\u4e0d\u884c\u3002\u8fd9\u6837\u4e0d\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code>_DEBUG;_CONSOLE;WINDOWS;%(PreprocessorDefinitions)\r\n<\/code><\/pre>\n<p>\u8fd9\u4e5f\u4e0d\u884c\u3002<\/p>\n<p>\u554a\uff01\u53d8\u6210\u4e86x86\u4e86\u3002\u8981\u9002\u5e94x64\u5427\u3002<br \/>\n\u597d\u7684\uff0c\u6ca1\u95ee\u9898\u3002<\/p>\n<p>stdafx.h -&gt; \u6807\u51c6\u9644\u52a0\u5934\u6587\u4ef6.h .h)<\/p>\n<pre class=\"post-pre\"><code>\/\/ stdafx.h : include file for standard system include files,\r\n\/\/ or project specific include files that are used frequently, but\r\n\/\/ are changed infrequently\r\n\/\/\r\n\r\n#pragma once\r\n\r\n#include \"targetver.h\"\r\n\r\n#include &lt;stdio.h&gt;\r\n#include &lt;tchar.h&gt;\r\n\r\n\r\n\/\/ TODO: reference additional headers your program requires here\r\n<\/code><\/pre>\n<p>\u5f88\u62b1\u6b49\uff0c\u4f46\u65e0\u6cd5\u5bf9\u8fd9\u4e2a\u7247\u6bb5\u8fdb\u884c\u9002\u5f53\u7684\u4e2d\u6587\u8f6c\u8ff0\u3002\u53ef\u4ee5\u7ed9\u51fa\u66f4\u591a\u4e0a\u4e0b\u6587\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u7b54\u6848\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code>\/\/ stdafx.h : include file for standard system include files,\r\n\/\/ or project specific include files that are used frequently, but\r\n\/\/ are changed infrequently\r\n\/\/\r\n\r\n#pragma once\r\n\r\n#if WINDOWS\r\n#include \"targetver.h\"\r\n\r\n#include &lt;stdio.h&gt;\r\n#include &lt;tchar.h&gt;\r\n#endif\r\n\r\n\r\n\/\/ TODO: reference additional headers your program requires here\r\n<\/code><\/pre>\n<p>\u6bcd\u8bed\u4e2d\u56fd\uff0c\u53ea\u9700\u4e00\u4e2a\u9009\u9879\uff0c\u8bf7\u6539\u5199\u4ee5\u4e0b\u5185\u5bb9\uff1a<br \/>\n&#8220;\u5185\u5bb9&#8221;<\/p>\n<pre class=\"post-pre\"><code>#if WINDOWS\r\n#endif\r\n<\/code><\/pre>\n<p>\u6253\u5f00\u4e00\u4e2a\u4e0d\u63a5\u53d7\u8f93\u5165\u7684\u547d\u4ee4\u63d0\u793a\u7a97\u53e3\u3002<\/p>\n<p>\u628a\u6e90\u4ee3\u7801\u5e26\u5230Ubuntu\u4e0a\uff0c\u5b83\u80fd\u8fd0\u884c\u5417\uff1f<br \/>\n\u4f46\u662f\u6211\u4e0d\u77e5\u9053\u5982\u4f55\u7f16\u5199Makefile\u3002<\/p>\n<pre class=\"post-pre\"><code># cd \/home\/\u2605user\/shogi\r\n# mkdir cpp_service\r\n# mkdir tamesi28.d\r\n# nano tamesi28.cpp\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>#include &lt;chrono&gt;\r\n#include &lt;thread&gt;\r\n\r\nint main(void)\r\n{\r\n        for (;;) {\r\n                std::this_thread::sleep_for(std::chrono::seconds(1));\r\n        }\r\n        return 0;\r\n}\r\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u5417\uff1f<br \/>\n\u8981\u7528g++\u8fdb\u884c\u7f16\u8bd1\u5417\uff1f<\/p>\n<p>\u300cg++\u300d\uff08C++\uff09\u662f\u4e00\u4e2aC++\u7f16\u8bd1\u5668\u3002<br \/>\n\u53ef\u4ee5\u5728\u4ee5\u4e0b\u94fe\u63a5\u627e\u5230\u76f8\u5173\u4fe1\u606f\uff1ahttp:\/\/kaworu.jpn.org\/cpp\/g++<\/p>\n<p>\u53ea\u9700\u8981\u7ed9\u5b83\u547d\u540d\u4e00\u4e2a\u6587\u4ef6\u540d\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code># g++ tamesi28.cpp\r\nIn file included from \/usr\/include\/c++\/5\/chrono:35:0,\r\n                 from tamesi28.cpp:1:\r\n\/usr\/include\/c++\/5\/bits\/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.\r\n #error This file requires compiler and library support \\\r\n  ^\r\ntamesi28.cpp: In function \u2018int main()\u2019:\r\ntamesi28.cpp:7:8: error: \u2018std::this_thread\u2019 has not been declared\r\n   std::this_thread::sleep_for(std::chrono::seconds(1));\r\n        ^\r\ntamesi28.cpp:7:36: error: \u2018std::chrono\u2019 has not been declared\r\n   std::this_thread::sleep_for(std::chrono::seconds(1));\r\n                                    ^\r\n<\/code><\/pre>\n<p>\u8fde std::this_thread \u548c std::chrono \u90fd\u4e0d\u80fd\u4f7f\u7528\u5417\uff1f<\/p>\n<p>\u6d6e\u73b0\u5728\u4ee3\u7801\u4e2d\u7684 usi.cpp\u3002<\/p>\n<pre class=\"post-pre\"><code>            std::this_thread::sleep_for(std::chrono::seconds(5)); \/\/ \u6307\u5b9a\u79d2\u3060\u3051\u5f85\u6a5f\u3057\u3001\u9032\u6357\u3092\u8868\u793a\u3059\u308b\u3002\r\n<\/code><\/pre>\n<p>\u5728\u6211\u4f7f\u7528\u7684\u73af\u5883\u4e2d\uff0c\u6211\u89c9\u5f97\u80fd\u591f\u6210\u529f\u7f16\u8bd1\u4f7f\u7528g++\u3002\u4e0d\u77e5\u9053\u662f\u5426\u6709\u4e00\u4e2aMakefile\u673a\u5236\u5b58\u5728\uff1f<\/p>\n<p>\u5728Makefile\u5f00\u5934\u7684\u524d\u4e09\u884c<\/p>\n<pre class=\"post-pre\"><code>COMPILER = g++\r\n#COMPILER = mpicxx\r\nCFLAGS   = -std=c++11 -fno-exceptions -fno-rtti -Wextra -Ofast -MMD -MP -fopenmp\r\n<\/code><\/pre>\n<p>\u8fd9\u9644\u8fd1\u53ef\u80fd\u6709\u5173\u7cfb\u5427\uff1f<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi28.cpp\r\n<\/code><\/pre>\n<p>\u4f3c\u4e4e\u5df2\u7ecf\u6210\u529f\u6267\u884c\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code># ls\r\na.out  tamesi28.cpp\r\n# .\/a.out\r\n\r\n<\/code><\/pre>\n<p>\u597d\u7684\uff0c\u770b\u8d77\u6765\u8fdb\u5165\u4e86\u65e0\u9650\u5faa\u73af\u3002<\/p>\n<p>\u6309\u4f4f[Ctrl]\u952e\uff0c\u7136\u540e\u6309\u4e0b[C]\u952e\u3002<\/p>\n<p>\u53ef\u4ee5\u51fa\u53bb\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code># .\/a.out &amp;\r\n[1] 21556\r\n<\/code><\/pre>\n<p>\u7cdf\u7cd5\u4e86\uff0c\u6587\u4ef6\u540d\u5f88\u96be\u641c\u7d22\u5230\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep a.out\r\nroot     21556  0.0  0.0   4216   364 pts\/3    S    05:22   0:00 .\/a.out\r\nroot     21569  0.0  0.0  12936   988 pts\/3    S+   05:22   0:00 grep --color=auto a.out\r\n<\/code><\/pre>\n<p>\u770b\u8d77\u6765\u5728\u52a8\u3002<br \/>\n\u8bd5\u7740\u767b\u51fa\u8d26\u53f7\u3002<\/p>\n<pre class=\"post-pre\"><code># logout\r\n$ logout\r\n<\/code><\/pre>\n<p>\u91cd\u65b0\u767b\u5f55\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep a.out\r\nroot     21556  0.0  0.0   4216   364 ?        S    05:22   0:00 .\/a.out\r\nroot     21658  0.0  0.0  12936   984 pts\/4    S+   05:25   0:00 grep --color=auto a.out\r\n<\/code><\/pre>\n<p>\u5e73\u5e38\u90fd\u5728\u8fd9\u91cc\u5462\u2026\u2026\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u6211\u4eec\u6765\u7814\u7a76\u4e00\u4e0b\uff0cC++\u662f\u5426\u53ef\u4ee5\u8fdb\u884c\u8fdb\u7a0b\u95f4\u901a\u4fe1\u3002<\/p>\n<p>\u300cRabbitMQ\u6559\u7a0b\u300d\uff08RabbitMQ\uff09<br \/>\nhttp:\/\/www.rabbitmq.com\/getstarted.html<\/p>\n<p>\u55ef\uff1fRabbitMQ\u6ca1\u6709\u5173\u4e8eC++\u7684\u8bf4\u660e\u5417\uff1f<\/p>\n<p>\u300c\u5ba2\u6237\u7aef\u548c\u5f00\u53d1\u8005\u5de5\u5177\u300d\uff08RabbitMQ\uff09<br \/>\nhttps:\/\/www.rabbitmq.com\/devtools.html<\/p>\n<p>\u4f3c\u4e4e\u6709\u56db\u4e2a\u3002<\/p>\n<p>\u300cAMQP-CPP\u300d\u662f\u7531CopernicaMarketingSoftware\u5f00\u53d1\u7684\u4e00\u4e2a\u5e93\uff0c\u7528\u4e8e\u5728C++\u4e2d\u5b9e\u73b0AMQP\uff08\u9ad8\u7ea7\u6d88\u606f\u961f\u5217\u534f\u8bae\uff09\u3002\u60a8\u53ef\u4ee5\u5728https:\/\/github.com\/CopernicaMarketingSoftware\/AMQP-CPP\u627e\u5230\u66f4\u591a\u5173\u4e8e\u8be5\u5e93\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u4f60\u60f3\u8c03\u67e5\u4e00\u4e0b\u8fd9\u4e2a\u5199\u6709\u793a\u4f8b\u7684\u6587\u4ef6\u5417\uff1f<\/p>\n<p>\u5728FileZilla\u4e2d\u5c06AMQP-CPP-master\u590d\u5236\u3002\u8fd9\u662fAMQP\u800c\u4e0d\u662fRabbitMQ\u771f\u6b63\u7684AMQP\uff0c\u5b83\u662fRabbitMQ\u98ce\u683c\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code>cd \/home\/\u2605user\/shogi\/AMQP-CPP-master\r\ncd AMQP-CPP-master\r\n# nano Makefile\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c<\/p>\n<pre class=\"post-pre\"><code># make pure\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># ls\r\namqpcpp.h       include  Makefile   set_cxx_norm.cmake  tests\r\nCMakeLists.txt  LICENSE  README.md  src\r\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u662f\u5728\u54ea\u91cc\u521b\u5efa\u7684\uff1f\u6216\u8005\u5e93\u5728\u54ea\u91cc\uff1f<\/p>\n<pre class=\"post-pre\"><code># make\r\n# make install\r\n# make pure\r\nmake -C src pure\r\nmake[1]: Entering directory '\/home\/\u2605user\/shogi\/AMQP-CPP-master\/src'\r\nmake[1]: Nothing to be done for 'pure'.\r\nmake[1]: Leaving directory '\/home\/\u2605user\/shogi\/AMQP-CPP-master\/src'\r\n<\/code><\/pre>\n<p>\u55ef\u3002\u5982\u679c\u67e5\u770b src \u6587\u4ef6\u5939\u91cc\u9762\u7684\u5185\u5bb9\u4f1a\u600e\u6837\u5462\uff1f<\/p>\n<p>\u53ea\u6709\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002<br \/>\nlibamqpcpp.so.2.6.2<\/p>\n<p>\u8fd9\u4e2a\u600e\u4e48\u4f7f\u7528\uff1f<\/p>\n<p>\u8fd9\u91cc\u662f\u793a\u4f8b\u7a0b\u5e8f\u5417\uff1f<\/p>\n<p>\u300camqpcpp\/examples\/\u300d\uff08akalend\/amqpcpp\uff09\u5728GitHub\u4e0a\u7684\u94fe\u63a5\u4e3ahttps:\/\/github.com\/akalend\/amqpcpp\/tree\/master\/examples\u3002<\/p>\n<p>\u54ce\u5440\uff0csrc\u6587\u4ef6\u5939\u91cc\u9762\u4e5f\u6709\u4e00\u4e2aMakefile\u5462\u3002<\/p>\n<pre class=\"post-pre\"><code>\/home\/\u2605user\/shogi\/AMQP-CPP-master\/src# make pure\r\n<\/code><\/pre>\n<p>\u4f3c\u4e4e\u751f\u6210\u4e86\u4e00\u4e2a\u540d\u4e3alib.so\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4f46\u662f\u4e0d\u6e05\u695a\u5177\u4f53\u662f\u5173\u4e8e\u4ec0\u4e48\u3002<\/p>\n<pre class=\"post-pre\"><code>root@\u2605:\/home\/\u2605user\/shogi\/AMQP-CPP-master# make pure\r\nmake -C src pure\r\nmake[1]: Entering directory '\/home\/\u2605user\/shogi\/AMQP-CPP-master\/src'\r\nmake[1]: Nothing to be done for 'pure'.\r\nmake[1]: Leaving directory '\/home\/\u2605user\/shogi\/AMQP-CPP-master\/src'\r\nroot@\u2605:\/home\/\u2605user\/shogi\/AMQP-CPP-master# make install\r\nmkdir -p \/usr\/include\/amqpcpp\r\nmkdir -p \/usr\/lib\r\ncp -f amqpcpp.h \/usr\/include\r\ncp -f include\/*.h \/usr\/include\/amqpcpp\r\ncp -f src\/libamqpcpp.so.2.6.2 \/usr\/lib\r\ncp -f src\/libamqpcpp.a.2.6.2 \/usr\/lib\r\nln -r -s -f \/usr\/lib\/libamqpcpp.so.2.6.2 \/usr\/lib\/libamqpcpp.so.2.6\r\nln -r -s -f \/usr\/lib\/libamqpcpp.so.2.6.2 \/usr\/lib\/libamqpcpp.so\r\nln -r -s -f \/usr\/lib\/libamqpcpp.a.2.6.2 \/usr\/lib\/libamqpcpp.a\r\n<\/code><\/pre>\n<p>\u4f60\u6709\u6ca1\u6709\u5df2\u7ecf\u4e3a\u6211\u8bbe\u7f6e\u597d\u4f7f\u7528\u7684\u76ee\u5f55 &#8220;\/usr\/lib&#8221;\uff1f\u90a3\u597d\uff0c\u8ba9\u6211\u8bd5\u7740\u5199\u4e00\u4e0b\u6e90\u4ee3\u7801\u5427\u3002<\/p>\n<pre class=\"post-pre\"><code>\/home\/\u2605user\/shogi\/cpp_service# nano tamesi29a7_main.cpp\r\n<\/code><\/pre>\n<p>tamesi29a7_main.cpp \u6587\u4ef6\u8fdb\u884c\u91cd\u5199\u7684\u4e2d\u6587\u7248\u672c\u3002<\/p>\n<pre class=\"post-pre\"><code>#include &lt;ev.h&gt;\r\n#include &lt;amqpcpp.h&gt;\r\n#include &lt;amqpcpp\/libev.h&gt;\r\n\r\nint main()\r\n{\r\n    \/\/ access to the event loop\r\n    auto *loop = EV_DEFAULT;\r\n\r\n    \/\/ handler for libev (so we don't have to implement AMQP::TcpHandler!)\r\n    AMQP::LibEvHandler handler(loop);\r\n\r\n    \/\/ make a connection\r\n    AMQP::TcpConnection connection(&amp;handler, AMQP::Address(\"amqp:\/\/localhost\/\"));\r\n\r\n    \/\/ we need a channel too\r\n    AMQP::TcpChannel channel(&amp;connection);\r\n\r\n    \/\/ create a temporary queue\r\n    channel.declareQueue(AMQP::exclusive).onSuccess([&amp;connection](const std::string &amp;name, uint32_t messagecount, uint32_t consumercount) {\r\n\r\n        \/\/ report the name of the temporary queue\r\n        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\r\n        \/\/ now we can close the connection\r\n        connection.close();\r\n    });\r\n\r\n    \/\/ run the loop\r\n    ev_run(loop, 0);\r\n\r\n    \/\/ done\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># g++ tamesi29a7_main.cpp\r\ntamesi29a7_main.cpp:1:16: fatal error: ev.h: No such file or directory\r\ncompilation terminated.\r\n<\/code><\/pre>\n<p>\u4e0d\u4e00\u6837\u5417\uff1f<\/p>\n<h1>libev\u662f\u4e00\u4e2a\u5728C\u8bed\u8a00\u4e2d\u4f7f\u7528\u7684\u9ad8\u6548\u5f02\u6b65\u4e8b\u4ef6\u5e93\u3002<\/h1>\n<p>&#8220;libev\u7684ev_async\u6709\u4ec0\u4e48\u7528\u9014\uff1f&#8221;<\/p>\n<p>\u6709\u4e00\u4e2a\u53eb\u505aev\u56fe\u4e66\u9986\u7684\u4e1c\u897f\u5417\uff1f<\/p>\n<p>\u300c\u5229\u7528libev\u8fdb\u884c\u5f02\u6b65\u7f16\u7a0b\u300d\uff08Qiita\uff09<br \/>\nhttp:\/\/qiita.com\/0xfffffff7\/items\/c5287067623fdbd2c3cb<\/p>\n<p>\u90a3\u4e48\uff0c\u6765\u5c1d\u8bd5\u5b89\u88c5\u4e00\u4e0b\u5427\u3002<\/p>\n<pre class=\"post-pre\"><code># apt-get -y install libev\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nE: Unable to locate package libev\r\n<\/code><\/pre>\n<p>\u6709\u6ca1\u6709\u8fd9\u6837\u7684\u547d\u4ee4\u5462\u2026\u2026\u3002<\/p>\n<p>\u300c\u5982\u4f55\u5728Ubuntu 14.04\uff08Trusty Tahr\uff09\u4e0a\u5b89\u88c5libev-dev\u300d\uff08\u5b89\u88c5\u6307\u5357\uff09<br \/>\nhttps:\/\/www.howtoinstall.co\/zh\/ubuntu\/trusty\/libev-dev<\/p>\n<pre class=\"post-pre\"><code>sudo apt-get update\r\nsudo apt-get install libev-dev\r\n<\/code><\/pre>\n<p>\u6211\u4e0d\u77e5\u9053\u6211\u662f\u4e0d\u662f\u8fdb\u53bb\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code># g++ tamesi29a7_main.cpp\r\n<\/code><\/pre>\n<p>\u51fa\u73b0\u4e86\u8bb8\u591a\u9519\u8bef\u3002\u8fd9\u6837\u5982\u4f55\uff1f<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a7_main.cpp\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>\/tmp\/ccMfSVKb.o: In function `main':\r\ntamesi29a7_main.cpp:(.text+0x18f): undefined reference to `ev_default_loop'\r\ntamesi29a7_main.cpp:(.text+0x1e3): undefined reference to `AMQP::TcpConnection::TcpConnection(AMQP::TcpHandler*, AMQP::Address const&amp;)'\r\ntamesi29a7_main.cpp:(.text+0x22d): undefined reference to `AMQP::exclusive'\r\ntamesi29a7_main.cpp:(.text+0x276): undefined reference to `ev_run'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Field::~Field()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5FieldD2Ev[_ZN4AMQP5FieldD5Ev]+0xd): undefined reference to `vtable for AMQP::Field'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Field::Field()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5FieldC2Ev[_ZN4AMQP5FieldC5Ev]+0x9): undefined reference to `vtable for AMQP::Field'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Table::Table()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5TableC2Ev[_ZN4AMQP5TableC5Ev]+0x19): undefined reference to `vtable for AMQP::Table'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Table::~Table()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5TableD2Ev[_ZN4AMQP5TableD5Ev]+0xd): undefined reference to `vtable for AMQP::Table'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Channel::Channel(AMQP::Connection*)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7ChannelC2EPNS_10ConnectionE[_ZN4AMQP7ChannelC5EPNS_10ConnectionE]+0x30): undefined reference to `AMQP::ChannelImpl::ChannelImpl()'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7ChannelC2EPNS_10ConnectionE[_ZN4AMQP7ChannelC5EPNS_10ConnectionE]+0x65): undefined reference to `AMQP::ChannelImpl::attach(AMQP::Connection*)'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Channel::~Channel()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7ChannelD2Ev[_ZN4AMQP7ChannelD5Ev]+0x2c): undefined reference to `AMQP::ChannelImpl::close()'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Channel::declareQueue(int)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7Channel12declareQueueEi[_ZN4AMQP7Channel12declareQueueEi]+0x68): undefined reference to `AMQP::ChannelImpl::declareQueue(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int, AMQP::Table const&amp;)'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Connection::~Connection()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP10ConnectionD2Ev[_ZN4AMQP10ConnectionD5Ev]+0x24): undefined reference to `AMQP::ConnectionImpl::~ConnectionImpl()'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::Connection::close()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP10Connection5closeEv[_ZN4AMQP10Connection5closeEv]+0x18): undefined reference to `AMQP::ConnectionImpl::close()'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::TcpConnection::~TcpConnection()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP13TcpConnectionD2Ev[_ZN4AMQP13TcpConnectionD5Ev]+0xd): undefined reference to `vtable for AMQP::TcpConnection'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP13TcpConnectionD2Ev[_ZN4AMQP13TcpConnectionD5Ev]+0x19): undefined reference to `vtable for AMQP::TcpConnection'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP13TcpConnectionD2Ev[_ZN4AMQP13TcpConnectionD5Ev]+0x51): undefined reference to `AMQP::Watchable::~Watchable()'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::LibEvHandler::Watcher::callback(ev_loop*, ev_io*, int)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP12LibEvHandler7Watcher8callbackEP7ev_loopP5ev_ioi[_ZN4AMQP12LibEvHandler7Watcher8callbackEP7ev_loopP5ev_ioi]+0x33): undefined reference to `AMQP::TcpConnection::process(int, int)'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::LibEvHandler::Watcher::Watcher(ev_loop*, AMQP::TcpConnection*, int, int)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP12LibEvHandler7WatcherC2EP7ev_loopPNS_13TcpConnectionEii[_ZN4AMQP12LibEvHandler7WatcherC5EP7ev_loopPNS_13TcpConnectionEii]+0xbf): undefined reference to `ev_io_start'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::LibEvHandler::Watcher::~Watcher()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP12LibEvHandler7WatcherD2Ev[_ZN4AMQP12LibEvHandler7WatcherD5Ev]+0x2f): undefined reference to `ev_io_stop'\r\n\/tmp\/ccMfSVKb.o: In function `AMQP::LibEvHandler::Watcher::events(int)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP12LibEvHandler7Watcher6eventsEi[_ZN4AMQP12LibEvHandler7Watcher6eventsEi]+0x26): undefined reference to `ev_io_stop'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP12LibEvHandler7Watcher6eventsEi[_ZN4AMQP12LibEvHandler7Watcher6eventsEi]+0x5d): undefined reference to `ev_io_start'\r\ncollect2: error: ld returned 1 exit status\r\n<\/code><\/pre>\n<p>\u600e\u4e48\u529e\u5462\u3002<\/p>\n<p>\u300cC libev\u7684undefined reference to `ev_default_loop&#8217;\u300d \uff08stackoverflow\uff09<br \/>\nhttp:\/\/stackoverflow.com\/questions\/13844309\/c-libev-undefined-reference-to-ev-default-loop<\/p>\n<p>\u300cC libev\u51fa\u73b0undefined reference to `ev_default_loop&#8217;\u300d \uff08stackoverflow\uff09<br \/>\nhttp:\/\/stackoverflow.com\/questions\/13844309\/c-libev-undefined-reference-to-ev-default-loop<\/p>\n<p>\u5982\u679c\u52a0\u4e0a\u300c-lev\u300d\u9009\u9879\uff0c\u4f1a\u600e\u4e48\u6837\u5462\uff1f<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a7_main.cpp -lev\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>\/tmp\/ccbptlAj.o: In function `main':\r\ntamesi29a7_main.cpp:(.text+0x1e3): undefined reference to `AMQP::TcpConnection::TcpConnection(AMQP::TcpHandler*, AMQP::Address const&amp;)'\r\ntamesi29a7_main.cpp:(.text+0x22d): undefined reference to `AMQP::exclusive'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Field::~Field()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5FieldD2Ev[_ZN4AMQP5FieldD5Ev]+0xd): undefined reference to `vtable for AMQP::Field'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Field::Field()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5FieldC2Ev[_ZN4AMQP5FieldC5Ev]+0x9): undefined reference to `vtable for AMQP::Field'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Table::Table()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5TableC2Ev[_ZN4AMQP5TableC5Ev]+0x19): undefined reference to `vtable for AMQP::Table'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Table::~Table()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP5TableD2Ev[_ZN4AMQP5TableD5Ev]+0xd): undefined reference to `vtable for AMQP::Table'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Channel::Channel(AMQP::Connection*)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7ChannelC2EPNS_10ConnectionE[_ZN4AMQP7ChannelC5EPNS_10ConnectionE]+0x30): undefined reference to `AMQP::ChannelImpl::ChannelImpl()'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7ChannelC2EPNS_10ConnectionE[_ZN4AMQP7ChannelC5EPNS_10ConnectionE]+0x65): undefined reference to `AMQP::ChannelImpl::attach(AMQP::Connection*)'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Channel::~Channel()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7ChannelD2Ev[_ZN4AMQP7ChannelD5Ev]+0x2c): undefined reference to `AMQP::ChannelImpl::close()'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Channel::declareQueue(int)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP7Channel12declareQueueEi[_ZN4AMQP7Channel12declareQueueEi]+0x68): undefined reference to `AMQP::ChannelImpl::declareQueue(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int, AMQP::Table const&amp;)'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Connection::~Connection()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP10ConnectionD2Ev[_ZN4AMQP10ConnectionD5Ev]+0x24): undefined reference to `AMQP::ConnectionImpl::~ConnectionImpl()'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::Connection::close()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP10Connection5closeEv[_ZN4AMQP10Connection5closeEv]+0x18): undefined reference to `AMQP::ConnectionImpl::close()'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::TcpConnection::~TcpConnection()':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP13TcpConnectionD2Ev[_ZN4AMQP13TcpConnectionD5Ev]+0xd): undefined reference to `vtable for AMQP::TcpConnection'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP13TcpConnectionD2Ev[_ZN4AMQP13TcpConnectionD5Ev]+0x19): undefined reference to `vtable for AMQP::TcpConnection'\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP13TcpConnectionD2Ev[_ZN4AMQP13TcpConnectionD5Ev]+0x51): undefined reference to `AMQP::Watchable::~Watchable()'\r\n\/tmp\/ccbptlAj.o: In function `AMQP::LibEvHandler::Watcher::callback(ev_loop*, ev_io*, int)':\r\ntamesi29a7_main.cpp:(.text._ZN4AMQP12LibEvHandler7Watcher8callbackEP7ev_loopP5ev_ioi[_ZN4AMQP12LibEvHandler7Watcher8callbackEP7ev_loopP5ev_ioi]+0x33): undefined reference to `AMQP::TcpConnection::process(int, int)'\r\ncollect2: error: ld returned 1 exit status\r\n<\/code><\/pre>\n<p>\u9519\u8bef\u51cf\u5c11\u4e86\u5417\uff1f<\/p>\n<p>\u300c\u9488\u5bf9rabbitmq-c\u8fdb\u884c\u6784\u5efa\u300d\uff08stackoverflow\uff09<br \/>\nhttp:\/\/stackoverflow.com\/questions\/12028112\/\u9488\u5bf9rabbitmq-c\u8fdb\u884c\u6784\u5efa<\/p>\n<p>\u6211\u5728\u9605\u8bfb GitHub \u5b89\u88c5\u8bf4\u660e\u65f6\u770b\u5230\uff0c\u5199\u7740\u8981\u8fde\u63a5\u5e93\u5e76\u8fdb\u884c\u94fe\u63a5\u3002<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a7_main.cpp -lev -lamqpcpp\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>\/usr\/lib\/gcc\/x86_64-linux-gnu\/5\/..\/..\/..\/..\/lib\/libamqpcpp.so: undefined reference to `pthread_create'\r\ncollect2: error: ld returned 1 exit status\r\n<\/code><\/pre>\n<p>\u8fd9\u662f\u4ec0\u4e48\u5462\uff1f<\/p>\n<p>\u5728Linux\u4e2d\u5b58\u5728\u5bf9pthread_create\u7684\u672a\u5b9a\u4e49\u5f15\u7528\u3002\uff08stackoverflow\uff09<\/p>\n<p>\u6dfb\u52a0&#8221;-pthread&#8221;\u597d\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a7_main.cpp -lev -lamqpcpp -pthread\r\n<\/code><\/pre>\n<p>\u7f16\u8bd1\u4f3c\u4e4e\u901a\u8fc7\u4e86\u3002\u6267\u884c\u6587\u4ef6\u7684\u540d\u79f0\u597d\u50cf\u53d8\u6210\u4e86 a.out\u2026\u2026\u3002\u8fd9\u6837\u3002<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a7_main.cpp -lev -lamqpcpp -pthread -o tamesi29a7_main.exe\r\n<\/code><\/pre>\n<p>\u597d\u7684\uff0c\u6211\u6210\u529f\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3atamesi29a7_main.exe\u7684\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code># .\/tamesi29a7_main.exe\r\ndeclared queue amq.gen-R8_7pGx8GdY5EmtcMddvzQ\r\n<\/code><\/pre>\n<p>\u6211\u4e0d\u77e5\u9053\u8fd9\u662f\u4ec0\u4e48\u610f\u601d\u3002<\/p>\n<p>\u4ed6\u4eec\u53ef\u80fd\u5df2\u7ecf\u4f7f\u7528\u8fd9\u4e2a\u961f\u5217\u7684\u540d\u79f0\u8fdb\u884c\u4e86\u591a\u6b21\u62c6\u5206\uff0c\u5bf9\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    0\r\n<\/code><\/pre>\n<p>\u55ef\u3002<\/p>\n<p>\u300camqpcpp\/examples\/example_consume.cpp\u300d\uff08akalend\/amqpcpp\uff09<br \/>\n\u5728github\u4e0a\u67e5\u770b\u94fe\u63a5\uff1ahttps:\/\/github.com\/akalend\/amqpcpp\/blob\/master\/examples\/example_consume.cpp\u3002<\/p>\n<p>\u8ba9\u6211\u4eec\u8bd5\u4e00\u8bd5\u8fd9\u4e2a\u3002<\/p>\n<p>tamesi29a8_example_consume.cpp \u7684\u793a\u4f8b\u6d88\u8d39<\/p>\n<pre class=\"post-pre\"><code>#include \"AMQPcpp.h\"\r\n\r\nusing namespace std;\r\n\r\nint i=0;\r\n\r\nint onCancel(AMQPMessage * message ) {\r\n    cout &lt;&lt; \"cancel tag=\"&lt;&lt; message-&gt;getDeliveryTag() &lt;&lt; endl;\r\n    return 0;\r\n}\r\n\r\nint  onMessage( AMQPMessage * message  ) {\r\n    uint32_t j = 0;\r\n    char * data = message-&gt;getMessage(&amp;j);\r\n    if (data)\r\n          cout &lt;&lt; data &lt;&lt; endl;\r\n\r\n    i++;\r\n\r\n    cout &lt;&lt; \"#\" &lt;&lt; i &lt;&lt; \" tag=\"&lt;&lt; message-&gt;getDeliveryTag() &lt;&lt; \" content-type:\"&lt;&lt; message-&gt;getHeader(\"Content-type\") ;\r\n    cout &lt;&lt; \" encoding:\"&lt;&lt; message-&gt;getHeader(\"Content-encoding\")&lt;&lt; \" mode=\"&lt;&lt;message-&gt;getHeader(\"Delivery-mode\")&lt;&lt;endl;\r\n\r\n    if (i &gt; 10) {\r\n        AMQPQueue * q = message-&gt;getQueue();\r\n        q-&gt;Cancel( message-&gt;getConsumerTag() );\r\n    }\r\n    return 0;\r\n};\r\n\r\n\r\nint main () {\r\n\r\n\r\n    try {\r\n\/\/      AMQP amqp(\"123123:akalend@localhost\/private\");\r\n\r\n        AMQP amqp(\"123123:akalend@localhost:5673\/private\");\r\n\r\n        AMQPQueue * qu2 = amqp.createQueue(\"q2\");\r\n\r\n        qu2-&gt;Declare();\r\n        qu2-&gt;Bind( \"e\", \"\");\r\n\r\n        qu2-&gt;setConsumerTag(\"tag_123\");\r\n        qu2-&gt;addEvent(AMQP_MESSAGE, onMessage );\r\n        qu2-&gt;addEvent(AMQP_CANCEL, onCancel );\r\n\r\n        qu2-&gt;Consume(AMQP_NOACK);\/\/\r\n\r\n\r\n    } catch (AMQPException e) {\r\n        std::cout &lt;&lt; e.getMessage() &lt;&lt; std::endl;\r\n    }\r\n\r\n    return 0;\r\n\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a8_example_consume.cpp -lev -lamqpcpp -pthread -o tamesi29a8_example_consume.exe\r\ntamesi29a8_example_consume.cpp:1:21: fatal error: AMQPcpp.h: No such file or directory\r\ncompilation terminated.\r\n<\/code><\/pre>\n<p>\u90a3\u662f\u4e2a\u6beb\u65e0\u53c2\u8003\u4ef7\u503c\u7684\u6d88\u606f\u6765\u6e90\u3002<\/p>\n<pre class=\"post-pre\"><code># .\/tamesi29a7_main.exe\r\ndeclared queue amq.gen-0n2SmfNgiVabWrTBjd5F3w\r\n# .\/tamesi29a7_main.exe\r\ndeclared queue amq.gen-MRpMMZ2dX3VRK-HVAJV62w\r\n# .\/tamesi29a7_main.exe\r\ndeclared queue amq.gen-wCRRD2i98lE52gR8nHjaxw\r\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u540d\u5b57\u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1f<\/p>\n<p>\u300cFLAGS AND TABLES\u300d\uff08CopernicaMarketingSoftware\/AMQP-CPP\uff09\u53ef\u4ee5\u5728Github\u4e0a\u627e\u5230\uff0c\u5b83\u662f\u7531CopernicaMarketingSoftware\u5f00\u53d1\u7684AMQP-CPP\u3002<\/p>\n<p>\u6211\u95b1\u8b80\u8aaa\u660e\u4e26\u8a66\u8457\u9032\u884c\u6539\u9020\u3002<\/p>\n<p>\u8bf7\u5c06\u4e0b\u9762\u7684\u5185\u5bb9\u7528\u4e2d\u6587\u8fdb\u884c\u540c\u4e49\u8f6c\u8ff0\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1a<br \/>\ntamesi29a7_main.cpp<\/p>\n<pre class=\"post-pre\"><code>#include &lt;ev.h&gt;\r\n#include &lt;amqpcpp.h&gt;\r\n#include &lt;amqpcpp\/libev.h&gt;\r\n\r\nint main()\r\n{\r\n    \/\/ access to the event loop\r\n    auto *loop = EV_DEFAULT;\r\n\r\n    \/\/ handler for libev (so we don't have to implement AMQP::TcpHandler!)\r\n    AMQP::LibEvHandler handler(loop);\r\n\r\n    \/\/ make a connection\r\n    AMQP::TcpConnection connection(&amp;handler, AMQP::Address(\"amqp:\/\/localhost\/\"));\r\n\r\n    \/\/ we need a channel too\r\n    AMQP::TcpChannel channel(&amp;connection);\r\n\r\n\/\/    \/\/ create a temporary queue\r\n\/\/    channel.declareQueue(AMQP::exclusive).onSuccess([&amp;connection](const std::string &amp;name, uint32_t messagecount, uint32_t consumercount) {\r\n\/\/\r\n\/\/        \/\/ report the name of the temporary queue\r\n\/\/        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\/\/\r\n\/\/        \/\/ now we can close the connection\r\n\/\/        connection.close();\r\n\/\/    });\r\n    \/\/ create a custom callback\r\n    auto callback = [](const std::string &amp;name, int msgcount, int consumercount) {\r\n\r\n        \/\/ @todo add your own implementation\r\n\r\n        \/\/ report the name of the temporary queue\r\n        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\r\n        \/\/ now we can close the connection\r\n        connection.close();\r\n    }\r\n\r\n    \/\/ declare the queue, and install the callback that is called on success\r\n    channel.declareQueue(\"1111\").onSuccess(callback);\r\n\r\n    \/\/ run the loop\r\n    ev_run(loop, 0);\r\n\r\n    \/\/ done\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># nano tamesi29a9_main.cpp\r\n# g++ -std=c++11 tamesi29a9_main.cpp -lev -lamqpcpp -pthread -o tamesi29a9_main.exe\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>tamesi29a9_main.cpp: In lambda function:\r\ntamesi29a9_main.cpp:37:9: error: \u2018connection\u2019 is not captured\r\n         connection.close();\r\n         ^\r\ntamesi29a9_main.cpp:29:22: note: the lambda has no capture-default\r\n     auto callback = [](const std::string &amp;name, int msgcount, int consumercount) {\r\n                      ^\r\ntamesi29a9_main.cpp:14:25: note: \u2018AMQP::TcpConnection connection\u2019 declared here\r\n     AMQP::TcpConnection connection(&amp;handler, AMQP::Address(\"amqp:\/\/localhost\/\"));\r\n                         ^\r\ntamesi29a9_main.cpp: In function \u2018int main()\u2019:\r\ntamesi29a9_main.cpp:41:5: error: expected \u2018,\u2019 or \u2018;\u2019 before \u2018channel\u2019\r\n     channel.declareQueue(\"1111\").onSuccess(callback);\r\n     ^\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c\u5c31\u8fd9\u6837\u5427\u3002<\/p>\n<pre class=\"post-pre\"><code>        \/\/ connection.close();\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a9_main.cpp -lev -lamqpcpp -pthread -o tamesi29a9_main.exe\r\ntamesi29a9_main.cpp: In function \u2018int main()\u2019:\r\ntamesi29a9_main.cpp:41:5: error: expected \u2018,\u2019 or \u2018;\u2019 before \u2018channel\u2019\r\n     channel.declareQueue(\"1111\").onSuccess(callback);\r\n     ^\r\n<\/code><\/pre>\n<p>\u534a\u89d2\u5206\u53f7\u4e0d\u591f\u7528\u5417\uff1f\u660e\u660e\u662f\u4ece\u6837\u672c\u590d\u5236\u8fc7\u6765\u7684\u3002\u90a3\u5c31\u52a0\u4e0a\u53bb\u5427\u3002<\/p>\n<pre class=\"post-pre\"><code>    };\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a9_main.cpp -lev -lamqpcpp -pthread -o tamesi29a9_main.exe\r\n<\/code><\/pre>\n<p>\u7f16\u8bd1\u901a\u8fc7\u4e86\u3002\u6e90\u4ee3\u7801\u662f\u8fd9\u6837\u7684\u3002<\/p>\n<p>tamesi29a9_main.cpp \u53d6\u8bd5\u4e0b\u8ff0\u6e90\u7801\u7684\u6c49\u8bed\u540c\u4e49\u8868\u8fbe\uff1a<\/p>\n<p>tamesi29a9_main.cpp<\/p>\n<pre class=\"post-pre\"><code>#include &lt;ev.h&gt;\r\n#include &lt;amqpcpp.h&gt;\r\n#include &lt;amqpcpp\/libev.h&gt;\r\n\r\nint main()\r\n{\r\n    \/\/ access to the event loop\r\n    auto *loop = EV_DEFAULT;\r\n\r\n    \/\/ handler for libev (so we don't have to implement AMQP::TcpHandler!)\r\n    AMQP::LibEvHandler handler(loop);\r\n\r\n    \/\/ make a connection\r\n    AMQP::TcpConnection connection(&amp;handler, AMQP::Address(\"amqp:\/\/localhost\/\"));\r\n\r\n    \/\/ we need a channel too\r\n    AMQP::TcpChannel channel(&amp;connection);\r\n\r\n\/\/    \/\/ create a temporary queue\r\n\/\/    channel.declareQueue(AMQP::exclusive).onSuccess([&amp;connection](const std::string &amp;name, uint32_t messagecount, uint32_t consumercount) {\r\n\/\/\r\n\/\/        \/\/ report the name of the temporary queue\r\n\/\/        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\/\/\r\n\/\/        \/\/ now we can close the connection\r\n\/\/        connection.close();\r\n\/\/    });\r\n    \/\/ create a custom callback\r\n    auto callback = [](const std::string &amp;name, int msgcount, int consumercount) {\r\n\r\n        \/\/ @todo add your own implementation\r\n\r\n        \/\/ report the name of the temporary queue\r\n        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\r\n        \/\/ now we can close the connection\r\n        \/\/ connection.close();\r\n    };\r\n\r\n    \/\/ declare the queue, and install the callback that is called on success\r\n    channel.declareQueue(\"1111\").onSuccess(callback);\r\n\r\n    \/\/ run the loop\r\n    ev_run(loop, 0);\r\n\r\n    \/\/ done\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># .\/tamesi29a9_main.exe\r\ndeclared queue 1111\r\n<\/code><\/pre>\n<p>\u6709\u70b9\u5728\u7b49\u7740\u3002\u8981\u4e0d\u8981\u7528\u201c\u305f\u3081\u3057\u3055\u3093\u201d\u7cfb\u5217\u7684\u4e1c\u897f\u5462\uff1f<\/p>\n<p>\u8bf7\u63d0\u4f9b\u4e00\u4e2a\u6709\u6548\u7684\u7f51\u5740\u4ee5\u4fbf\u6211\u63d0\u4f9b\u4e2d\u6587\u7684\u7ffb\u8bd1\u3002<\/p>\n<p>\u6211\u662f\u7528RabbitMQ\u8fdb\u884c\u5165\u961f\u64cd\u4f5c\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code>[x] Sent 'Flying Dragon!'\r\n<\/code><\/pre>\n<p>\u6ca1\u6709\u4efb\u4f55\u7279\u522b\u7684\u53d8\u5316\u3002<\/p>\n<pre class=\"post-pre\"><code>^Z\r\n[1]+  Stopped                 .\/tamesi29a9_main.exe\r\n# bg 1\r\n[1]+ .\/tamesi29a9_main.exe &amp;\r\n<\/code><\/pre>\n<p>\u55ef\u3002<\/p>\n<pre class=\"post-pre\"><code># jobs\r\n[1]+  Running                 .\/tamesi29a9_main.exe &amp;\r\n<\/code><\/pre>\n<p>\u3046\u30fc\u3080\u3002\u30d5\u30a1\u30df\u30b3\u30f3\u306e\u3000\u3055\u3093\u307e\u306e\u540d\u63a2\u5075\u3000\u3092\u904a\u3093\u3067\u3044\u305f\u3068\u304d\u306e\u6c17\u5206\u306b\u4f3c\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"post-pre\"><code>ls\r\ntamesi28.d  tamesi29a7_main.cpp  tamesi29a7_main.exe  tamesi29a8_example_consume.cpp  tamesi29a9_main.cpp  tamesi29a9_main.exe\r\n<\/code><\/pre>\n<p>\u4f55\u304b\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u69d8\u5b50\u3082\u306a\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    0\r\n<\/code><\/pre>\n<p>\u9996\u5148\uff0c\u961f\u5217\u662f\u7a7a\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_consumers\r\nListing consumers ...\r\n1111    &lt;rabbit@\u2605&gt; amq.ctag-ztANwsUVbqTvGhE7rnXh6w false   0       []\r\n1111    &lt;rabbit@\u2605&gt; amq.ctag-w-yJ9Fb8Ksb5HY0QX3iRAg false   0       []\r\n1111    &lt;rabbit@\u2605&gt; amq.ctag-xb6boiuc_Ee1girva-GdkQ false   0       []\r\n1111    &lt;rabbit@\u2605&gt; amq.ctag-jV7AUun3pc-FyFcK9M_Owg false   0       []\r\n1111    &lt;rabbit@\u2605&gt;  amq.ctag-Jdt5oPqW4mtCerlx8dUIOw false   0       []\r\n1111    &lt;rabbit@\u2605&gt; amq.ctag-55NHUikpOIFTxgxOEcipsg false   0       []\r\n<\/code><\/pre>\n<p>\u30b3\u30f3\u30b7\u30e5\u30fc\u30de\u30fc\u306f\u3000\u3044\u3063\u3071\u3044\u3044\u308b\u306e\u306b\u306a\u3002\u3058\u3083\u3042\u3001\u3053\u3044\u3064\u3089\u304c\u53d6\u308a\u5408\u3063\u3066\u308b\u306a\u3093\u3066\u3053\u3068\u304c\u3042\u308b\u306e\u3060\u308d\u3046\u304b\uff1f<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep rabbit\r\nroot     12122  0.0  0.0   4500     0 ?        S    Mar07   0:00 \/bin\/sh \/usr\/sbin\/rabbitmq-server\r\nroot     12129  0.0  0.0  55128     0 ?        S    Mar07   0:00 su rabbitmq -s \/bin\/sh -c \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 12130  0.0  0.0   4500     8 ?        Ss   Mar07   0:00 sh -c \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 12131  0.0  0.0   4500     0 ?        S    Mar07   0:00 \/bin\/sh -e \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 12237  0.6  2.6 2712560 27192 ?       Sl   Mar07  27:01 \/usr\/lib\/erlang\/erts-8.1\/bin\/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -zdbbl 32000 -K true -B i -- -root \/usr\/lib\/erlang -progname erl -- -home \/var\/lib\/rabbitmq -- -pa \/usr\/lib\/rabbitmq\/lib\/rabbitmq_server-3.6.6\/ebin -noshell -noinput -s rabbit boot -sname rabbit@\u2605 -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,\"\/var\/log\/rabbitmq\/rabbit@\u2605.log\"} -rabbit sasl_error_logger {file,\"\/var\/log\/rabbitmq\/rabbit@\u2605-sasl.log\"} -rabbit enabled_plugins_file \"\/etc\/rabbitmq\/enabled_plugins\" -rabbit plugins_dir \"\/usr\/lib\/rabbitmq\/lib\/rabbitmq_server-3.6.6\/plugins\" -rabbit plugins_expand_dir \"\/var\/lib\/rabbitmq\/mnesia\/rabbit@\u2605-plugins-expand\" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir \"\/var\/lib\/rabbitmq\/mnesia\/rabbit@\u2605\" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672\r\nrabbitmq 12333  0.0  0.0   4356    72 ?        Ss   Mar07   0:18 erl_child_setup 1024\r\nrabbitmq 12343  0.0  0.0  13676    36 ?        Ss   Mar07   0:00 inet_gethost 4\r\nrabbitmq 12344  0.0  0.0  15796   228 ?        S    Mar07   0:01 inet_gethost 4\r\nroot     27067  0.0  0.0  12936   988 pts\/4    S+   08:07   0:00 grep --color=auto rabbit\r\nrabbitmq 27670  0.0  0.0  13848   252 ?        S    Mar06   0:11 \/usr\/lib\/erlang\/erts-8.1\/bin\/epmd -daemon\r\n<\/code><\/pre>\n<p>\u55ef\u3002<\/p>\n<p>\u96be\u9053\u3002<\/p>\n<pre class=\"post-pre\"><code>\/home\/\u2605user\/shogi\/php_log# ls -an\r\ntotal 8\r\ndrwxr-xr-x  2 0 0 4096 Mar  8 09:50 .\r\ndrwxr-xrwx 20 0 0 4096 Mar 10 06:04 ..\r\n-rw-r--r--  1 0 0    0 Mar 10 08:05 dequeueBroker.err.log\r\n-rw-r--r--  1 0 0    0 Mar 10 08:05 dequeueBroker.out.log\r\n<\/code><\/pre>\n<p>\u66f4\u65b0\u65f6\u95f4\u5df2\u66f4\u65b0\u3002<br \/>\n\u4f46\u662f\u5185\u5bb9\u662f\u7a7a\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep dequeueBroker.php\r\nroot     20224  0.0  1.3 232308 14060 ?        S    04:05   0:01 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     21242  0.0  1.3 232308 14060 ?        S    05:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     22336  0.0  1.3 232308 14056 ?        S    06:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     25095  0.0  1.3 232308 14044 ?        S    07:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     26770  0.0  1.3 232308 14040 ?        S    08:05   0:00 \/usr\/bin\/php \/home\/\u2605user\/shogi\/php_service\/dequeueBroker.php\r\nroot     27318  0.0  0.0  13068   988 pts\/4    S+   08:19   0:00 grep --color=auto dequeueBroker.php\r\n<\/code><\/pre>\n<p>\u4f60\u770b\u770b\u6709\u6ca1\u6709\u57285\u5206\u949f\u5185\u589e\u52a0\u4e86dequeueBroker.php\u3002<\/p>\n<p>\u3053\u3093\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u306f Cron \u3060\u308d\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code># sudo crontab -e\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># Edit this file to introduce tasks to be run by cron.\r\n#\r\n# Each task to run has to be defined through a single line\r\n# indicating with different fields when the task will be run\r\n# and what command to run for the task\r\n#\r\n# To define the time you can provide concrete values for\r\n# minute (m), hour (h), day of month (dom), month (mon),\r\n# and day of week (dow) or use '*' in these fields (for 'any').#\r\n# Notice that tasks will be started based on the cron's system\r\n# daemon's notion of time and timezones.\r\n#\r\n# Output of the crontab jobs (including errors) is sent through\r\n# email to the user the crontab file belongs to (unless redirected).\r\n#\r\n# For example, you can run a backup of all your user accounts\r\n# at 5 a.m every week with:\r\n# 0 5 * * 1 tar -zcf \/var\/backups\/home.tgz \/home\/\r\n#\r\n# For more information see the manual pages of crontab(5) and cron(8)\r\n#\r\n# m h  dom mon dow   command\r\n#0-59\/30 * * * * \/bin\/bash \/home\/\u2605user\/shogi\/bash_service\/tamesi12.sh\r\n5 * * * * \/bin\/bash \/home\/\u2605user\/shogi\/bash_service\/kicker_dequeueBroker.sh\r\n<\/code><\/pre>\n<p>\u563f\uff0c\u770b\uff0c\u6709\u4e86\u3002\u6211\u6765\u6ce8\u91ca\u4e00\u4e0b\u3002<br \/>\n\u4e5f\u4e00\u8d77\u7ed3\u675f\u6389\u8fd9\u4e2a\u8fdb\u7a0b\u3002<\/p>\n<pre class=\"post-pre\"><code>kill `ps aux | grep dequeueBroker.php | sed 's\/[\\t ]\\+\/\\t\/g' | cut -f 2`\r\n# ps aux | grep dequeueBroker.php\r\nroot     27385  0.0  0.0  12936   988 pts\/4    S+   08:23   0:00 grep --color=auto dequeueBroker.php\r\n<\/code><\/pre>\n<p>\u518d\u6765\u4e00\u6b21\u3002\u8fd9\u6b21\u662f\u5728\u7b2c14\u6b21\u5c1d\u8bd5\u4e2d\u4f7f\u7528Enqueue\u3002<\/p>\n<p>http:\/\/\u2605.\u2605.\u2605.\u2605\/tamesi14.php<\/p>\n<p>\u3042\u3063\u3001\u305f\u3081\u3057\u3055\u3093\uff11\uff14\u306b\u30d0\u30b0\u304c\u3042\u308b\u3002\u76f4\u305d\u3046\u3002<br \/>\n\u3068\u601d\u3063\u305f\u3089\u3000\u30d0\u30b0\u306f\u7121\u304b\u3063\u305f\u306e\u3067\u3000\u76f4\u3055\u306a\u304b\u3063\u305f\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    0\r\n<\/code><\/pre>\n<p>\u30a8\u30f3\u30ad\u30e5\u30fc\u3055\u308c\u3066\u306a\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>chmod 666 dequeueBroker.err.log\r\nchmod 666 dequeueBroker.out.log\r\n<\/code><\/pre>\n<h1>\u91cd\u65b0\u542f\u52a8RabbitMQ<\/h1>\n<p>\u6ca1\u6709\u5176\u4ed6\u9009\u62e9\u3002\u90a3\u5c31\u8bd5\u7740\u91cd\u65b0\u542f\u52a8RabbitMQ\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl stop\r\nStopping and halting node 'rabbit@\u2605' ...\r\n[1]+  Done                    .\/tamesi29a9_main.exe  (wd: \/home\/\u2605user\/shogi\/cpp_service)\r\n(wd now: \/var\/www\/html)\r\n# rabbitmq-server\r\n\r\n              RabbitMQ 3.6.6. Copyright (C) 2007-2016 Pivotal Software, Inc.\r\n  ##  ##      Licensed under the MPL.  See http:\/\/www.rabbitmq.com\/\r\n  ##  ##\r\n  ##########  Logs: \/var\/log\/rabbitmq\/rabbit@tk2-217-18401.log\r\n  ######  ##        \/var\/log\/rabbitmq\/rabbit@tk2-217-18401-sasl.log\r\n  ##########\r\n              Starting broker...\r\n completed with 0 plugins.\r\n\r\n<\/code><\/pre>\n<p>\u6309\u4f4f[Ctrl]\u952e\u518d\u6309[Z]\u952e<\/p>\n<pre class=\"post-pre\"><code># bg 1\r\n<\/code><\/pre>\n<p>\u4f60\u60f3\u770b\u770b\u65e5\u5fd7\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code>cd \/var\/log\/rabbitmq\r\n<\/code><\/pre>\n<p>\u55ef\u3002<\/p>\n<p>\u4e4b\u524dPHP\u7684Enqueue\u662f\u80fd\u591f\u5de5\u4f5c\u7684\uff0c\u4f46\u4eca\u5929\u4f3c\u4e4e\u4e0d\u884c\u4e86\u3002<\/p>\n<p>\u6682\u65f6\u5c1d\u8bd5\u6572\u51fb\u793a\u4f8b2\u30013\u548c5\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    1\r\n<\/code><\/pre>\n<p>\u55ef\uff1f<\/p>\n<p>\u90a3\u4e48\uff0c\u8ba9\u6211\u4eec\u8bd5\u7740\u6572\u51fb\u4e00\u4e0bTamashii\u3002<\/p>\n<p>\u4e0d\u53d8\u7684\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u6211\u4eec\u6765\u6253\u5f00\u201c\u305f\u3081\u3057\u3055\u3093\uff13\u201d\u8bd5\u4e00\u8bd5\u3002<\/p>\n<p>\u4e0d\u53d8\u7684\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u8ba9\u6211\u4eec\u8bd5\u7740\u6572\u51fb\u4e00\u4e0bTameshi\u5148\u751f5\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    2\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c\u8ba9\u6211\u4eec\u6765\u8bd5\u8bd5\u6253\u51fbTameshi San 14\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    3\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0cRabbitMQ\u6ca1\u6709\u8fd0\u884c\u5417\uff1f\u73b0\u5728\u5b83\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u4f46\u90a3\u5c31\u8bd5\u8bd5\u9000\u51fa\u767b\u5f55\u5427\u3002<\/p>\n<pre class=\"post-pre\"><code># logout\r\n$ logout\r\n<\/code><\/pre>\n<p>\u91cd\u65b0\u767b\u5f55\u3002<\/p>\n<pre class=\"post-pre\"><code># sudo su -\r\n\u203b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u308c\u308b\r\n# jobs\r\n<\/code><\/pre>\n<p>\u7a7a\u65e0\u4e00\u7269\u3002<\/p>\n<pre class=\"post-pre\"><code># ps aux | grep rabbit\r\nrabbitmq 27670  0.0  0.0  13848   252 ?        S    Mar06   0:12 \/usr\/lib\/erlang\/erts-8.1\/bin\/epmd -daemon\r\nroot     27924  0.0  0.0   4500   660 ?        S    08:33   0:00 \/bin\/sh \/usr\/sbin\/rabbitmq-server\r\nroot     27931  0.0  0.1  55128  1820 ?        S    08:33   0:00 su rabbitmq -s \/bin\/sh -c \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 27932  0.0  0.0   4500   656 ?        Ss   08:33   0:00 sh -c \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 27933  0.0  0.0   4500   756 ?        S    08:33   0:00 \/bin\/sh -e \/usr\/lib\/rabbitmq\/bin\/rabbitmq-server\r\nrabbitmq 28038  0.9  5.8 2698680 59836 ?       Sl   08:33   0:09 \/usr\/lib\/erlang\/erts-8.1\/bin\/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -zdbbl 32000 -K true -B i -- -root \/usr\/lib\/erlang -progname erl -- -home \/var\/lib\/rabbitmq -- -pa \/usr\/lib\/rabbitmq\/lib\/rabbitmq_server-3.6.6\/ebin -noshell -noinput -s rabbit boot -sname rabbit@tk2-217-18401 -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,\"\/var\/log\/rabbitmq\/rabbit@tk2-217-18401.log\"} -rabbit sasl_error_logger {file,\"\/var\/log\/rabbitmq\/rabbit@tk2-217-18401-sasl.log\"} -rabbit enabled_plugins_file \"\/etc\/rabbitmq\/enabled_plugins\" -rabbit plugins_dir \"\/usr\/lib\/rabbitmq\/lib\/rabbitmq_server-3.6.6\/plugins\" -rabbit plugins_expand_dir \"\/var\/lib\/rabbitmq\/mnesia\/rabbit@tk2-217-18401-plugins-expand\" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir \"\/var\/lib\/rabbitmq\/mnesia\/rabbit@tk2-217-18401\" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672\r\nrabbitmq 28135  0.0  0.0   4356   524 ?        Ss   08:33   0:00 erl_child_setup 1024\r\nrabbitmq 28145  0.0  0.0  13676   468 ?        Ss   08:33   0:00 inet_gethost 4\r\nrabbitmq 28146  0.0  0.0  15796   608 ?        S    08:33   0:00 inet_gethost 4\r\nroot     29169  0.0  0.0  12936   988 pts\/0    S+   08:49   0:00 grep --color=auto rabbit\r\n<\/code><\/pre>\n<p>\u55ef\uff0c\u770b\u4e86\u4e5f\u4e0d\u61c2\u3002<\/p>\n<p>\u6211\u8bd5\u7740\u8bbf\u95ee\u4e86\u793a\u4f8b\u5148\u751f\u7684\u8d26\u6237\u4e94\u6b21\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    5\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c\u867d\u7136\u770b\u4e0d\u89c1\u5de5\u4f5c\uff0c\u4f46\u5b83\u5728\u8fd0\u884c\u5417\uff1f<br \/>\n\u5982\u679c\u662f\u8fd9\u6837\uff0c\u90a3\u4e48 .cpp \u6587\u4ef6\u5462\uff1f<\/p>\n<pre class=\"post-pre\"><code># cd \/home\/\u2605user\/shogi\/cpp_service\r\n# .\/tamesi29a9_main.exe\r\ndeclared queue 1111\r\n\r\n<\/code><\/pre>\n<p>\u4ec0\u4e48\u90fd\u6ca1\u53d8\u3002\u867d\u7136\u786e\u5b9e\u53ef\u80fd\u628a\u961f\u5217\u7684\u540d\u79f0\u53d6\u51fa\u6765\u4e86\uff0c\u4f46\u8981\u53d6\u5f97\u6d88\u606f\u600e\u4e48\u529e\u5462\uff1f<\/p>\n<p>\u4f60\u5728\u5199\u5417\uff1f<\/p>\n<p>\u300cAMQP-CPP\u300d\uff08CopernicaMarketingSoftware\/AMQP-CPP\uff09<br \/>\nhttps:\/\/github.com\/CopernicaMarketingSoftware\/AMQP-CPP<\/p>\n<h1>29A-10, Mr. Tameshi.<\/h1>\n<p>tamesi29a10_main.cpp\u7684\u4e2d\u6587\u91cd\u65b0\u8868\u8ff0\uff1atamesi29a10\u4e3b\u8981\u7a0b\u5e8f.cpp\u3002<\/p>\n<pre class=\"post-pre\"><code>#include &lt;ev.h&gt;\r\n#include &lt;amqpcpp.h&gt;\r\n#include &lt;amqpcpp\/libev.h&gt;\r\n\r\nint main()\r\n{\r\n    \/\/ access to the event loop\r\n    auto *loop = EV_DEFAULT;\r\n\r\n    \/\/ handler for libev (so we don't have to implement AMQP::TcpHandler!)\r\n    AMQP::LibEvHandler handler(loop);\r\n\r\n    \/\/ make a connection\r\n    AMQP::TcpConnection connection(&amp;handler, AMQP::Address(\"amqp:\/\/localhost\/\"));\r\n\r\n    \/\/ we need a channel too\r\n    AMQP::TcpChannel channel(&amp;connection);\r\n\r\n\/\/    \/\/ create a temporary queue\r\n\/\/    channel.declareQueue(AMQP::exclusive).onSuccess([&amp;connection](const std::string &amp;name, uint32_t messagecount, uint32_t consumercount) {\r\n\/\/\r\n\/\/        \/\/ report the name of the temporary queue\r\n\/\/        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\/\/\r\n\/\/        \/\/ now we can close the connection\r\n\/\/        connection.close();\r\n\/\/    });\r\n    \/\/ create a custom callback\r\n    auto callback = [](const std::string &amp;name, int msgcount, int consumercount) {\r\n\r\n        \/\/ @todo add your own implementation\r\n\r\n        \/\/ report the name of the temporary queue\r\n        std::cout &lt;&lt; \"(^q^)declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\r\n        \/\/ now we can close the connection\r\n        \/\/ connection.close();\r\n    };\r\n    \/\/ declare the queue, and install the callback that is called on success\r\n    channel.declareQueue(\"1111\").onSuccess(callback);\r\n\r\n    \/\/ callback function that is called when the consume operation starts\r\n    auto startCb = [](const std::string &amp;consumertag) {\r\n\r\n        std::cout &lt;&lt; \"(^q^)consume operation started\" &lt;&lt; std::endl;\r\n    };\r\n\r\n    \/\/ callback function that is called when the consume operation failed\r\n    auto errorCb = [](const char *message) {\r\n\r\n        std::cout &lt;&lt; \"(^q^)consume operation failed\" &lt;&lt; std::endl;\r\n    }\r\n\r\n    \/\/ callback operation when a message was received\r\n    auto messageCb = [&amp;channel](const AMQP::Message &amp;message, uint64_t deliveryTag, bool redelivered) {\r\n\r\n        std::cout &lt;&lt; \"(^q^)message received\" &lt;&lt; std::endl;\r\n\r\n        \/\/ acknowledge the message\r\n        channel.ack(deliveryTag);\r\n    }\r\n\r\n    \/\/ start consuming from the queue, and install the callbacks\r\n    channel.consume(\"1111\")\r\n        .onReceived(messageCb)\r\n        .onSuccess(startCb)\r\n        .onError(errorCb);\r\n\r\n    \/\/ run the loop\r\n    ev_run(loop, 0);\r\n\r\n    \/\/ done\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<p>\u8fd9\u662f\u5426\u5408\u9002\u5462\uff1f<\/p>\n<pre class=\"post-pre\"><code># g++ -std=c++11 tamesi29a10_main.cpp -lev -lamqpcpp -pthread -o tamesi29a10_main.exe\r\ntamesi29a10_main.cpp: In function \u2018int main()\u2019:\r\ntamesi29a10_main.cpp:55:5: error: expected \u2018,\u2019 or \u2018;\u2019 before \u2018auto\u2019\r\n     auto messageCb = [&amp;channel](const AMQP::Message &amp;message, uint64_t deliveryTag, bool redelivered) {\r\n     ^\r\ntamesi29a10_main.cpp:65:21: error: \u2018messageCb\u2019 was not declared in this scope\r\n         .onReceived(messageCb)\r\n                     ^\r\n<\/code><\/pre>\n<p>\u53ef\u80fd\u6837\u672c\u7a0b\u5e8f\u6709\u6ca1\u6709\u6f0f\u4e86\u5206\u53f7\u3002<\/p>\n<p>\u300c\u793a\u4f8b\u7a0b\u5e8f\u4e2d\u7f3a\u5c11\u5206\u53f7\u3002\u300d\uff08CopernicaMarketingSoftware\/AMQP-CPP\uff09<br \/>\nhttps:\/\/github.com\/CopernicaMarketingSoftware\/AMQP-CPP\/issues\/119<\/p>\n<p>\u6211\u5df2\u7ecf\u9001\u4e86\u3002<\/p>\n<p>\u597d\u7684\uff0c\u7f16\u8bd1\u4e5f\u901a\u8fc7\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code># .\/tamesi29a10_main.exe\r\n(^q^)declared queue 1111\r\n(^q^)consume operation started\r\n(^q^)message received\r\n(^q^)message received\r\n(^q^)message received\r\n(^q^)message received\r\n(^q^)message received\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u6309\u4e0b[Ctrl]+[C]\u7ec4\u5408\u952e\u9000\u51fa\u3002<\/p>\n<p>\u786e\u5b9e\uff0c\u51fa\u73b0\u4e86\u4e94\u53ea\u732b\uff0c\u8fd9\u662f\u6b63\u786e\u7684\u3002\u4f46\u662f\uff0c\u8bf7\u5e2e\u5fd9\u6361\u8d77\u8fd9\u4e2a\u4fe1\u606f\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    0\r\n<\/code><\/pre>\n<p>\u5df2\u7ecf\u7a7a\u4e86\u3002<\/p>\n<p>\u8fd9\u6837\u6539\u9020\u4e4b\u540e\u600e\u6837\uff1f<\/p>\n<p>tamesi29a10_main.cpp\u7684\u6c49\u8bed\u7ffb\u8bd1\u4e0d\u53ef\u7528\u3002<\/p>\n<pre class=\"post-pre\"><code>#include &lt;ev.h&gt;\r\n#include &lt;amqpcpp.h&gt;\r\n#include &lt;amqpcpp\/libev.h&gt;\r\n\r\nint main()\r\n{\r\n    \/\/ access to the event loop\r\n    auto *loop = EV_DEFAULT;\r\n\r\n    \/\/ handler for libev (so we don't have to implement AMQP::TcpHandler!)\r\n    AMQP::LibEvHandler handler(loop);\r\n\r\n    \/\/ make a connection\r\n    AMQP::TcpConnection connection(&amp;handler, AMQP::Address(\"amqp:\/\/localhost\/\"));\r\n\r\n    \/\/ we need a channel too\r\n    AMQP::TcpChannel channel(&amp;connection);\r\n\r\n\/\/    \/\/ create a temporary queue\r\n\/\/    channel.declareQueue(AMQP::exclusive).onSuccess([&amp;connection](const std::string &amp;name, uint32_t messagecount, uint32_t consumercount) {\r\n\/\/\r\n\/\/        \/\/ report the name of the temporary queue\r\n\/\/        std::cout &lt;&lt; \"declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\/\/\r\n\/\/        \/\/ now we can close the connection\r\n\/\/        connection.close();\r\n\/\/    });\r\n    \/\/ create a custom callback\r\n    auto callback = [](const std::string &amp;name, int msgcount, int consumercount) {\r\n\r\n        \/\/ @todo add your own implementation\r\n\r\n        \/\/ report the name of the temporary queue\r\n        std::cout &lt;&lt; \"(^q^)declared queue \" &lt;&lt; name &lt;&lt; std::endl;\r\n\r\n        \/\/ now we can close the connection\r\n        \/\/ connection.close();\r\n    };\r\n    \/\/ declare the queue, and install the callback that is called on success\r\n    channel.declareQueue(\"1111\").onSuccess(callback);\r\n\r\n    \/\/ callback function that is called when the consume operation starts\r\n    auto startCb = [](const std::string &amp;consumertag) {\r\n\r\n        \/\/ std::cout &lt;&lt; \"(^q^)consume operation started\" &lt;&lt; std::endl;\r\n        std::cout &lt;&lt; \"(^q^)consume operation started [\" &lt;&lt; consumertag &lt;&lt; \"]\" &lt;&lt; std::endl;\r\n    };\r\n\r\n    \/\/ callback function that is called when the consume operation failed\r\n    auto errorCb = [](const char *message) {\r\n\r\n        \/\/ std::cout &lt;&lt; \"(^q^)consume operation failed\" &lt;&lt; std::endl;\r\n        std::cout &lt;&lt; \"(^q^)consume operation failed [\" &lt;&lt; &amp;message &lt;&lt; \"]\" &lt;&lt; std::endl;\r\n    };\r\n\r\n    \/\/ callback operation when a message was received\r\n    auto messageCb = [&amp;channel](const AMQP::Message &amp;message, uint64_t deliveryTag, bool redelivered) {\r\n\r\n        \/\/ std::cout &lt;&lt; \"(^q^)message received\" &lt;&lt; std::endl;\r\n        std::cout &lt;&lt; \"(^q^)message received [\" &lt;&lt; &amp;message &lt;&lt; \"]\" &lt;&lt; std::endl;\r\n\r\n        \/\/ acknowledge the message\r\n        channel.ack(deliveryTag);\r\n    };\r\n\r\n    \/\/ start consuming from the queue, and install the callbacks\r\n    channel.consume(\"1111\")\r\n        .onReceived(messageCb)\r\n        .onSuccess(startCb)\r\n        .onError(errorCb);\r\n\r\n    \/\/ run the loop\r\n    ev_run(loop, 0);\r\n\r\n    \/\/ done\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<p>\u305f\u3081\u3057\u3055\u3093\uff11\uff14\u3000\u3092\u4f7f\u3063\u3066\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30a8\u30f3\u30ad\u30e5\u30fc\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"post-pre\"><code># rabbitmqctl list_queues\r\nListing queues ...\r\n1111    6\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># .\/tamesi29a10_main.exe\r\n(^q^)declared queue 1111\r\n(^q^)consume operation started [amq.ctag-f9-pEPIwqTgyCHuhYm4wiA]\r\n(^q^)message received [0xc87ea0]\r\n(^q^)message received [0xc87ea0]\r\n(^q^)message received [0xc87ea0]\r\n(^q^)message received [0xc87ea0]\r\n(^q^)message received [0xc87ea0]\r\n(^q^)message received [0xc87ea0]\r\n<\/code><\/pre>\n<p>\u306c\u304e\u304e\uff01\u3000\u30e1\u30c3\u30bb\u30fc\u30b8\u3060\u3051\u3000\u306a\u3093\u3068\u304b\u306a\u308c\u3070\u3044\u3044\u3002\u3057\u304b\u3057\u7570\u306a\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u3063\u305f\u306e\u306b\u5168\u90e8\u30000xc87ea0\u3000\u3068\u306f\u3069\u3046\u3044\u3046\u3053\u3068\u3060\u3002<br \/>\n\u4f55\u304b\u306e\u30e1\u30e2\u30ea\u30fb\u30a2\u30c9\u30ec\u30b9\u304b\uff1f<\/p>\n<h1>AMQP::\u6d88\u606f<\/h1>\n<p>AMQP\u6d88\u606f\u4e0d\u662f\u5b57\u7b26\u4e32\u5417\uff1f<\/p>\n<h2>\/usr\/include\/amqpcpp.h \u53ef\u4ee5\u88ab\u4e2d\u6587\u5316\u4e3a &#8220;\/usr\/include\/amqpcpp.h&#8221;\u3002<\/h2>\n<p>\/usr \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e0b\u3092\u63a2\u3057\u3066\u3044\u308b\u3068\u3001<br \/>\n\/usr\/include\/amqpcpp.h \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u305f\u3002<\/p>\n<p>\u770b\u8d77\u6765\u76ee\u5f55\u4e2d\u8fd8\u6709\u4e00\u4e2a\u5934\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>\/usr\/include\/amqpcpp# ls\r\naddress.h     channel.h            copiedbuffer.h          deferredget.h    exception.h     libevent.h  monitor.h            stringfield.h    watchable.h\r\narray.h       channelimpl.h        decimalfield.h          deferred.h       exchangetype.h  libev.h     numericfield.h       table.h\r\nbooleanset.h  classes.h            deferredcancel.h        deferredqueue.h  field.h         libuv.h     outbuffer.h          tcpchannel.h\r\nbuffer.h      connection.h         deferredconsumerbase.h  endian.h         fieldproxy.h    login.h     protocolexception.h  tcpconnection.h\r\nbytebuffer.h  connectionhandler.h  deferredconsumer.h      entityimpl.h     flags.h         message.h   receivedframe.h      tcpdefines.h\r\ncallbacks.h   connectionimpl.h     deferreddelete.h        envelope.h       frame.h         metadata.h  stack_ptr.h          tcphandler.h\r\n<\/code><\/pre>\n<p>message.h \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u6c17\u306b\u306a\u308b\u3002<br \/>\n\u8457\u4f5c\u8868\u8a18\u3092\u898b\u308b\u3068\u3001Copernica BV \u3068\u3044\u3046\u3068\u3053\u308d\u304c\u4f5c\u3063\u3066\u3044\u308b\u307f\u305f\u3044\u3060\u3002<\/p>\n<p>const std::string &amp;exchange() const<br \/>\n\u3068\u3001<br \/>\nconst std::string &amp;routingkey() const<\/p>\n<p>\u6211\u53ea\u80fd\u8bbf\u95ee\u8fd9\u4e48\u591a\u4e1c\u897f\u3002<\/p>\n<pre class=\"post-pre\"><code>        std::cout &lt;&lt; \"(^q^)message received exchange=[\" &lt;&lt; &amp;message.exchange() &lt;&lt; \"] routingkey=[\" &lt;&lt; &amp;message.routingkey() &lt;&lt; \"]\" &lt;&lt; std::endl;\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># .\/tamesi29a10_main.exe\r\n(^q^)declared queue 1111\r\n(^q^)consume operation started [amq.ctag-baH5AqjR3dg-pmSMobsugg]\r\n(^q^)message received exchange=[0xcdf0d8] routingkey=[0xcdf0f8]\r\n(^q^)message received exchange=[0xcdf0d8] routingkey=[0xcdf0f8]\r\n<\/code><\/pre>\n<p>\u8fd9\u662f\u4e0d\u4e00\u6837\u7684\u5417\uff1f<\/p>\n<p>Message \u30af\u30e9\u30b9\u306f Envelope \u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u306e\u3067\u3001Envelope \u3082\u898b\u3066\u307f\u3088\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>    \/**\r\n     *  Access to the full message data\r\n     *  @return buffer\r\n     *\/\r\n    const char *body() const\r\n    {\r\n        return _body;\r\n    }\r\n<\/code><\/pre>\n<p>\u3053\u3093\u306a\u306e\u304c\u3042\u308b\u3002<\/p>\n<pre class=\"post-pre\"><code>        std::cout &lt;&lt; \"(^q^)message received body=[\" &lt;&lt; message.body() &lt;&lt; \"]\" &lt;&lt; std::endl;\r\n<\/code><\/pre>\n<p>\u8fd8\u6709\uff0c\u5934\u4e0a\u7684\u201c&amp;\u201d\u7b26\u53f7\u662f\u4e0d\u662f\u4e0d\u9700\u8981\u5462\uff1f<\/p>\n<pre class=\"post-pre\"><code># .\/tamesi29a10_main.exe\r\n(^q^)declared queue 1111\r\n(^q^)consume operation started [amq.ctag-FYCpWCbtuoRvXl4XoRReHA]\r\n(^q^)message received body=[ClickSitanDaze\u2592YCpWCbtuoRvXl4XoRReHA]\r\n(^q^)message received body=[Dragon\u2592]\r\n(^q^)message received body=[Tiger\u2592]\r\n<\/code><\/pre>\n<p>\u3088\u3057\u304d\u305f\u9053\u4e2d\u3002\u306a\u3093\u304b\u3000\u8b0e\u306e\u6587\u5b57\u304c\u5f8c\u308d\u306b\u3064\u3044\u3066\u3044\u308b\u304c\u2026\u2026\u3002<\/p>\n<pre class=\"post-pre\"><code>    \/**\r\n     *  Size of the body\r\n     *  @return uint64_t\r\n     *\/\r\n    uint64_t bodySize() const\r\n    {\r\n        return _bodySize;\r\n    }\r\n<\/code><\/pre>\n<p>\u7528\u4e2d\u6587\u6765\u8bf4\uff0c\u5c31\u662f\u5b57\u7b26\u4e32\u7684\u5927\u5c0f\uff0c\u660e\u767d\u5417\uff1f\u8981\u600e\u4e48\u4f7f\u7528\u5462\uff1f<\/p>\n<p>\u300cconvert a char* to std::string\u300d\uff08stack overflow\uff09<br \/>\nhttp:\/\/stackoverflow.com\/questions\/1195675\/convert-a-char-to-stdstring<\/p>\n<pre class=\"post-pre\"><code>        std::string myString(message.body(), message.bodySize());\r\n        std::cout &lt;&lt; \"(^q^)message received myString=[\" &lt;&lt; myString &lt;&lt; \"]\" &lt;&lt; std::endl;\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># .\/tamesi29a10_main.exe\r\n(^q^)declared queue 1111\r\n(^q^)consume operation started [amq.ctag-M2QG32xTPEkdEn-Swcl2Sw]\r\n(^q^)message received myString=[Tiger]\r\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u5148\u4e0d\u7ba1\u5b83\uff0c\u7b49\u4e00\u4e0b\u518d\u603b\u7ed3\u6210\u53e6\u4e00\u7bc7\u6587\u7ae0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6a31\u82b1VPS\u7684\u8bd5\u7528\u671f\u4e3a\u4e24\u5468\uff0c\u4f46\u6211\u8fd8\u65e0\u6cd5\u5c06\u7a0b\u5e8f\u5e38\u9a7b\u3002 \u3067\u3001\u3055\u3063\u3055\u3068\u6700\u512a\u5148\u3067\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5e38\u99d0\u3000\u304c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3000\u8abf\u3079 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34811","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668-\uff1c\u7b2c\u516d\u90e8\u5206\uff1e\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e\" \/>\n<meta property=\"og:description\" content=\"\u6a31\u82b1VPS\u7684\u8bd5\u7528\u671f\u4e3a\u4e24\u5468\uff0c\u4f46\u6211\u8fd8\u65e0\u6cd5\u5c06\u7a0b\u5e8f\u5e38\u9a7b\u3002 \u3067\u3001\u3055\u3063\u3055\u3068\u6700\u512a\u5148\u3067\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5e38\u99d0\u3000\u304c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3000\u8abf\u3079 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668-\uff1c\u7b2c\u516d\u90e8\u5206\uff1e\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-08T13:16:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T23:27:18+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u96c5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u96c5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"37 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/\",\"name\":\"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-10-08T13:16:25+00:00\",\"dateModified\":\"2024-04-29T23:27:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\",\"name\":\"\u79d1, \u96c5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u96c5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668-\uff1c\u7b2c\u516d\u90e8\u5206\uff1e\/","og_locale":"zh_CN","og_type":"article","og_title":"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e","og_description":"\u6a31\u82b1VPS\u7684\u8bd5\u7528\u671f\u4e3a\u4e24\u5468\uff0c\u4f46\u6211\u8fd8\u65e0\u6cd5\u5c06\u7a0b\u5e8f\u5e38\u9a7b\u3002 \u3067\u3001\u3055\u3063\u3055\u3068\u6700\u512a\u5148\u3067\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5e38\u99d0\u3000\u304c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3000\u8abf\u3079 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668-\uff1c\u7b2c\u516d\u90e8\u5206\uff1e\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-08T13:16:25+00:00","article_modified_time":"2024-04-29T23:27:18+00:00","author":"\u79d1, \u96c5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u96c5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"37 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/","name":"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-10-08T13:16:25+00:00","dateModified":"2024-04-29T23:27:18+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u642d\u5efa\u4e0e\u7535\u8111\u5c06\u68cb\u8f6f\u4ef6\u5bf9\u5c40\u7684\u670d\u52a1\u5668 \uff1c\u7b2c\u516d\u90e8\u5206\uff1e"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a","name":"\u79d1, \u96c5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","caption":"\u79d1, \u96c5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%94%b5%e8%84%91%e5%b0%86%e6%a3%8b%e8%bd%af%e4%bb%b6%e5%af%b9%e5%b1%80%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8-%ef%bc%9c%e7%ac%ac%e5%85%ad%e9%83%a8%e5%88%86%ef%bc%9e\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=34811"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34811\/revisions"}],"predecessor-version":[{"id":90529,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34811\/revisions\/90529"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=34811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=34811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=34811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}