[Help] - Managing multiple servers from one application

agolangf · · 526 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hey, I&#39;m a newbie to go (though it&#39;s super easy to pick up!) and am working on a simple web app with Revel to manage a number of servers.</p> <p>I&#39;ve got my code working great on my single system, but I&#39;m not sure what &#39;best practice&#39; would be to start talking across the network to other boxes where I need to get information and run various commands.</p> <p>You could think of it as the same way as ssh-ing into various servers, getting data about it, and taking whatever actions in the shell.</p> <p>Anyway, I GUESS I could use &#34;os/exec&#34; but that seems hacky when I should be able to set up something a bit better.</p> <p>Thanks in advance for your thoughts on this!</p> <hr/>**评论:**<br/><br/>ask: <pre><p>The question is a little like &#34;what kind of engine should I use?&#34; without information about the application -- Car? Race car? Truck? Bike? Airplane? How big?</p> <p>A typical simple solution would be exposing the functions you need as HTTP APIs and use those. Depending on your requirements you can make it ever more complicated with an external queue or messaging system, etc etc.</p> <p>A good place to start is just an HTTP/JSON API.</p></pre>rco8786: <pre><p>This is only semi-sarcastic, and I might get the downvotes, but you should read everything here: <a href="https://dancres.github.io/Pages/" rel="nofollow">https://dancres.github.io/Pages/</a></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

526 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传