langfuse从v2升级到v3(本地升级)

news/2025/1/9 17:44:02/文章来源:https://www.cnblogs.com/hxlasky/p/18662609

环境:
OS:Centos 7

#################################################部署v2###########################################################

1.部署v2
v2资源清单配置文件如下:

[root@host135 langfuse]# more docker-compose.yml 
services:langfuse-server:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/langfuse:2depends_on:db:condition: service_healthyports:- "3000:3000"environment:- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres- NEXTAUTH_SECRET=mysecret- SALT=mysalt- ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000 # generate via `openssl rand-hex 32`- NEXTAUTH_URL=http://localhost:3000- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}- LANGFUSE_DISABLE_EXPENSIVE_POSTGRES_QUERIES=truedb:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/postgresql:16.4.0restart: alwayshealthcheck:test: ["CMD-SHELL", "pg_isready -U postgres"]interval: 3stimeout: 3sretries: 10environment:- POSTGRES_USER=postgres- POSTGRES_PASSWORD=postgres- POSTGRES_DB=postgresports:- 5432:5432volumes:- /home/middle/langfuse/pgdata:/var/lib/postgresql/data
volumes:database_data:driver: local

 

2.创建pg外挂目录
mkdir -p /home/middle/langfuse/pgdata

 

3.启动
将资源清单文件存放到如下目录
/home/middle/langfuse/langfuse

[root@host135 langfuse]# cd /home/middle/langfuse/langfuse
[root@host135 langfuse]# docker compose up -d

 

4.浏览器登录
http://192.168.1.135:3000
创建账号hxl,然后登录进去创建项目,模拟造数据,等升级完成后这些数据是否存在

 

5.删除v2的部署
[root@host135 langfuse]# cd /home/middle/langfuse/langfuse
[root@host135 langfuse]# docker compose down
[root@host135 langfuse]# docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS

这个时候v2没有运行了

 

##########################################升级到v3#############################

v3部署与v2相同的目录
1.准备资源配置文件

