# 什么是OMS?

OMS是一个简单易用的运维管理平台，基于Go开发，集成了GO全平台、易于部署和高并发的特性。目前实现了资产管理、文件浏览器、批量命令、批量上传文件、VNC连接和基于自建脚本并行执行的能力。

## 快速开始

#### 下载

在release界面选择需要的发行版本以及对应机器的架构执行文件下载：

{% embed url="<https://github.com/ssbeatty/oms/releases>" %}

#### 运行

* Windows

创建一个新的文件夹，并移动可执行文件到文件夹中，双击执行即可

* Linux

```shell
cd /you/path/omsd && ./oms --config=/you/path/config.yaml
```

{% hint style="info" %}
**配置文件:**  当没有参数执行oms时，会在当前目录生成一个config.yaml配置文件，默认使用sqlite作为持久化存储的数据库，但是并不推荐使用它。在正常使用过程中，推荐使用mysql或者postgres。
{% endhint %}

* docker

> docker-compose.yaml

```yaml
version: '2.3'

services:
  oms:
    image: ghcr.io/ssbeatty/oms/oms:v0.7.5
    restart: always
    ports:
      - "9090:9090"
    volumes:
      - ./data:/opt/oms/data
      - ./config:/etc/oms
```

* 配置文件

以下是对配置文件的示例：

```yaml
app:
  name: oms
  addr: 127.0.0.1
  port: 9090
  mode: dev
  data_path: data  # 运行文件目录
  run_start: false # 是否在运行时打开浏览器 windows
  temp_date: 336h  # 执行日志的保存时间 默认14天

db:
  driver: postgres
  user: root
  password: 123456
  dsn: 127.0.0.1:3306
  db_name: oms
```

* 目录结构

<pre><code>oms
<strong>├─omsd          # 可执行程序
</strong>└─data
   ├─plugin     # 插件存放目录
   ├─tasks      # 任务日志
   ├─tmp        # 缓存目录
   ├─oms.db     # 数据库文件
   └─upload     # 临时上传文件夹
</code></pre>

#### 注册为服务

<pre class="language-bash"><code class="lang-bash"><strong># 使用用户root将omsd注册为服务
</strong><strong>omsd --action install --user root --config /path/your/config.yaml
</strong># 取消注册
omsd --action uninstall
</code></pre>

#### 自行编译

```shell
# clone
git clone --recurse-submodules https://github.com/ssbeatty/oms.git

# build frontend (node version > 14.0)
cd web/omsUI
yarn && yarn build

# 打包 oms
# linux
packr build -o oms cmd/omsd/main.go
# win
packr build -o oms.exe cmd/omsd/main.go
```

### 指南:&#x20;

{% content-ref url="guides/zi-chan-guan-li" %}
[zi-chan-guan-li](https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/guides/zi-chan-guan-li)
{% endcontent-ref %}

{% content-ref url="guides/pi-liang-cao-zuo" %}
[pi-liang-cao-zuo](https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/guides/pi-liang-cao-zuo)
{% endcontent-ref %}

{% content-ref url="guides/ssh" %}
[ssh](https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/guides/ssh)
{% endcontent-ref %}

{% content-ref url="guides/wen-jian-liu-lan-qi" %}
[wen-jian-liu-lan-qi](https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/guides/wen-jian-liu-lan-qi)
{% endcontent-ref %}

{% content-ref url="guides/ren-wu-guan-li" %}
[ren-wu-guan-li](https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/guides/ren-wu-guan-li)
{% endcontent-ref %}

{% content-ref url="guides/sui-dao-guan-li" %}
[sui-dao-guan-li](https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/guides/sui-dao-guan-li)
{% endcontent-ref %}
