千家信息网

Teuthology平台部署是怎样的

发表于:2026-10-31 作者:千家信息网编辑
千家信息网最后更新 2026年10月31日,本篇文章为大家展示了Teuthology平台部署是怎样的,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。Teuthology架构软件组成Teuthology 测
千家信息网最后更新 2026年10月31日Teuthology平台部署是怎样的

本篇文章为大家展示了Teuthology平台部署是怎样的,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

Teuthology架构

软件组成

Teuthology 测试框架所使用到的软件组成如下:

  • Jenkins 持续集成工具

  • teuthology Ceph 测试套件

  • shaman 查询提供软件包的 chacra 节点,水平扩展和调度 chacra 节点

  • chacra 提供不同架构二进制包或文件的管理 REST API 接口

    Teuthology部署

    部署paddles/pulpito node

    安装依赖
yum install git python-dev python-virtualenv postgresql postgresql-contrib postgresql-server-dev-all supervisor gcc epel-release
配置postgresql数据库

初始化数据库

postgresql-setup initdbsystemctl start postgresql //启动数据库systemctl enable postgresql

postgresql安装并启动后,会自动生成postgres用户

su - postgres //进入该用户-bash-4.2$ psql //进入数据库postgres=# \password postgres //更改用户postgres的密码

//按照输出的提示输入密码即可

创建数据库实例paddles、shaman

postgres=#create database paddles; // 创建名为paddles的数据库postgres=#create database shaman; // 创建名为shaman的数据库postgres=#create database chacra; // 创建名为chacra的数据库
安装配置paddles

创建paddles用户,并克隆paddles项目

useradd -m paddles -g root -G root //新建用户 paddlessu - paddles //切换到paddles用户下git clone https://github.com/ceph/paddles.git //克隆该项目cd paddlesvirtualenv ./virtualenv //创建python的沙盒环境source ./virtualenv/bin/activate //进入沙盒环境

修改配置文件,paddles中有配置文件的例子,只需要复制一份并修改即可。

cp config.py.in config.py

需要修改的内容

job_log_href_templ= 'http://qa-proxy.ceph.com/teuthology/{run_name}/{job_id}/teuthology.log' # 将qa-proxy.ceph.com/teuthology改成自己对应日志服务器的地址...sqlalchemy = {     # You may use SQLite for testing    'url': ' postgresql://postgres:password@localhost/paddles',    # When you set up PostreSQL, it will look more like:    #'url': 'postgresql+psycopg2://USER:PASSWORD@DB_HOST/DB_NAME',    'echo': True,    'echo_pool': True,    'pool_recycle': 3600,    'encoding': 'utf-8'}

修改/var/lib/pgsql/data/pg_hba.conf,解决初始化paddles环境时的报错Ident authentication failed。

# "local" is for Unix domain socket connections onlylocal   all             all                                     trust# IPv4 local connections:host    all             all             127.0.0.1/32            md5# IPv6 local connections:host    all             all             ::1/128                 trust

修改完后,保存并退出。然后安装相关依赖,初始化环境。

$pip install -r requirements.txt //安装相关依赖$python setup.py develop // 初始化环境$pecan populate config.py// 在postgresql创建paddles需要的表

配置数据迁移工具

$ cp alembic.ini.in alembic.ini$ vi alembic.ini    sqlalchemy.url = postgresql://postgres:password@localhost/paddles$alembic stamp head//触发迁移工具生效

通过supervisord部署paddles服务

#cat /etc/supervisord.d/paddles.ini[program:paddles]user=paddlesenvironment=HOME="/home/paddles", USER="paddles"directory=/home/paddles/paddlescommand=/home/paddles/paddles/virtualenv/bin/gunicorn_pecan -c gunicorn_config.py config.pyautostart=trueautorestart=trueredirect_stderr=truestdout_logfile = /home/paddles/paddles.out.logstderr_logfile = /home/paddles/paddles.err.log
安装配置pulpito

创建pulpito用户,切换到pulpito用户进行部署

#useradd -m pulpito -g root -G root#su - pulpito$git clone https://github.com/ceph/pulpito.git$cd pulpito$virtualenv ./virtualenv