[root@host135 langfuse]# more v3_docker-compose.yml 
services:langfuse-worker:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/langfuse-worker:3restart: alwaysdepends_on: &langfuse-depends-onpostgres:condition: service_healthyminio:condition: service_healthyredis:condition: service_healthyclickhouse:condition: service_healthyports:- "3030:3030"environment: &langfuse-worker-envDATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgresSALT: "mysalt"ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000" # generate via `openssl ran
d -hex 32`TELEMETRY_ENABLED: ${TELEMETRY_ENABLED:-true}LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: ${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-true}CLICKHOUSE_MIGRATION_URL: ${CLICKHOUSE_MIGRATION_URL:-clickhouse://clickhouse:9000}CLICKHOUSE_URL: ${CLICKHOUSE_URL:-http://clickhouse:8123}CLICKHOUSE_USER: ${CLICKHOUSE_USER:-clickhouse}CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-clickhouse}CLICKHOUSE_CLUSTER_ENABLED: ${CLICKHOUSE_CLUSTER_ENABLED:-false}LANGFUSE_S3_EVENT_UPLOAD_BUCKET: ${LANGFUSE_S3_EVENT_UPLOAD_BUCKET:-langfuse}LANGFUSE_S3_EVENT_UPLOAD_REGION: ${LANGFUSE_S3_EVENT_UPLOAD_REGION:-auto}LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: ${LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID:-minio}LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: ${LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY:-miniosecret}LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: ${LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT:-http://minio:9000}LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: ${LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE:-true}LANGFUSE_S3_EVENT_UPLOAD_PREFIX: ${LANGFUSE_S3_EVENT_UPLOAD_PREFIX:-events/}LANGFUSE_S3_MEDIA_UPLOAD_BUCKET: ${LANGFUSE_S3_MEDIA_UPLOAD_BUCKET:-langfuse}LANGFUSE_S3_MEDIA_UPLOAD_REGION: ${LANGFUSE_S3_MEDIA_UPLOAD_REGION:-auto}LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID: ${LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID:-minio}LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY: ${LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY:-miniosecret}LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT: ${LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT:-http://minio:9000}LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE: ${LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE:-true}LANGFUSE_S3_MEDIA_UPLOAD_PREFIX: ${LANGFUSE_S3_MEDIA_UPLOAD_PREFIX:-media/}REDIS_HOST: ${REDIS_HOST:-redis}REDIS_PORT: ${REDIS_PORT:-6379}REDIS_AUTH: ${REDIS_AUTH:-myredissecret}langfuse-web:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/langfuse:3restart: alwaysdepends_on: *langfuse-depends-onports:- "3000:3000"environment:<<: *langfuse-worker-envNEXTAUTH_URL: http://localhost:3000
      NEXTAUTH_SECRET: mysecretLANGFUSE_INIT_ORG_ID: ${LANGFUSE_INIT_ORG_ID:-}LANGFUSE_INIT_ORG_NAME: ${LANGFUSE_INIT_ORG_NAME:-}LANGFUSE_INIT_PROJECT_ID: ${LANGFUSE_INIT_PROJECT_ID:-}LANGFUSE_INIT_PROJECT_NAME: ${LANGFUSE_INIT_PROJECT_NAME:-}LANGFUSE_INIT_PROJECT_PUBLIC_KEY: ${LANGFUSE_INIT_PROJECT_PUBLIC_KEY:-}LANGFUSE_INIT_PROJECT_SECRET_KEY: ${LANGFUSE_INIT_PROJECT_SECRET_KEY:-}LANGFUSE_INIT_USER_EMAIL: ${LANGFUSE_INIT_USER_EMAIL:-}LANGFUSE_INIT_USER_NAME: ${LANGFUSE_INIT_USER_NAME:-}LANGFUSE_INIT_USER_PASSWORD: ${LANGFUSE_INIT_USER_PASSWORD:-}LANGFUSE_SDK_CI_SYNC_PROCESSING_ENABLED: ${LANGFUSE_SDK_CI_SYNC_PROCESSING_ENABLED:-false}LANGFUSE_READ_FROM_POSTGRES_ONLY: ${LANGFUSE_READ_FROM_POSTGRES_ONLY:-false}LANGFUSE_READ_FROM_CLICKHOUSE_ONLY: ${LANGFUSE_READ_FROM_CLICKHOUSE_ONLY:-true}LANGFUSE_RETURN_FROM_CLICKHOUSE: ${LANGFUSE_RETURN_FROM_CLICKHOUSE:-true}clickhouse:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/clickhouse-server:24.8restart: alwayscontainer_name: clickhousehostname: clickhouseenvironment:CLICKHOUSE_DB: defaultCLICKHOUSE_USER: clickhouseCLICKHOUSE_PASSWORD: clickhousevolumes:- /home/middle/langfuse/clickhouse_data:/var/lib/clickhouse- /home/middle/langfuse/clickhouse_logs:/var/log/clickhouse-serverports:- "8123:8123"- "9000:9000"healthcheck:test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
      interval: 5stimeout: 5sretries: 10start_period: 1sminio:image: minio:latestrestart: alwayscontainer_name: minioentrypoint: sh# create the 'langfuse' bucket before starting the servicecommand: -c 'mkdir -p /data/langfuse && minio server --address ":9000" --console-address ":9001" /data'environment:MINIO_ROOT_USER: minioMINIO_ROOT_PASSWORD: miniosecretports:- "9090:9000"- "9091:9001"volumes:- /home/middle/langfuse/minio_data:/minio_datahealthcheck:test: ["CMD", "mc", "ready", "local"]interval: 1stimeout: 5sretries: 5start_period: 1sredis:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/redis:7.4restart: alwayscommand: >--requirepass ${REDIS_AUTH:-myredissecret}ports:- 6379:6379healthcheck:test: ["CMD", "redis-cli", "ping"]interval: 3stimeout: 10sretries: 10postgres:image: registry.cn-shenzhen.aliyuncs.com/hxlk8s/postgresql:16.4.0restart: alwayshealthcheck:test: ["CMD-SHELL", "pg_isready -U postgres"]interval: 3stimeout: 3sretries: 10environment:POSTGRES_USER: postgresPOSTGRES_PASSWORD: postgresPOSTGRES_DB: postgresports:- 5432:5432volumes:- /home/middle/langfuse/pgdata:/var/lib/postgresql/datavolumes:langfuse_postgres_data:driver: locallangfuse_clickhouse_data:driver: locallangfuse_clickhouse_logs:driver: locallangfuse_minio_data:driver: local

 

2.创建资源配置文件中外挂的目录

mkdir /home/middle/langfuse/pgdata 保留v2的 不需要创建,升级到v3会用到这里的数据
mkdir -p /home/middle/langfuse/minio_data
mkdir -p /home/middle/langfuse/clickhouse_data
mkdir -p /home/middle/langfuse/clickhouse_logs

3.备份v2的配置文件
[root@host135 langfuse]# cd /home/middle/langfuse/langfuse
[root@host135 langfuse]# mv docker-compose.yml v2_docker-compose.yml

4.使用v3的配置文件部署
[root@host135 langfuse]# mv v3_docker-compose.yml docker-compose.yml
[root@host135 langfuse]# docker compose up -d

 

5.查看进程

[root@host135 langfuse]# docker compose ps
NAME                         IMAGE                                                             COMMAND                  SERVICE           CREATED          STATUS                    PORTS
clickhouse                   registry.cn-shenzhen.aliyuncs.com/hxlk8s/clickhouse-server:24.8   "/entrypoint.sh"         clickhouse        17 seconds ago   Up 12 seconds (healthy)   0.0.0.0:8123->8123/tcp, :::8123->8123/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 9009/tcp
langfuse-langfuse-web-1      registry.cn-shenzhen.aliyuncs.com/hxlk8s/langfuse:3               "dumb-init -- ./web/…"   langfuse-web      16 seconds ago   Up 5 seconds              0.0.0.0:3000->3000/tcp, :::3000->3000/tcp
langfuse-langfuse-worker-1   registry.cn-shenzhen.aliyuncs.com/hxlk8s/langfuse-worker:3        "dumb-init -- ./work…"   langfuse-worker   16 seconds ago   Up 4 seconds              0.0.0.0:3030->3030/tcp, :::3030->3030/tcp
langfuse-postgres-1          registry.cn-shenzhen.aliyuncs.com/hxlk8s/postgresql:16.4.0        "docker-entrypoint.s…"   postgres          17 seconds ago   Up 13 seconds (healthy)   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp
langfuse-redis-1             registry.cn-shenzhen.aliyuncs.com/hxlk8s/redis:7.4                "docker-entrypoint.s…"   redis             17 seconds ago   Up 14 seconds (healthy)   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp
minio                        minio:latest                                                      "sh -c 'mkdir -p /da…"   minio             17 seconds ago   Up 13 seconds (healthy)   0.0.0.0:9090->9000/tcp, :::9090->9000/tcp, 0.0.0.0:9091->9001/tcp, :::9091->9001/tcp

 

6.登录查看
http://192.168.1.135:3000/

可以看到之前在v2上创建的数据是存在的

 

7.查看pg的表

/opt/pg16/bin/psql -h 192.168.1.135 -U postgres -p5432postgres=# \dList of relationsSchema |           Name           | Type  |  Owner   
--------+--------------------------+-------+----------public | Account                  | table | postgrespublic | Session                  | table | postgrespublic | _prisma_migrations       | table | postgrespublic | annotation_queue_items   | table | postgrespublic | annotation_queues        | table | postgrespublic | api_keys                 | table | postgrespublic | audit_logs               | table | postgrespublic | background_migrations    | table | postgrespublic | batch_exports            | table | postgrespublic | comments                 | table | postgrespublic | cron_jobs                | table | postgrespublic | dataset_items            | table | postgrespublic | dataset_run_items        | table | postgrespublic | dataset_runs             | table | postgrespublic | datasets                 | table | postgrespublic | eval_templates           | table | postgrespublic | events                   | table | postgrespublic | job_configurations       | table | postgrespublic | job_executions           | table | postgrespublic | llm_api_keys             | table | postgrespublic | media                    | table | postgrespublic | membership_invitations   | table | postgrespublic | models                   | table | postgrespublic | observation_media        | table | postgrespublic | observations             | table | postgrespublic | observations_view        | view  | postgrespublic | organization_memberships | table | postgrespublic | organizations            | table | postgrespublic | posthog_integrations     | table | postgrespublic | prices                   | table | postgrespublic | project_memberships      | table | postgrespublic | projects                 | table | postgrespublic | prompts                  | table | postgrespublic | score_configs            | table | postgrespublic | scores                   | table | postgrespublic | sso_configs              | table | postgrespublic | trace_media              | table | postgrespublic | trace_sessions           | table | postgrespublic | traces                   | table | postgrespublic | traces_view              | view  | postgrespublic | users                    | table | postgrespublic | verification_tokens      | table | postgres
(42 rows)v3有42个对象,而v2是34个对象.

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/866649.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

htb Escape

扫描端口 nmap -sC -sV -p- -v -Pn -T4 10.10.11.202 Host is up (0.39s latency). Not shown: 65515 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 88/tcp open kerberos-sec Microsoft Wind…

2025年销售攻略

随着2024年的落幕,我们迎来了全新的2025年,新一轮的业绩争夺战已经悄然打响。面对新的挑战与机遇,我们该如何在销售领域脱颖而出,实现业绩的稳步增长呢? 一、明确目标,勇往直前 销售工作离不开明确的目标。设定清晰、可行的销售目标,并将其分解为具体的时间节点和任务,…

杭州铭师堂的云原生升级实践

杭州铭师堂,是一个致力于为人的全面发展而服务的在线教育品牌。杭州铭师堂秉持“用互联网改变教育,让中国人都有好书读”的使命,致力于用“互联网+教育”的科技手段让更多的孩子都能享有优质的教育,促进他们的全面成长。作者:升学e网通研发部基建团队 公司介绍 杭州铭师堂…

新年餐饮业营销攻略:数据驱动,精准营销!

餐饮业借助项目管理软件开展新年营销,可以更加高效、精准地管理营销活动,提升销售业绩和用户体验。通过选择合适的软件工具、制定详细的营销计划、设置可视化的任务列表和进度跟踪、促进团队协作和沟通、收集和分析数据以优化营销策略、评估和调整项目计划以及总结经验和教训…

解锁新应用:探索GPU扩展是如何提升渲染农场的工作效率

联瑞GPU扩展方案在渲染农场的应用,是在原有计算机设备的基础上增加GPU的数量,不用额外购买GPU服务器,有效的帮助企业降本增效渲染农场是一种基于计算机GPU集群的渲染解决方案,主要用于分布式渲染。它将渲染任务分发到多个计算机(渲染节点)上,通过GPU并行计算和协同工作,实…

Task实战

一:场景描述 在一个文件下查找js文件中指定的关键字,并记录完成查找所需时间。完成此任务使用了3种写法,分别为: 1.仅使用一个task,在任务中进行for循环,循环调用异步业务处理方法,只利用一个后台线程进行业务处理。2.先查找出文件路径,然后对每一个文件路径创建一个ta…

多网卡配置bond模式4(Ubuntu22.04)

编辑网卡配置文件 vim /etc/netpla/00-installer-config.yaml示例一:示例二:

中考英语优秀范文-013 Computer in my life 电脑在我的生活中

中考英语优秀范文-013 Computer in my life 电脑在我的生活中 1 写作要求 假设某中学生英文报开展关于计算机与学生生活的征文活动,请你根据下表所提示的要点,以Computer in my life为题,用英语为该报写一篇短文,简述计算机在你生活中的用途,并就计算机对你生活的影响谈谈…

BAPI

预制发票:BAPI_INCOMINGINVOICE_PARKDATA: ls_header TYPE bapi_incinv_create_header,lt_itemdata TYPE TABLE OF bapi_incinv_create_item,ls_itemdata TYPE bapi_incinv_create_item,lt_taxdata TYPE TABLE OF bapi_incinv_create_tax,ls_taxdata TYPE bapi_…

车云远程诊断系统 - DRS

INTEWORK-DRS(Diagnostic Remote-Service System)是由经纬恒润自主研发的一款基于车云远程的诊断解决方案产品,具备整车级或单ECU级的如参数读写、故障读清、例程标定、动作测试和程序升级等传统常见诊断功能,并且支持基于云任务的车端主动诊断如车辆故障主动预警、关键数据…

Kubernetes集群运维生产常见问题解析与解决方案

前言:在Kubernetes集群的日常运维工作中,我们难免会遇到各种各样的问题。这些问题可能涉及到集群的部署、配置、监控、性能优化等多个方面。为了解决这些问题,我们需要不断地学习和积累经验。在这里,我打算收集并整理一些网友曾经提出的问题,并提供相应的解析和解决方案,…

Vue-i18n 多语言中包含特殊字符出现异常Message compilation error: Invalid linked format

异常: 解决方法 方式一: 翻译文件中,将含有特殊字符的字符串使用“”双引号包裹,特殊字符外加花括号{},且用单引号包裹,如“{‘@’}”Message:"也可以通过使用最新版xxxx{@}xxxx扫描右侧二维码获取"方式二: 使用占位符Message:"也可以通过使用最新版xxxx…