git help --web log执行命令时报错fatal: '/usr/local/git/share/doc/git-doc': not a documentation directory.

本文提供了解决在使用Git时遇到的帮助文档显示错误的方法,包括升级Git版本和配置自定义文档目录,确保用户能够正确访问Git的在线帮助资源。

在执行命令

git help --web log

时遇到提示

fatal: ‘/usr/local/git/share/doc/git-doc’: not a documentation directory.

解决方案:

1. 升级最新的git版本:目前我用的git版本是v2.23.0

2. 按照以下的步骤进行输命令:

如果您认为自己拥有Xcode 4提供的Apple Git发行版,那么您就是其中之一:

# create directory to keep Git documentation html-files
$ sudo mkdir -p /usr/local/git/share/doc # or whatever directory you choose

# change to that directory
$ cd /usr/local/git/share/doc

# clone repo with documentation 
$ sudo git clone git://git.kernel.org/pub/scm/git/git-htmldocs.git git-doc 

# point your Git explicitly to a new documentation directory
$ git config --global help.htmlpath /usr/local/git/share/doc/git-doc

# tell Git to use html-formatted help by default
$ git config --global help.format html

这将在.gitconfig中创建一个条目,如:

[help]
    format = html
    htmlpath = /usr/local/git/share/doc/git-doc