修改配置文件,paddles中有配置文件的例子,只需要复制一份并修改即可。

$cp config.py.in prod.py$vi prod.py

主要的修改部分如下:

………paddles_address = 'http://192.168.122.34:8080' #实际的paddles服务地址………'debug': False,

修改完后,保存并退出。然后安装相关依赖。

$source ./virtualenv/bin/activate$pip install -r requirements.txt //安装相关依赖

通过supervisord部署pulpito服务

#cat /etc/supervisord.d/pulpito.ini[program:pulpito] user=pulpito directory=/home/pulpito/pulpito command=/home/pulpito/pulpito/virtualenv/bin/python run.py environment=HOME="/home/pulpito",USER="pulpito" autostart=true autorestart=true redirect_stderr=true stdout_logfile = /home/pulpito/pulpito.out.log stderr_logfile = /home/pulpito/pulpito.err.log启动supervisorsudo supervisord -c /etc/supervisord.confsudo supervisorctl reloadsudo supervisorctl start all//启动sudo supervisorctl status//查看状态,可以看到paddles 和pulpito的进程启动了检测服务

在浏览器或者终端,访问 http://{ip}:8080/和http://{ip}:8081/就可以了,看到如下界面:

部署shaman

shaman的部署方式分为两种一种是手动部署,另一种通过ansible,在此采用的是手动部署。

安装相关依赖
yum install epel-release gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget wxBase.x86_64 erlang
安装RabbitMQ
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc yum install rabbitmq-server-3.6.1-1.noarch.rpmsystemctl start rabbitmq-server #启动rabbitmq-serversystemctl enable rabbitmq-server #设置rabbitmq-server开机自启动
部署shaman

创建shaman用户,并克隆shaman项目,然后创建沙盒环境。

useradd -m shaman -g root -G root //新建用户shamansu - shaman //切换到shaman用户下git clone https://github.com/ceph/shaman.git //克隆该项目cd shamanvirtualenv ./virtualenv //创建python的沙盒环境source ./virtualenv/bin/activate //进入沙盒环境

安装一些在requirements.txt中没有的软件依赖

pip install --upgrade setuptools pip install --upgrade pippip install "cherrypy>=3.8.0,<9.0.0" pip install wsgiserver

修改配置文件config/dev.py。

$vim config/dev.py...    ],     'debug': False,} ... sqlalchemy_w = {     #'url': 'sqlite:///dev.db',     'url': 'postgresql://postgres:password@localhost/shaman',     'echo': True,     'echo_pool': True,     'pool_recycle': 3600,     'encoding': 'utf-8' } sqlalchemy_ro = {     #'url': 'sqlite:///dev.db',     'url': 'postgresql://postgres:password@localhost/shaman',     'echo': True,     'echo_pool': True,     'pool_recycle': 3600,     'encoding': 'utf-8' } ....

修改config/run.py,需要修改的内容为,其中服务IP根据具体改动:

simpleapp_wsgi_app = deploy('config/dev.py')...server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 8082), application, server_name='simpleapp')

初始化环境

$pip install -r requirements.txt //安装相关依赖$python setup.py develop // 初始化环境$pecan populate config/dev.py// 在postgresql创建shaman需要的表

配置数据迁移工具

$ cp alembic.ini.in alembic.ini$ vi alembic.ini    sqlalchemy.url = postgresql://postgres:password@localhost/shaman$alembic stamp head//触发迁移工具生效
配置supervisord

通过supervisord部署shaman服务

#cat /etc/supervisord.d/shaman.ini[program:shaman] user=shaman directory=/home/shaman/shaman command=/home/shaman/shaman/virtualenv/bin/python config/run.py environment=HOME="/home/shaman",USER="shaman" autostart=true autorestart=true redirect_stderr=true stdout_logfile = /home/shaman/shaman.out.log stderr_logfile = /home/shaman/shaman.err.log

启动shaman服务

sudo supervisorctl reread && sudo supervisorctl update shaman && sudo supervisorctl start shaman
检测服务

在浏览器或者终端,访问 http://{ip}:8082/就可以了,看到如下界面:

部署chacra

