<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[运维进行时]]></title> 
<link>https://blog.liuts.com/index.php</link> 
<description><![CDATA[互联网运维与架构]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[运维进行时]]></copyright>
<item>
<link>https://blog.liuts.com/post/246/</link>
<title><![CDATA[《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>刘天斯 &lt;liutiansi@gmail.com&gt;</author>
<category><![CDATA[Python]]></category>
<pubDate>Sat, 20 Dec 2014 22:34:26 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/</guid> 
<description>
<![CDATA[ 
	<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主控端是OMServer的核心角色，负责接收加密的协议串且进行解密，解析成OMServer调用的任务模块，同时结合角色中的saltstack、ansible或func组件，向目标业务服务器集群（被控机）发送执行任务，执行完毕后，将返回的执行结果加解密处理，最后逐级返回给系统管理员，角色所在位置见以下架构图：<br/><a href="https://blog.liuts.com/attachment.php?fid=366" target="_blank"><img src="https://blog.liuts.com/attachment.php?fid=366" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><strong>一、环境部署</strong><br/>1、部署saltstack、ansible或func组件，详细见本书相关章节，此处省略；<br/><br/>2、安装rpyc模块<br/><textarea name="code" class="c" rows="15" cols="100">
# wget https://pypi.python.org/packages/source/r/rpyc/rpyc-3.2.3.tar.gz --no-check-certificate
# tar -zxvf rpyc-3.2.3.tar.gz
# cd rpyc-3.2.3
# python setup.py install
</textarea><br/>3、下载主控端源码<br/>#cd /home <br/>download github地址：https://github.com/yorkoliu/pyauto/tree/master/第十三章/OMServer<br/><br/>修改OMServer/config.py主配置文件<br/><textarea name="code" class="python" rows="15" cols="100">
# -*- coding: utf-8 -*-
#!/usr/bin/env python
AUTO_PLATFORM = "saltstack"&nbsp;&nbsp;&nbsp;&nbsp;#指定组件环境，支持saltstack、ansible、func

#密钥，与项目中setting.py的SECRET_KEY变量保持一致
SECRET_KEY = "ctmj#&amp;8hrgow_^sj$ejt@9fzsmh_o)-=(byt5jmg=e3#foya6u"
</textarea><br/>4、编写任务模块<br/>&nbsp;&nbsp;&nbsp;&nbsp;1）在WEB前端点击【添加模块】，指定模块名称、描述、参数接口信息，提交后记录生成的模块ID（数字）；<br/>&nbsp;&nbsp;&nbsp;&nbsp;2）在主控端OMServer/modules目录存放了各个组件的模块，以不同目录名作为区分，任务模块名称由“Mid_”+模块ID组成，与前端生成的模块ID进行关联，如Mid_1007.py，可参考现有示例进行修改。<br/><br/>5、启动服务<br/><textarea name="code" class="c" rows="15" cols="100">
&nbsp;&nbsp;&nbsp;&nbsp;# cd /home/OMServer
&nbsp;&nbsp;&nbsp;&nbsp;# python OMservermain.py &

&nbsp;&nbsp;&nbsp;&nbsp;检查11511端口是否已监听
&nbsp;&nbsp;&nbsp;&nbsp;# netstat -an&#124;grep 11511
</textarea><br/><br/><strong>二、校验环境</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最后，打开浏览器访问http://omserver.domain.com（自定义域名，可通过修改hosts实现），效果图如下。<br/><a href="https://blog.liuts.com/attachment.php?fid=367" target="_blank"><img src="https://blog.liuts.com/attachment.php?fid=367" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><strong>三、基于Python构建可扩展的自动化运维平台（WOT分享主题）</strong><br/><iframe src="//www.slideshare.net/slideshow/embed_code/42901993?startSlide=2" width="510" height="420" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/liutiansi/python-42901993" title="基于Python构建可扩展的自动化运维平台" target="_blank">基于Python构建可扩展的自动化运维平台</a> </strong> from <strong><a href="//www.slideshare.net/liutiansi" target="_blank">我在slideshare.net上的所有分享</a></strong> </div><br/>Tags - <a href="https://blog.liuts.com/tags/python%25E8%2587%25AA%25E5%258A%25A8%25E5%258C%2596%25E8%25BF%2590%25E7%25BB%25B4%25EF%25BC%259A%25E6%258A%2580%25E6%259C%25AF%25E4%25B8%258E%25E6%259C%2580%25E4%25BD%25B3%25E5%25AE%259E%25E8%25B7%25B5/" rel="tag">python自动化运维：技术与最佳实践</a> , <a href="https://blog.liuts.com/tags/python/" rel="tag">python</a> , <a href="https://blog.liuts.com/tags/omserver/" rel="tag">omserver</a> , <a href="https://blog.liuts.com/tags/%25E7%258E%25AF%25E5%25A2%2583%25E9%2583%25A8%25E7%25BD%25B2/" rel="tag">环境部署</a>
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2531</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>景天 &lt;25446046@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 28 Dec 2014 15:44:45 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2531</guid> 
<description>
<![CDATA[ 
	好！&nbsp;&nbsp;&nbsp;&nbsp; 为什么安装uwsgi的时候好像出错啊。。core/routing.o:In function &#039;uwsgi_route_condition_regexp&#039;routing.c:(.text+0x2f4c): undefined reference to ‘pcre_free_study’routing.c:(.text+0x2f70):undefined reference to &#039;pcre_free_study&#039;&gt; collect2: ld returned 1 exit status&gt; *** error linking uWSGI ***&gt; make: *** [all] Error 1
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2533</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>景天 &lt;25446046@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 28 Dec 2014 15:57:44 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2533</guid> 
<description>
<![CDATA[ 
	终于安装成功了，是系统自带了pcre 7.8导致的兼容问题吧。
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2543</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>景天 &lt;25446046@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 29 Dec 2014 15:53:04 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2543</guid> 
<description>
<![CDATA[ 
	好。。。书上和源代码 运行的 是 OMServer.py 没有main啊。
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2544</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>景天 &lt;25446046@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 29 Dec 2014 16:08:07 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2544</guid> 
<description>
<![CDATA[ 
	安装部署好了，添加模块还不是很明白，salt等模块里面的Mid_1003等都还需要自己手工添加吗？我看WEB界面最顶上的“查看系统版本、查看内核模块、。。。。”等这些是已经预置进去了吧?
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2545</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>景天 &lt;25446046@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 29 Dec 2014 16:09:09 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2545</guid> 
<description>
<![CDATA[ 
	对了，新的主机什么的 主机组 需要怎么导入啊，不会直接操作MYSQL数据表吧？还是需要自己再写Python脚本导入？
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2555</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>qitan &lt;admin@catjia.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 08 Jan 2015 08:03:33 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2555</guid> 
<description>
<![CDATA[ 
	天斯兄，modules目录下有mid_100*文件，但是运行的时候报 Module &quot;Mid_1008&quot; does not exist, Please add it 。。请问是怎么回事呢
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2556</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>KEVIN &lt;kevin_liusir@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 11 Jan 2015 03:31:00 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2556</guid> 
<description>
<![CDATA[ 
	天斯兄，麻烦看看是什么问题 No hosts found,请确认主机已经添加saltstack环境No minions matched the target. No command was sent, no jid was assigned.
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2563</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>ww &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 12 Feb 2015 03:59:31 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2563</guid> 
<description>
<![CDATA[ 
	搞来搞去。都是&nbsp;&nbsp; 入库失败，请与管理员联系！(1045, &quot;Access denied for user，
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2570</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>奢侈 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 05 Mar 2015 05:18:26 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2570</guid> 
<description>
<![CDATA[ 
	运行出错No hosts found,请确认主机已经添加saltstack环境！直接在master执行 “salt ‘*’ test.ping” 可以返回TRUE请帮忙解答
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/246/#blogcomment2571</link>
<title><![CDATA[[评论] 《python自动化运维：技术与最佳实践》之OMServer平台环境部署详解【主控制端】]]></title> 
<author>奢侈 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 06 Mar 2015 09:34:12 +0000</pubDate> 
<guid>https://blog.liuts.com/post/246/#blogcomment2571</guid> 
<description>
<![CDATA[ 
	天斯：昨天的出现的问题已经解决，在Public_lib.py 中 return target_string.upper() 返回的是主机名的大写，所以把主机名全部用大写命名。就可以了。有个问题是，我去掉upper() ，直接返回 return target_string ，却出现类型错误的提示，点解啊？
]]>
</description>
</item>
</channel>
</rss>