macx@macminixdeMac-mini ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ==> Checking for `sudo` access (which may request your password)... Password: ==> This script will install: /opt/homebrew/bin/brew /opt/homebrew/share/doc/homebrew /opt/homebrew/share/man/man1/brew.1 /opt/homebrew/share/zsh/site-functions/_brew /opt/homebrew/etc/bash_completion.d/brew /opt/homebrew ==> The following new directories will be created: /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks Press RETURN/ENTER to continue or any other key to abort: ==> /usr/bin/sudo /usr/bin/install -d -o root -g wheel -m 0755 /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod ug=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod go-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions ==> /usr/bin/sudo /usr/sbin/chown macx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/sbin/chown -R macx:admin /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /Users/macx/Library/Caches/Homebrew ==> /usr/bin/sudo /bin/chmod g+rwx /Users/macx/Library/Caches/Homebrew ==> /usr/bin/sudo /usr/sbin/chown -R macx /Users/macx/Library/Caches/Homebrew ==> Downloading and installing Homebrew... fatal: unable to access 'https://github.com/Homebrew/brew/': Error in the HTTP2 framing layer Warning: Trying again in 2 seconds: /usr/bin/git fetch --quiet --progress --force origin fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75002 ms: Couldn't connect to server Warning: Trying again in 4 seconds: /usr/bin/git fetch --quiet --progress --force origin error: RPC failed; curl 28 Failed to connect to github.com port 443 after 75000 ms: Couldn't connect to server fatal: expected flush after ref listing Warning: Trying again in 8 seconds: /usr/bin/git fetch --quiet --progress --force origin fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75003 ms: Couldn't connect to server Warning: Trying again in 16 seconds: /usr/bin/git fetch --quiet --progress --force origin remote: Enumerating objects: 301328, done. remote: Counting objects: 100% (14523/14523), done. remote: Compressing objects: 100% (515/515), done. remote: Total 301328 (delta 14162), reused 14052 (delta 14008), pack-reused 286805 (from 6) remote: Enumerating objects: 55, done. remote: Counting objects: 100% (34/34), done. remote: Total 55 (delta 33), reused 33 (delta 33), pack-reused 21 (from 1) ==> Updating Homebrew... ==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:40e7f5d7514a7e9757facdd39006f7a351d3d7986d3a228be13c8b1c3216727b ######################################################################### 100.0% ==> Pouring portable-ruby-3.4.3.arm64_big_sur.bottle.tar.gz Warning: /opt/homebrew/bin is not in your PATH. Instructions on how to configure your shell for Homebrew can be found in the 'Next steps' section below. ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics data has been sent yet (nor will any be during this install run). ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run these commands in your terminal to add Homebrew to your PATH: echo >> /Users/macx/.zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/macx/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" - Run brew help to get started - Further documentation: https://docs.brew.sh
05-13
程序依赖 APIPark 依赖 MYSQL、Redis、InfluxDB 数据库,下表是数据库所需版本: 名称 版本要求 MYSQL >=5.7.x Redis >=6.2.x InfluxDB >=2.6 部署方式 使用脚本部署 备注 支持的系统列表: CentOS 7.9(7.x为代表) CentOS 8.5(8.x为代表) Ubuntu 20.04 Ubuntu 22.04 Debain 12.4 Alibaba Cloud Linux 3.2104 Alibaba Cloud Linux 2.1903 当前仅测试了上述部署的安装,若需要其他系统的一键部署,可给我们提交Issue。 输入一键部署指令: curl -sSO https://download.apipark.com/install/quick-start.sh; bash quick-start.sh 按照提示进行部署即可,部署完成后,将会展示部署信息。 Docker-Compose部署 使用此方法安装 APIPark,你需要安装 Docker 和 Docker Compose。 部署完成后,APIPark需要绑定API网关节点才可使用,具体教程请参考配置API网关 部署APIPark+API网关 编辑config.yml vi config.yml 修改文件配置 version: 2 #certificate: # 证书存放根目录 # dir: /etc/apinto/cert client: advertise_urls: # open api 服务的广播地址 - http://{IP}:9400 listen_urls: # open api 服务的监听地址 - http://0.0.0.0:9400 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key gateway: advertise_urls: # 转发服务的广播地址 - http://{IP}:8099 - https://{IP}:8099 listen_urls: # 转发服务的监听地址 - https://0.0.0.0:8099 - http://0.0.0.0:8099 peer: # 集群间节点通信配置信息 listen_urls: # 节点监听地址 - http://0.0.0.0:9401 advertise_urls: # 节点通信广播地址 - http://{IP}:9401 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key 上述配置中的{IP}是一个变量,应该填写容器所在宿主机IP,假设宿主机IP为172.18.65.22,则此配置应如下 version: 2 #certificate: # 证书存放根目录 # dir: /etc/apinto/cert client: advertise_urls: # open api 服务的广播地址 - http://172.18.65.22:9400 listen_urls: # open api 服务的监听地址 - http://0.0.0.0:9400 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key gateway: advertise_urls: # 转发服务的广播地址 - http://172.18.65.22:8099 - https://172.18.65.22:8099 listen_urls: # 转发服务的监听地址 - https://0.0.0.0:8099 - http://0.0.0.0:8099 peer: # 集群间节点通信配置信息 listen_urls: # 节点监听地址 - http://0.0.0.0:9401 advertise_urls: # 节点通信广播地址 - http://172.18.65.22:9401 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key 配置说明 字段名称 说明 version 配置版本号,默认2 client openAPI配置信息 client -> listen_urls openAPI监听地址列表,格式:{协议}://{IP}:{端口} client -> advertise_urls openAPI广播地址列表,在控制台集群节点列表中展示,格式:{协议}://{IP/域名}:{端口} client -> certificate openAPI证书信息列表 gateway 转发代理核心程序配置信息 gateway -> listen_urls 转发代理核心程序监听地址列表,格式:{协议}://{IP}:{端口} gateway -> advertise_urls 转发代理核心程序广播地址列表,在控制台集群节点列表中展示,格式:{协议}://{IP/域名}:{端口} peer Raft节点配置信息,用于Raft集群节点配置同步、加入集群、离开集群等操作的通信 peer -> listen_urls Raft节点监听地址列表,格式:{协议}://{IP}:{端口} peer -> advertise_urls Raft节点广播地址列表,格式:{协议}://{IP/域名}:{端口} peer -> certificate Raft节点证书信息列表 编辑docker-compose.yml文件 vi docker-compose.yml 修改文件配置 version: '3' services: apipark-mysql: image: mysql:8.0.37 privileged: true restart: always container_name: apipark-mysql hostname: apipark-mysql command: - "--character-set-server=utf8mb4" - "--collation-server=utf8mb4_unicode_ci" ports: - "33306:3306" environment: - MYSQL_ROOT_PASSWORD={MYSQL_PWD} - MYSQL_DATABASE=apipark volumes: - /var/lib/apipark/mysql:/var/lib/mysql networks: - apipark apipark: image: apipark/apipark:v1.7.3-beta container_name: apipark privileged: true restart: always networks: - apipark ports: - "18288:8288" depends_on: - apipark-mysql environment: - MYSQL_USER_NAME=root - MYSQL_PWD={MYSQL_PWD} - MYSQL_IP=apipark-mysql - MYSQL_PORT=3306 #mysql端口 - MYSQL_DB="apipark" - ERROR_DIR=work/logs # 日志放置目录 - ERROR_FILE_NAME=error.log # 错误日志文件名 - ERROR_LOG_LEVEL=info # 错误日志等级,可选:panic,fatal,error,warning,info,debug,trace 不填或者非法则为info - ERROR_EXPIRE=7d # 错误日志过期间,默认单位为天,d|天,h|小, 不合法配置默认为7d - ERROR_PERIOD=day # 错误日志切割周期,仅支持day、hour - REDIS_ADDR=apipark-redis:6379 #Redis集群地址 多个用,隔开 - REDIS_PWD={REDIS_PWD} # Redis密码 - ADMIN_PASSWORD={ADMIN_PASSWORD} - Init=true - InfluxdbToken={INFLUXDB_TOKEN} apipark-influxdb: image: influxdb:2.6 privileged: true restart: always container_name: apipark-influxdb hostname: apipark-influxdb ports: - "8086:8086" volumes: - /var/lib/apipark/influxdb2:/var/lib/influxdb2 environment: - DOCKER_INFLUXDB_INIT_USERNAME=admin - DOCKER_INFLUXDB_INIT_PASSWORD=Key123qaz - DOCKER_INFLUXDB_INIT_ORG=apipark - DOCKER_INFLUXDB_INIT_BUCKET=apinto - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN={INFLUXDB_TOKEN} - DOCKER_INFLUXDB_INIT_MODE=setup networks: - apipark apipark-redis: container_name: apipark-redis image: redis:7.2.4 hostname: apipark-redis privileged: true restart: always ports: - 6379:6379 command: - bash - -c - "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass {REDIS_PWD}" networks: - apipark apipark-loki: container_name: apipark-loki image: grafana/loki:3.2.1 hostname: apipark-loki privileged: true user: root restart: always ports: - 3100:3100 entrypoint: - sh - -euc - | mkdir -p /mnt/config cat <<EOF > /mnt/config/loki-config.yaml --- auth_enabled: false server: http_listen_port: 3100 grpc_listen_port: 9096 common: instance_addr: 127.0.0.1 path_prefix: /tmp/loki storage: filesystem: chunks_directory: /tmp/loki/chunks rules_directory: /tmp/loki/rules replication_factor: 1 ring: kvstore: store: inmemory query_range: results_cache: cache: embedded_cache: enabled: true max_size_mb: 100 schema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v13 index: prefix: index_ period: 24h limits_config: max_query_length: 90d # 设置最大查询长为 30 天 ruler: alertmanager_url: http://localhost:9093 # By default, Loki will send anonymous, but uniquely-identifiable usage and configuration # analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ # # Statistics help us better understand how Loki is used, and they show us performance # levels for most users. This helps us prioritize features and documentation. # For more information on what's sent, look at # https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go # Refer to the buildReport method to see what goes into a report. # # If you would like to disable reporting, uncomment the following lines: #analytics: # reporting_enabled: false table_manager: retention_period: 90d EOF /usr/bin/loki -config.file=/mnt/config/loki-config.yaml networks: - apipark apipark-grafana: container_name: apipark-grafana image: grafana/grafana:11.3.2 hostname: apipark-grafana privileged: true restart: always environment: - GF_PATHS_PROVISIONING=/etc/grafana/provisioning - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin depends_on: - apipark-loki entrypoint: - sh - -euc - | mkdir -p /etc/grafana/provisioning/datasources cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml apiVersion: 1 datasources: - name: Loki type: loki access: proxy url: http://apipark-loki:3100 EOF /run.sh ports: - "3000:3000" healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1" ] interval: 10s timeout: 5s retries: 5 networks: - apipark apipark-nsq: container_name: apipark-nsq image: nsqio/nsq:v1.3.0 hostname: apipark-nsq privileged: true restart: always command: - /nsqd ports: - 4150:4150 - 4151:4151 networks: - apipark apipark-apinto: image: eolinker/apinto-gateway container_name: apipark-apinto privileged: true restart: always ports: - "18099:8099" - "19400:9400" - "19401:9401" volumes: - /var/lib/apipark/apinto/data:/var/lib/apinto - /var/lib/apipark/apinto/log:/var/log/apinto - ${PWD}/config.yml:/etc/apinto/config.yml networks: - apipark networks: apipark: driver: bridge ipam: driver: default config: - subnet: 172.100.0.0/24 上述配置中,使用 "" 包裹的均为变量,相关变量说明如下: **MYSQL_PWD:**mysql数据库root用户初始化密码 **REDIS_PWD:**redis密码 **ADMIN_PASSWORD:**APIPark Admin账号初始密码 **INFLUXDB_TOKEN:**InfluxDB 初始化Token 替换后配置示例如下: version: '3' services: apipark-mysql: image: mysql:8.0.37 privileged: true restart: always container_name: apipark-mysql hostname: apipark-mysql command: - "--character-set-server=utf8mb4" - "--collation-server=utf8mb4_unicode_ci" ports: - "33306:3306" environment: - MYSQL_ROOT_PASSWORD=123456 - MYSQL_DATABASE=apipark volumes: - /var/lib/apipark/mysql:/var/lib/mysql networks: - apipark apipark: image: apipark/apipark:v1.7.3-beta container_name: apipark privileged: true restart: always networks: - apipark ports: - "18288:8288" depends_on: - apipark-mysql environment: - MYSQL_USER_NAME=root - MYSQL_PWD=123456 - MYSQL_IP=apipark-mysql - MYSQL_PORT=3306 #mysql端口 - MYSQL_DB="apipark" - ERROR_DIR=work/logs # 日志放置目录 - ERROR_FILE_NAME=error.log # 错误日志文件名 - ERROR_LOG_LEVEL=info # 错误日志等级,可选:panic,fatal,error,warning,info,debug,trace 不填或者非法则为info - ERROR_EXPIRE=7d # 错误日志过期间,默认单位为天,d|天,h|小, 不合法配置默认为7d - ERROR_PERIOD=day # 错误日志切割周期,仅支持day、hour - REDIS_ADDR=apipark-redis:6379 #Redis集群地址 多个用,隔开 - REDIS_PWD=123456 # Redis密码 - ADMIN_PASSWORD=12345678 - Init=true - InfluxdbToken=dQ9>fK6&gJ apipark-influxdb: image: influxdb:2.6 privileged: true restart: always container_name: apipark-influxdb hostname: apipark-influxdb ports: - "8086:8086" volumes: - /var/lib/apipark/influxdb2:/var/lib/influxdb2 environment: - DOCKER_INFLUXDB_INIT_USERNAME=admin - DOCKER_INFLUXDB_INIT_PASSWORD=Key123qaz - DOCKER_INFLUXDB_INIT_ORG=apipark - DOCKER_INFLUXDB_INIT_BUCKET=apinto - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=dQ9>fK6&gJ - DOCKER_INFLUXDB_INIT_MODE=setup networks: - apipark apipark-redis: container_name: apipark-redis image: redis:7.2.4 hostname: apipark-redis privileged: true restart: always ports: - 6379:6379 command: - bash - -c - "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass 123456" networks: - apipark apipark-loki: container_name: apipark-loki image: grafana/loki:3.2.1 hostname: apipark-loki privileged: true user: root restart: always ports: - 3100:3100 entrypoint: - sh - -euc - | mkdir -p /mnt/config cat <<EOF > /mnt/config/loki-config.yaml --- auth_enabled: false server: http_listen_port: 3100 grpc_listen_port: 9096 common: instance_addr: 127.0.0.1 path_prefix: /tmp/loki storage: filesystem: chunks_directory: /tmp/loki/chunks rules_directory: /tmp/loki/rules replication_factor: 1 ring: kvstore: store: inmemory query_range: results_cache: cache: embedded_cache: enabled: true max_size_mb: 100 schema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v13 index: prefix: index_ period: 24h limits_config: max_query_length: 90d # 设置最大查询长为 30 天 ruler: alertmanager_url: http://localhost:9093 # By default, Loki will send anonymous, but uniquely-identifiable usage and configuration # analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ # # Statistics help us better understand how Loki is used, and they show us performance # levels for most users. This helps us prioritize features and documentation. # For more information on what's sent, look at # https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go # Refer to the buildReport method to see what goes into a report. # # If you would like to disable reporting, uncomment the following lines: #analytics: # reporting_enabled: false table_manager: retention_period: 90d EOF /usr/bin/loki -config.file=/mnt/config/loki-config.yaml networks: - apipark apipark-grafana: container_name: apipark-grafana image: grafana/grafana:11.3.2 hostname: apipark-grafana privileged: true restart: always environment: - GF_PATHS_PROVISIONING=/etc/grafana/provisioning - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin depends_on: - apipark-loki entrypoint: - sh - -euc - | mkdir -p /etc/grafana/provisioning/datasources cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml apiVersion: 1 datasources: - name: Loki type: loki access: proxy url: http://apipark-loki:3100 EOF /run.sh ports: - "3000:3000" healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1" ] interval: 10s timeout: 5s retries: 5 networks: - apipark apipark-nsq: container_name: apipark-nsq image: nsqio/nsq:v1.3.0 hostname: apipark-nsq privileged: true restart: always command: - /nsqd ports: - 4150:4150 - 4151:4151 networks: - apipark apipark-apinto: image: eolinker/apinto-gateway container_name: apipark-apinto privileged: true restart: always ports: - "18099:8099" - "19400:9400" - "19401:9401" volumes: - /var/lib/apipark/apinto/data:/var/lib/apinto - /var/lib/apipark/apinto/log:/var/log/apinto - ${PWD}/config.yml:/etc/apinto/config.yml networks: - apipark networks: apipark: driver: bridge ipam: driver: default config: - subnet: 172.100.0.0/24 启动APIPark docker-compose up -d 执行完成后,将出现如下图所示: 单独部署APIPark 编辑docker-compose.yml文件 vi docker-compose.yml 修改文件配置 version: '3' services: apipark-mysql: image: mysql:8.0.37 privileged: true restart: always container_name: apipark-mysql hostname: apipark-mysql command: - "--character-set-server=utf8mb4" - "--collation-server=utf8mb4_unicode_ci" ports: - "33306:3306" environment: - MYSQL_ROOT_PASSWORD={MYSQL_PWD} - MYSQL_DATABASE=apipark volumes: - /var/lib/apipark/mysql:/var/lib/mysql networks: - apipark apipark: image: apipark/apipark:v1.7.3-beta container_name: apipark privileged: true restart: always networks: - apipark ports: - "18288:8288" depends_on: - apipark-mysql environment: - MYSQL_USER_NAME=root - MYSQL_PWD={MYSQL_PWD} - MYSQL_IP=apipark-mysql - MYSQL_PORT=3306 #mysql端口 - MYSQL_DB="apipark" - ERROR_DIR=work/logs # 日志放置目录 - ERROR_FILE_NAME=error.log # 错误日志文件名 - ERROR_LOG_LEVEL=info # 错误日志等级,可选:panic,fatal,error,warning,info,debug,trace 不填或者非法则为info - ERROR_EXPIRE=7d # 错误日志过期间,默认单位为天,d|天,h|小, 不合法配置默认为7d - ERROR_PERIOD=day # 错误日志切割周期,仅支持day、hour - REDIS_ADDR=apipark-redis:6379 #Redis集群地址 多个用,隔开 - REDIS_PWD={REDIS_PWD} # Redis密码 - ADMIN_PASSWORD={ADMIN_PASSWORD} - Init=true - InfluxdbToken={INFLUXDB_TOKEN} apipark-influxdb: image: influxdb:2.6 privileged: true restart: always container_name: apipark-influxdb hostname: apipark-influxdb ports: - "8086:8086" volumes: - /var/lib/apipark/influxdb2:/var/lib/influxdb2 environment: - DOCKER_INFLUXDB_INIT_USERNAME=admin - DOCKER_INFLUXDB_INIT_PASSWORD=Key123qaz - DOCKER_INFLUXDB_INIT_ORG=apipark - DOCKER_INFLUXDB_INIT_BUCKET=apinto - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN={INFLUXDB_TOKEN} - DOCKER_INFLUXDB_INIT_MODE=setup networks: - apipark apipark-redis: container_name: apipark-redis image: redis:7.2.4 hostname: apipark-redis privileged: true restart: always ports: - 6379:6379 command: - bash - -c - "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass {REDIS_PWD}" networks: - apipark apipark-loki: container_name: apipark-loki image: grafana/loki:3.2.1 hostname: apipark-loki privileged: true user: root restart: always ports: - 3100:3100 entrypoint: - sh - -euc - | mkdir -p /mnt/config cat <<EOF > /mnt/config/loki-config.yaml --- auth_enabled: false server: http_listen_port: 3100 grpc_listen_port: 9096 common: instance_addr: 127.0.0.1 path_prefix: /tmp/loki storage: filesystem: chunks_directory: /tmp/loki/chunks rules_directory: /tmp/loki/rules replication_factor: 1 ring: kvstore: store: inmemory query_range: results_cache: cache: embedded_cache: enabled: true max_size_mb: 100 schema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v13 index: prefix: index_ period: 24h limits_config: max_query_length: 90d # 设置最大查询长为 30 天 ruler: alertmanager_url: http://localhost:9093 # By default, Loki will send anonymous, but uniquely-identifiable usage and configuration # analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ # # Statistics help us better understand how Loki is used, and they show us performance # levels for most users. This helps us prioritize features and documentation. # For more information on what's sent, look at # https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go # Refer to the buildReport method to see what goes into a report. # # If you would like to disable reporting, uncomment the following lines: #analytics: # reporting_enabled: false table_manager: retention_period: 90d EOF /usr/bin/loki -config.file=/mnt/config/loki-config.yaml networks: - apipark apipark-grafana: container_name: apipark-grafana image: grafana/grafana:11.3.2 hostname: apipark-grafana privileged: true restart: always environment: - GF_PATHS_PROVISIONING=/etc/grafana/provisioning - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin depends_on: - apipark-loki entrypoint: - sh - -euc - | mkdir -p /etc/grafana/provisioning/datasources cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml apiVersion: 1 datasources: - name: Loki type: loki access: proxy url: http://apipark-loki:3100 EOF /run.sh ports: - "3000:3000" healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1" ] interval: 10s timeout: 5s retries: 5 networks: - apipark apipark-nsq: container_name: apipark-nsq image: nsqio/nsq:v1.3.0 hostname: apipark-nsq privileged: true restart: always command: - /nsqd ports: - 4150:4150 - 4151:4151 networks: - apipark networks: apipark: driver: bridge ipam: driver: default config: - subnet: 172.100.0.0/24 上述配置中,使用 "" 包裹的均为变量,相关变量说明如下: **MYSQL_PWD:**mysql数据库root用户初始化密码 **REDIS_PWD:**redis密码 **ADMIN_PASSWORD:**APIPark Admin账号初始密码 **INFLUXDB_TOKEN:**InfluxDB 初始化Token 替换后配置示例如下: version: '3' services: apipark-mysql: image: mysql:8.0.37 privileged: true restart: always container_name: apipark-mysql hostname: apipark-mysql command: - "--character-set-server=utf8mb4" - "--collation-server=utf8mb4_unicode_ci" ports: - "33306:3306" environment: - MYSQL_ROOT_PASSWORD=123456 - MYSQL_DATABASE=apipark volumes: - /var/lib/apipark/mysql:/var/lib/mysql networks: - apipark apipark: image: apipark/apipark:v1.7.3-beta container_name: apipark privileged: true restart: always networks: - apipark ports: - "18288:8288" depends_on: - apipark-mysql environment: - MYSQL_USER_NAME=root - MYSQL_PWD=123456 - MYSQL_IP=apipark-mysql - MYSQL_PORT=3306 #mysql端口 - MYSQL_DB="apipark" - ERROR_DIR=work/logs # 日志放置目录 - ERROR_FILE_NAME=error.log # 错误日志文件名 - ERROR_LOG_LEVEL=info # 错误日志等级,可选:panic,fatal,error,warning,info,debug,trace 不填或者非法则为info - ERROR_EXPIRE=7d # 错误日志过期间,默认单位为天,d|天,h|小, 不合法配置默认为7d - ERROR_PERIOD=day # 错误日志切割周期,仅支持day、hour - REDIS_ADDR=apipark-redis:6379 #Redis集群地址 多个用,隔开 - REDIS_PWD=123456 # Redis密码 - ADMIN_PASSWORD=12345678 - Init=true - InfluxdbToken=dQ9>fK6&gJ apipark-influxdb: image: influxdb:2.6 privileged: true restart: always container_name: apipark-influxdb hostname: apipark-influxdb ports: - "8086:8086" volumes: - /var/lib/apipark/influxdb2:/var/lib/influxdb2 environment: - DOCKER_INFLUXDB_INIT_USERNAME=admin - DOCKER_INFLUXDB_INIT_PASSWORD=Key123qaz - DOCKER_INFLUXDB_INIT_ORG=apipark - DOCKER_INFLUXDB_INIT_BUCKET=apinto - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=dQ9>fK6&gJ - DOCKER_INFLUXDB_INIT_MODE=setup networks: - apipark apipark-redis: container_name: apipark-redis image: redis:7.2.4 hostname: apipark-redis privileged: true restart: always ports: - 6379:6379 command: - bash - -c - "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass 123456" networks: - apipark apipark-loki: container_name: apipark-loki image: grafana/loki:3.2.1 hostname: apipark-loki privileged: true user: root restart: always ports: - 3100:3100 entrypoint: - sh - -euc - | mkdir -p /mnt/config cat <<EOF > /mnt/config/loki-config.yaml --- auth_enabled: false server: http_listen_port: 3100 grpc_listen_port: 9096 common: instance_addr: 127.0.0.1 path_prefix: /tmp/loki storage: filesystem: chunks_directory: /tmp/loki/chunks rules_directory: /tmp/loki/rules replication_factor: 1 ring: kvstore: store: inmemory query_range: results_cache: cache: embedded_cache: enabled: true max_size_mb: 100 schema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v13 index: prefix: index_ period: 24h limits_config: max_query_length: 90d # 设置最大查询长为 30 天 ruler: alertmanager_url: http://localhost:9093 # By default, Loki will send anonymous, but uniquely-identifiable usage and configuration # analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ # # Statistics help us better understand how Loki is used, and they show us performance # levels for most users. This helps us prioritize features and documentation. # For more information on what's sent, look at # https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go # Refer to the buildReport method to see what goes into a report. # # If you would like to disable reporting, uncomment the following lines: #analytics: # reporting_enabled: false table_manager: retention_period: 90d EOF /usr/bin/loki -config.file=/mnt/config/loki-config.yaml networks: - apipark apipark-grafana: container_name: apipark-grafana image: grafana/grafana:11.3.2 hostname: apipark-grafana privileged: true restart: always environment: - GF_PATHS_PROVISIONING=/etc/grafana/provisioning - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin depends_on: - apipark-loki entrypoint: - sh - -euc - | mkdir -p /etc/grafana/provisioning/datasources cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml apiVersion: 1 datasources: - name: Loki type: loki access: proxy url: http://apipark-loki:3100 EOF /run.sh ports: - "3000:3000" healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1" ] interval: 10s timeout: 5s retries: 5 networks: - apipark apipark-nsq: container_name: apipark-nsq image: nsqio/nsq:v1.3.0 hostname: apipark-nsq privileged: true restart: always command: - /nsqd ports: - 4150:4150 - 4151:4151 networks: - apipark networks: apipark: driver: bridge ipam: driver: default config: - subnet: 172.100.0.0/24 启动APIPark docker-compose up -d 执行完成后,将出现如下图所示: 单独部署API网关 编辑config.yml vi config.yml 修改文件配置 version: 2 #certificate: # 证书存放根目录 # dir: /etc/apinto/cert client: advertise_urls: # open api 服务的广播地址 - http://{IP}:9400 listen_urls: # open api 服务的监听地址 - http://0.0.0.0:9400 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key gateway: advertise_urls: # 转发服务的广播地址 - http://{IP}:8099 - https://{IP}:8099 listen_urls: # 转发服务的监听地址 - https://0.0.0.0:8099 - http://0.0.0.0:8099 peer: # 集群间节点通信配置信息 listen_urls: # 节点监听地址 - http://0.0.0.0:9401 advertise_urls: # 节点通信广播地址 - http://{IP}:9401 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key 上述配置中的{IP}是一个变量,应该填写容器所在宿主机IP,假设宿主机IP为172.18.65.22,则此配置应如下 version: 2 #certificate: # 证书存放根目录 # dir: /etc/apinto/cert client: advertise_urls: # open api 服务的广播地址 - http://172.18.65.22:9400 listen_urls: # open api 服务的监听地址 - http://0.0.0.0:9400 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key gateway: advertise_urls: # 转发服务的广播地址 - http://172.18.65.22:8099 - https://172.18.65.22:8099 listen_urls: # 转发服务的监听地址 - https://0.0.0.0:8099 - http://0.0.0.0:8099 peer: # 集群间节点通信配置信息 listen_urls: # 节点监听地址 - http://0.0.0.0:9401 advertise_urls: # 节点通信广播地址 - http://172.18.65.22:9401 #certificate: # 证书配置,允许使用ip的自签证书 # - cert: server.pem # key: server.key 配置说明 字段名称 说明 version 配置版本号,默认2 client openAPI配置信息 client -> listen_urls openAPI监听地址列表,格式:{协议}://{IP}:{端口} client -> advertise_urls openAPI广播地址列表,在控制台集群节点列表中展示,格式:{协议}://{IP/域名}:{端口} client -> certificate openAPI证书信息列表 gateway 转发代理核心程序配置信息 gateway -> listen_urls 转发代理核心程序监听地址列表,格式:{协议}://{IP}:{端口} gateway -> advertise_urls 转发代理核心程序广播地址列表,在控制台集群节点列表中展示,格式:{协议}://{IP/域名}:{端口} peer Raft节点配置信息,用于Raft集群节点配置同步、加入集群、离开集群等操作的通信 peer -> listen_urls Raft节点监听地址列表,格式:{协议}://{IP}:{端口} peer -> advertise_urls Raft节点广播地址列表,格式:{协议}://{IP/域名}:{端口} peer -> certificate Raft节点证书信息列表 运行Docker容器,并挂载配置文件config.yml docker run -td -p 8099:8099 -p 9400:9400 -p 9401:9401 --privileged=true \ -v /var/lib/apinto/data:/var/lib/apinto \ -v /var/lib/apinto/log:/var/log/apinto \ -v ${PWD}/config.yml:/etc/apinto/config.yml \ --name=apinto_node eolinker/apinto-gateway:latest ./start.sh,我现在要从github上把这个项目拉起来,如何在idea里面运行跑起来,帮我从0到1把这个启动项目运行项目,最后打包需要配置的地方给我列出来
06-07
jzuser@vpc87-3:~/Work_dir/Gn/pystudy/NnuNet$ # 删除旧目录 rm -rf nnUNet # 克隆仓库 git clone https://github.com/MIC-DKFZ/nnUNet.git # 切换到 dev 分支 cd nnUNet git fetch origin git checkout dev # 安装为开发包 pip install -e . # 验证 python -c "from nnUNet.experiment_planning.planners import nnUNetPlanner2D; print('导入成功')" Cloning into 'nnUNet'... remote: Enumerating objects: 14005, done. remote: Counting objects: 100% (139/139), done. remote: Compressing objects: 100% (69/69), done. remote: Total 14005 (delta 104), reused 70 (delta 70), pack-reused 13866 (from 3) Receiving objects: 100% (14005/14005), 8.63 MiB | 32.00 KiB/s, done. Resolving deltas: 100% (10664/10664), done. fatal: unable to access 'https://github.com/MIC-DKFZ/nnUNet.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated. error: pathspec 'dev' did not match any file(s) known to git Defaulting to user installation because normal site-packages is not writeable Obtaining file:///home/jzuser/Work_dir/Gn/pystudy/NnuNet/nnUNet Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Installing collected packages: UNKNOWN Running setup.py develop for UNKNOWN error: subprocess-exited-with-error × python setup.py develop did not run successfully. │ exit code: 1 ╰─> [32 lines of output] running develop /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( WARNING: The user site-packages directory is disabled. /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/test-easy-install-10060.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/local/lib/python3.10/dist-packages/ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.pypa.io/en/latest/deprecated/easy_install.html Please make the appropriate changes for your system and try again. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × python setup.py develop did not run successfully. │ exit code: 1 ╰─> [32 lines of output] running develop /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( WARNING: The user site-packages directory is disabled. /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/test-easy-install-10060.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/local/lib/python3.10/dist-packages/ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.pypa.io/en/latest/deprecated/easy_install.html Please make the appropriate changes for your system and try again. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3
最新发布
08-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值