chacra的部署较为复杂,采取的是ansible的方式,但是官方提供的部署文件是针对ubuntu系统的,需要进行改动。

修改playbooks相关文件

修改deploy/playbooks/examples/deploy_test.yml中对应参数

development_server: trueapi_user: "admin"api_key: "secret"graphite_api_key: '1234-asdf-1234'callback_url: "http://{ip}:8082/api/repos/" #shaman的地址callback_user: "admin"callback_key: "secret"health_ping_url: "http://{ip}:8082/api/nodes/" #shaman的地址

修改deploy/playbooks/roles/common/tasks/letsencrypt.yml

#删除下面几行- name: install software-properties-common  apt:    name: software-properties-common    state: latest    update_cache: yes  become: true- name: add certbot PPA  apt_repository:    repo: "ppa:certbot/certbot"  become: true

修改deploy/playbooks/roles/common/tasks/rabbitmq.yml

#删除下面几行- name: add the rabbitmq official repo  become: true  apt_repository:    repo: "deb http://www.rabbitmq.com/debian/ testing main"    state: present- name: add the rabbitmq public key  become: true  apt_key:    url: "https://www.rabbitmq.com/rabbitmq-release-signing-key.asc"    state: present- name: update the apt cache  become: true  apt:    update_cache: true

修改deploy/playbooks/roles/common/tasks/systemd.yml

# 将state由running改为startedservice: name=chacra state=started enabled=yesservice: name=chacra-celery state=started enabled=yesservice: name=chacra-celerybeat state=started enabled=yes

修改deploy/playbooks/roles/common/templates/systemd/chacra-celery.service.j2

# 由于%I在systemd中有特殊的含义,所有在此将%I改为%%IExecStart={{ app_home }}/bin/celery multi start 5 -Q:1,2 poll_repos,celery -Q:3-5 build_repos -A async --logfile=/var/log/celery/%n%%I.logExecReload={{ app_home }}/bin/celery multi restart 5 -Q:1,2 poll_repos,celery -Q:3-5 build_repos -A async --logfile=/var/log/celery/%n%%I.log
部署chacra

使用ansible-playbook部署ansible服务

检查服务

在浏览器或者终端,访问 http://{ip}:8083/就可以了,看到如下界面:

Teuthology Node

Teuthology部署中官方建议为两个角色scheduler和worker。

创建/etc/teuthology.yaml

内容如下:

lab_domain: didichuxing.com #testnode的域名后缀archive_base: /home/teuthworker/archive # 存储日志信息的地方automated_scheduling: Falsereserve_machines: 0queue_host: 127.0.0.1queue_port: 11300lock_server: 'http://{ip}:8080' # paddles的地址results_server: 'http://{ip}:8080' # paddles的地址results_ui_server: 'http://{ip}:8081' # pulpito的地址#results_sending_email: 'teuthology',results_timeout: 43200# Verify the packagee signaturescheck_package_signatures: falseceph_git_base_url: 'git@git.xiaojukeji.com:chishui/' # gitlab地址ceph_git_url: 'git@git.xiaojukeji.com:chishui/deph.git'ceph_qa_suite_git_url: 'git@git.xiaojukeji.com:chishui/deph.git'use_conserver: Falseconserver_master: 'conserver.front.sepia.ceph.com'conserver_port: 3109max_job_time: 259200  # 3 daysbaseurl_template: 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}'use_shaman: Trueshaman_host: '{ip}:8082'src_base_path: /home/teuthworker/srcteuthology_path: /home/teuthworker/src/teuthology_mastersuite_verify_ceph_hash: Falsesuite_allow_missing_packages: False
安装依赖
yum -y install git python-devel python-pip python-virtualenv libevent-devel libvirt-python beanstalkd

启动beanstackd队列:

systemctl start beanstalkdsystemctl enable beanstalkd # 配置开机自启动
部署teuthology

创建teuthology与teuthworker两个用户:

useradd -m teuthology -g root -G rootuseradd -m teuthworker -g root -G root

分别给两个账号授予passwordless sudo access权限:

