最近在工作的时候,遇到了suse 11 sp2, 这个里面需要使用supervisord进行拉起程序,经过一番尝试,最终可以使用了。

操作系统准备

  • 下载安装
http://linux.iingen.unam.mx/pub/Linux/Suse/isos/SLES11/SLES-11-SP2-DVD-x86_64-GM-DVD1.iso
http://linux.iingen.unam.mx/pub/Linux/Suse/isos/SLES11/SLES-11-SP2-DVD-x86_64-GM-DVD2.iso
  • 关闭防火墙
SuSEfirewall2 off
SuSEfirewall2 stop
  • 修改更新源
# 可以放到文件里面

echo '
[userdefine]
name=userdefine
enabled=1
autorefresh=0
#baseurl=cd:///?devices=/dev/sr0
baseurl=http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/11.2/repo/oss/
path=/
type=yast2
keeppackages=0' > /etc/zypp/repos.d/userdefine.repo
  • 安装依赖软件
zypper in gcc zlib zlib-devel openssl-devel ncurses* python-pip python-setuptools python-wheel

在python2.6环境下安装virtualenv

  • 安装依赖python模块
# setuptools , 安装python模块必备
wget https://pypi.python.org/packages/a9/23/720c7558ba6ad3e0f5ad01e0d6ea2288b486da32f053c73e259f7c392042/setuptools-36.0.1.zip#md5=430eb106788183eefe9f444a300007f0
unzip -d . setuptools-36.0.1.zip
cd setuptools*
python setup.py install
# 自动安装python模块必备
curl -O https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
zypper install python-setuptools
python setup.py install
  • 添加python更新源
mkdir -p ~/.pip
echo "
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple/ 
[install]
use-mirrors = true
mirrors = http://pypi.douban.com/simple/ 
trusted-host = pypi.douban.com" > ~/.pip/pip.conf
  • 安装virtualenv
pip install virtualenv

编译安装python 2.7

  • 编译python
cd /usr/local/src/
wget http://ojv12llai.bkt.clouddn.com/uploads/20170218132247.tgz
tar xzvf 20170218132247.tgz
cd Python-2.7.12
./configure --prefix=/usr/local/python-2.7.12 --with-ssl --with-zlib
make -j 4
make install
  • 进入python2.7环境
source /usr/local/myenv/bin/activate
  • 安装supervisor,安装之前,也要修改python模块的更新源
pip install supervisor
  • 打出python env
virtualenv -p /usr/local/python-2.7.12/bin/python2.7 /usr/local/myenv
  • 配置文件
mkdir -p /etc/supervisor.d
编辑文件 /etc/supervisord.conf参考 http://book.opschina.org/supervisord---%E9%83%A8%E7%BD%B2.html
  • 执行
supervisord
  • 检查
ss -ln | grep 1009, 账号ops 密码123
  • 配置程序
参考上面的opshchina链接
  • 开机自动执行,将下面的一行放到 /etc/rc.local里面可以试试。
/usr/local/myenv/bin/python supervisord
Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""