Skip to content

Commit

Permalink
update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyindaxiaojie committed Oct 11, 2023
1 parent 5a6e4a4 commit 30d423a
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 1,270 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ jobs:
- name: Publish to Docker Hub
run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker build -f docker/Dockerfile -t $DOCKER_IMAGE .
docker push $DOCKER_IMAGE
docker build -f docker/Dockerfile -t $DOCKER_IMAGE:$DOCKER_VERSION -t $DOCKER_IMAGE:latest .
docker push $DOCKER_IMAGE:$DOCKER_VERSION
docker push $DOCKER_IMAGE:latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_IMAGE: shiyindaxiaojie/cat-home:3.3.1
DOCKER_IMAGE: shiyindaxiaojie/cat-home
DOCKER_VERSION: v3.3.1
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ CAT 是美团点评开源的实时应用监控平台,提供了 `Tracsaction`

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/dashboard.png)

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/dashboard-app.png)
![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/app-dashboard.png)

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/database-dashboard.png)

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/cache-dashboard.png)

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/rpc-dashboard.png)

#### Tracing

Expand Down Expand Up @@ -74,18 +80,24 @@ public Response listAsset(Cust cust) {

可以搜索某个 RPC 接口被调用的情况

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/cross.png)
![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/rpc.png)

#### Heart Beat

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/heartbeat.png)

#### Dependency

相对 Zipkin 较为简陋,后续有空可以优化下

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/dependency.png)

#### Browser

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/browser.png)

#### Mobile

![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/mobile.png)

#### State

查看当前 CAT 和应用节点的状态
Expand All @@ -102,7 +114,7 @@ public Response listAsset(Cust cust) {

1. 在用户目录创建文件夹 `~/.cat/appdatas/cat`,拷贝本项目的 `docs/config` 到该目录下
2. 修改 `docs/config/datasources.xml` 的数据库连接信息
3. 在上述目标数据源执行 `scripts/cat-init-3.3.0.sql` 初始化
3. 在上述目标数据源执行 `scripts/cat-init-3.3.0.sql` 初始化
4. 检查 `cat-home` 模块已正确设置了 Facet
![](https://cdn.jsdelivr.net/gh/shiyindaxiaojie/images/cat/idea-cat-home-facet.png)
5. 使用 IDEA 配置 Tomcat 服务器,请注意,多网卡情况下可能会出现 `CAT服务端异常:[127.0.0.1]`,请设置 JVM 启动参数 `host.ip` 指定 IP
Expand All @@ -116,11 +128,13 @@ public Response listAsset(Cust cust) {
本项目已发布到 [Docker Hub](https://hub.docker.com/repository/docker/shiyindaxiaojie/cat-home),请参考以下命令运行。

```bash
docker run -e JAVA_OPTS="-Xmx2g -Xms2g -Xmn1g" -e MYSQL_URL="127.0.0.1" -e MYSQL_PORT="3306" -e MYSQL_SCHEMA="cat" -e MYSQL_USERNAME="" -e MYSQL_PASSWD="" -e SERVER_URL="127.0.0.1" -p 8090:8090 --name=cat-home -d shiyindaxiaojie/cat-home
docker run -e MYSQL_URL="127.0.0.1" -e MYSQL_PORT="3306" -e MYSQL_SCHEMA="cat" -e MYSQL_USERNAME="" -e MYSQL_PASSWD="" -p 8080:8080 --name=cat-home -d shiyindaxiaojie/cat-home
```

## 如何部署

> 注意:除了 Helm 部署,在停止 CAT 进程之前最好调用 `curl http://localhost:8080/cat/r/home?op=checkpoint` ,将内存数据持久化磁盘,避免重启后丢失。

### Tomcat 部署

拷贝本项目的 `docs/config` 到用户目录 `~/.cat/appdatas/cat` 中,按需调整数据库配置。执行 `mvn clean package` 打包成cat-home.war,部署在目标 Tomcat 的 `webapps` 目录下,启动 Tomcat 即可。
Expand Down
143 changes: 0 additions & 143 deletions cat-alarm/pom.xml.releaseBackup

This file was deleted.

93 changes: 0 additions & 93 deletions cat-client/pom.xml.releaseBackup

This file was deleted.

Loading

0 comments on commit 30d423a

Please sign in to comment.