useradd ubuntuvim /etc/sudoers#添加下面两行teuthology   ALL=(ALL)         NOPASSWD: ALLteuthworker  ALL=(ALL)         NOPASSWD: ALL
scheduler
su - teuthologymkdir ~/srcgit clone https://github.com/ceph/teuthology.git src/teuthology_masterpushd src/teuthology_master/./bootstrappopd
worker
su - teuthworkermkdir ~/srcgit clone https://github.com/ceph/teuthology.git src/teuthology_masterpushd src/teuthology_master/./bootstrappopdmkdir ~/binwget -O ~/bin/worker_start https://raw.githubusercontent.com/ceph/teuthology/master/docs/_static/worker_start.shecho 'PATH="$HOME/src/teuthology_master/virtualenv/bin:$PATH"' >> ~/.profilesource ~/.profilemkdir -p ~/archive/worker_logsworker_start magna 1

使用worker_start来启动一个plana的工作进程

worker_start plana 1
配置teuthology和teuthworker用户与test nodes间的免密登录
ssh-copy-id -i ~/.ssh/id_rsa.pub ubuntu@{machine_type}00x.example.com

Test Nodes

添加ubuntu用户

在每个test node上创建ubuntu用户,并为ubuntu用户授予passwordless sudo access权限。

useradd ubuntupasswd ubuntuNew password: <密码>etype new password: <密码>vim /etc/sudoers#添加下面一行ubuntu All=(ALL) NOPASSWD:ALL
配置ssh
#vim /etc/ssh/sshd_config//更改为下面行#HostKey /etc/ssh/ssh_host_key# HostKeys for protocol version 2HostKey /home/ubuntu/.ssh/id_rsa#HostKey /etc/ssh/ssh_host_rsa_key#HostKey /etc/ssh/ssh_host_dsa_key#HostKey /etc/ssh/ssh_host_ecdsa_key#HostKey /etc/ssh/ssh_host_ed25519_key......PermitRootLogin yes......PubkeyAuthentication yes......PasswordAuthentication yes......#systemctl restart sshd
安装依赖
yum install -y redhat-lsb yum-priorities genisoimage wget

submitting nodes

在paddles中注册test nodes

wget https://raw.githubusercontent.com/ceph/teuthology/master/docs/_static/create_nodes.py

修改create_nodes.py

paddles_url = 'http://{ip}:8080/nodes/' # paddles的地址machine_type = 'plana'lab_domain = 'example.com'# Don't change the user. It won't work at this time.user = 'ubuntu'# We are populating 'plana001' -> 'plana003'machine_index_range = range(1, 4) # 创建了'plana001' -> 'plana003' 3台机器......

日志服务器部署
添加nginx服务配置

server {  listen 80;  server_name {ip};  default_type text/plain;  access_log /var/log/nginx/log-access.log;  error_log /var/log/nginx/log-error.log;  location / {    autoindex on;    alias /home/teuthworker/archive/;  }}

重启nginx服务

systemctl restart nginx

修改paddles配置中的job_log_href_templ的值为:

job_log_href_templ= 'http://{ip}/{run_name}/{job_id}/teuthology.log'

上述内容就是Teuthology平台部署是怎样的,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注行业资讯频道。

用户 配置 服务 数据 环境 地址 数据库 文件 内容 工具 软件 项目 两个 日志 浏览器 界面 终端 切换 浏览 平台 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 美国互联网科技 青岛互联网科技公司 互联网科技集团 鑫亿盛互联网科技 奇士达互联网科技 狮子座互联网科技培训 互联网科技博客 顺网科技2021年互联网排名 云创客互联网科技公司 中国的互联网科技企业的崛起 承德科技产业互联网发展 湖南一路畅行互联网科技 互联网科技大赛获奖感言 中和天地互联网科技有限公司 山东星卡互联网科技有限公司官网 深圳互联网科技的发展 工业互联网科技成果转化 新氧科技和美国互联网有关系吗 东风日产互联网科技公司叫什么 山东亿川互联网科技有限责任公司 有格互联网科技 互联网科技工作委员会 金融科技还是互联网 全球顶尖互联网科技公司 互联网对科技的发展 武汉健翔互联网络科技有限公司 互联网科技商业 易企秀互联网科技是做什么的 西安有哪些互联网高科技企业 杭州科技互联网公司有哪些
0