mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1565] How to run two frpc separately? 如何跑两个frpc #1237
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1237
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KumaTea on GitHub (Dec 15, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1565
Version 0.30.0
OS Ubuntu 18.04 LTS x86-64
How to run two
frpc(frp client) separately?如何同时运行两个
frpc客户端,分别连接不同的frps服务端?问题描述:
有一台境外主机 (F),一台境内主机 (D),均运行 frps 。
在D上,如果希望:
www.d.mydomain.com) 等服务backend.f.mydomain.com由于目前 frpc 的配置文件内只支持配置一个服务器地址,这种情况有较好的解决方案或开发计划吗?
@a0215cpl commented on GitHub (Dec 16, 2019):
用docker来实现,开两个镜像,分别来连接不同的frps。
@xqzr commented on GitHub (Dec 18, 2019):
./frpc -c ./frpc1.ini
./frpc -c ./frpc2.ini
./frpc -c ./frpc3.ini
...
@KumaTea commented on GitHub (Dec 19, 2019):
如果 frpc 原生支持多开的话,就不使用Docker了。晚点试下。。。
@qins commented on GitHub (Dec 2, 2020):
@KumaTea 请问下原生多开服务端找到了吗?
@KumaTea commented on GitHub (Dec 2, 2020):
@qins 我当时是这么解决的:
为了确保安全,设置了不同端口;后来也使用
screen以避免产生 log 文件。但是后来因为服务不多,就不再使用
frp了,不清楚现在是否仍然可用。@qins commented on GitHub (Dec 3, 2020):
@KumaTea Thanks 😊
国内云没有备案不让用80端口, 国外VPS的话网络不稳.
目前一直在寻找两全其美的办法
@revegnay commented on GitHub (Mar 2, 2021):
`➜ frp ll
total 8.0K
-rw-r--r-- 1 root root 687 Mar 2 10:36 frpc_ali.ini
-rw-r--r-- 1 root root 1.2K Mar 2 10:37 frpc_aws.ini
➜ frp pwd
/etc/frp
➜ frp cat /etc/systemd/system/frpc@.service
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=idle
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/%i.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/%i.ini
[Install]
WantedBy=multi-user.target
➜ frp systemctl enable --now frpc@frpc_ali
➜ frp systemctl enable --now frpc@frpc_aws
➜ ~ ps -aux | grep frpc
nobody 79012 0.1 0.0 713712 8908 ? Ssl 10:48 0:00 /usr/bin/frpc -c /etc/frp/frpc_ali.ini
nobody 79100 0.1 0.0 712048 8184 ? Ssl 10:48 0:00 /usr/bin/frpc -c /etc/frp/frpc_aws.ini
`
分别指定配置文件就可以了
遇到同样问题,寻遍google未解。
看到包里的frpc@.service,我陷入了深思,然后就发现了这个用法
@code-wangshuyi commented on GitHub (Aug 18, 2021):
强强强