当前位置:   article > 正文

一键部署自动化运维工具spug_spug部署

spug部署

简介

Spug是面向中小型企业设计的轻量级无Agent的自动化运维平台,整合了主机管理、主机批量执行、主机在线终端、应用发布部署、在线任务计划、配置中心、监控、报警等一系列功能。

部署

1.创建目录

mkdir -p /opt/spug/{mysql,service,repos}

2.进入目录

cd /opt/spug

3.编写配置文件

vim docker-compose.yml

内容如下

  1. version: "3.3"
  2. services:
  3. db:
  4. image: mariadb:10.8.2
  5. container_name: spug-db
  6. restart: always
  7. command: --port 3306 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
  8. volumes:
  9. - /opt/spug/mysql:/var/lib/mysql
  10. environment:
  11. - MYSQL_DATABASE=spug
  12. - MYSQL_USER=spug
  13. - MYSQL_PASSWORD=spug.cc
  14. - MYSQL_ROOT_PASSWORD=spug.cc
  15. spug:
  16. image: openspug/spug-service
  17. container_name: spug
  18. privileged: true
  19. restart: always
  20. volumes:
  21. - /opt/spug/service:/data/spug
  22. - /opt/spug/repos:/data/repos
  23. ports:
  24. # 如果80端口被占用可替换为其他端口,例如: - "8000:80"
  25. - "10060:80"
  26. environment:
  27. - MYSQL_DATABASE=spug
  28. - MYSQL_USER=spug
  29. - MYSQL_PASSWORD=spug.cc
  30. - MYSQL_HOST=db
  31. - MYSQL_PORT=3306
  32. depends_on:
  33. - db

4.启动

docker compose up -d

 5.设置账户密码

下面设置的账户/密码:admin/123456

docker exec spug init_spug admin 123456

创建账户成功示例: 

  1. [root@mini110 spug]# docker exec spug init_spug admin 123456
  2. /usr/local/lib/python3.6/site-packages/OpenSSL/_util.py:6: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
  3. from cryptography.hazmat.bindings.openssl.binding import Binding
  4. Migrations for 'account':
  5. data/spug/spug_api/apps/account/migrations/0001_initial.py
  6. - Create model History
  7. - Create model Role
  8. - Create model User
  9. - Add field created_by to role
  10. Migrations for 'alarm':
  11. data/spug/spug_api/apps/alarm/migrations/0001_initial.py
  12. - Create model Alarm
  13. - Create model Group
  14. - Create model Contact
  15. Migrations for 'config':
  16. data/spug/spug_api/apps/config/migrations/0001_initial.py
  17. - Create model Service
  18. - Create model Environment
  19. - Create model ConfigHistory
  20. - Create model Config
  21. Migrations for 'exec':
  22. data/spug/spug_api/apps/exec/migrations/0001_initial.py
  23. - Create model Transfer
  24. - Create model ExecTemplate
  25. - Create model ExecHistory
  26. Migrations for 'home':
  27. data/spug/spug_api/apps/home/migrations/0001_initial.py
  28. - Create model Navigation
  29. - Create model Notice
  30. Migrations for 'host':
  31. data/spug/spug_api/apps/host/migrations/0001_initial.py
  32. - Create model Host
  33. - Create model HostExtend
  34. - Create model Group
  35. Migrations for 'monitor':
  36. data/spug/spug_api/apps/monitor/migrations/0001_initial.py
  37. - Create model Detection
  38. Migrations for 'notify':
  39. data/spug/spug_api/apps/notify/migrations/0001_initial.py
  40. - Create model Notify
  41. Migrations for 'schedule':
  42. data/spug/spug_api/apps/schedule/migrations/0001_initial.py
  43. - Create model History
  44. - Create model Task
  45. Migrations for 'setting':
  46. data/spug/spug_api/apps/setting/migrations/0001_initial.py
  47. - Create model Setting
  48. - Create model UserSetting
  49. Migrations for 'app':
  50. data/spug/spug_api/apps/app/migrations/0001_initial.py
  51. - Create model App
  52. - Create model Deploy
  53. - Create model DeployExtend1
  54. - Create model DeployExtend2
  55. Migrations for 'repository':
  56. data/spug/spug_api/apps/repository/migrations/0001_initial.py
  57. - Create model Repository
  58. Migrations for 'deploy':
  59. data/spug/spug_api/apps/deploy/migrations/0001_initial.py
  60. - Create model DeployRequest
  61. Operations to perform:
  62. Apply all migrations: account, alarm, app, config, deploy, exec, home, host, monitor, notify, repository, schedule, setting
  63. Running migrations:
  64. Applying account.0001_initial... OK
  65. Applying alarm.0001_initial... OK
  66. Applying config.0001_initial... OK
  67. Applying app.0001_initial... OK
  68. Applying repository.0001_initial... OK
  69. Applying deploy.0001_initial... OK
  70. Applying exec.0001_initial... OK
  71. Applying home.0001_initial... OK
  72. Applying host.0001_initial... OK
  73. Applying monitor.0001_initial... OK
  74. Applying notify.0001_initial... OK
  75. Applying schedule.0001_initial... OK
  76. Applying setting.0001_initial... OK
  77. 初始化/更新成功
  78. /usr/local/lib/python3.6/site-packages/OpenSSL/_util.py:6: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
  79. from cryptography.hazmat.bindings.openssl.binding import Binding
  80. 创建用户成功

使用

打开浏览器

输入192.168.168.110:10060

官方文档

https://spug.cc/docs

源码地址

https://github.com/openspug/spug

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/487402
推荐阅读
相关标签
  

闽ICP备14008679号