docker部署stellar
V刘晨曦
发表于 2022-11-13 23:49:55
159
0
0
参考文档:https://github.com/stellar/docker-stellar-core-horizon/ E C ^4 K2 q$ a: F+ X
下载镜像,构建容器
//拉取 images ,根据配置启动 container7 D5 S3 ^( o# }# z; Q* r3 n
docker run --rm -it -p “ 8000:8000 ” -v “ / home / scott / stellar:/ opt / stellar ” - name stellar stellar / quickstart --testnet
启动参数
–pubnet: 正式网络: m0 `0 H( X6 b e% K8 j& A8 A3 w, b1 A
–testnet: 测试网络) m* t; l) f/ C$ z" V" b' ~
–standalone: 私有网络
. P" q9 W; T9 w9 B6 w
访问正在运行的stellar容器; Q) T, ?% ]2 D6 ?; ]6 ?1 N1 Z
sudo docker exec -it stellar /bin/bash
重启服务% W( P6 }* y+ g( |' k5 E! K
在container(容器)中,可以使用 supervisord 来管理三个服务。, [. t7 N& k/ x% |
//前提已经进入对应的容器中,命令在上面+ \: c* B1 a2 y4 I F$ Q0 U! q
root@79e50b56739e:/# supervisorctl( Y' T. c6 ^" O" x
horizon RUNNING pid 22, uptime 3:19:325 K6 H+ g/ Y& t, w
postgresql RUNNING pid 20, uptime 3:19:32% o' L3 j- X5 c2 ^
stellar-core RUNNING pid 751, uptime 3:12:116 q; o5 L: d( m5 e9 Y2 o7 j. }7 ]8 G
//停止* u' n3 [% ^+ n h) k% J( l6 @
supervisor> stop stellar-core
//重启
supervisor> restart horizon# @% R+ D7 i/ N
//开始
supervisor> start horizon1 c$ w) w& _6 n# _. Y& i, |+ e1 h
查看日志3 _+ w* h# c+ V) Y9 z) \2 k* F
//进入对应的容器中,存放在如下路径 k% I3 n3 y# e* q3 x
/var/log/supervisor/
supervisord管理的进程输出的stdout和stderr分别保留中2个文件中。
访问postgreSql数据库
账号:stellar$ p2 I6 e; K$ s1 S. S
密码:第一次运行输入的密码/ @& `' z6 R: J
端口:5432 E. H; s! G* L0 Q* W# E2 y
问题
Q:4 O# `& [3 ^0 v2 Q
$ docker run -d -v "/str:/opt/stellar" -p "8000:8000" --name stellar stellar/quickstart --pubnet. h$ Y# I2 Y. t X! B, |& _( d K
$ docker container ls -al
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7bda77b07a53 stellar/quickstart "/init -- /start -..." 5 seconds ago Exited (0) 4 seconds ago stellar' _. X, ^/ x; E5 Y* }9 o$ N
$ docker logs stellar' u2 S7 O C9 U4 N2 k5 N3 y! l7 K
running `/start --pubnet'4 r& s% x2 x4 `% Q5 N
pids are [5]
Starting Stellar Quickstart/ y& W9 \; s9 I* B+ A. `% K2 }
mode: persistent% w+ y% I8 G0 T2 |4 E# g2 g
network: pubnet (Public Global Stellar Network ; September 2015); S+ j# n8 E" r
postgres: config directory exists, skipping copy! Q% Y3 j& h0 i% U+ h# ~' s
supervisor: config directory exists, skipping copy# k8 Y" a4 y8 C# p( }* Z4 P
stellar-core: config directory exists, skipping copy
horizon: config directory exists, skipping copy3 a! d5 }2 y9 y
postgres user: stellar" y, d1 K6 s! x/ K
exited 56 R5 s& J! j$ l5 q7 w. ?
A:
删除启动时候映射的文件夹,再次启动。例如-v “/data/home/admin/stellar:/opt/stellar” 中的/data/home/admin/stellar。+ G( d/ z/ |# N0 ?4 Y- p
Q:
winpty docker run --rm -it -p "15432:5432" -p "18000:8000" -p "11626:11626" - "c:/some/local/path:/opt/stellar" --name stellar tellar/quickstart --testnet
running `/start --testnet'
pids are [5]- z( W, S6 o- E, F. w0 _7 T% L
Starting Stellar Quickstart, n6 U. G. Q" M2 Z z& p, M3 ?
mode: persistent
network: testnet (Test SDF Network ; September 2015)+ l8 i: X0 ]" I/ @3 R% K; ^8 Y
postgres user: stellar
Enter New Postgresql Password:
Confirm:
init-postgres: yes3 D' \7 ?! L! Q: i ]# `7 w
ok$ }, {, _: H* d
Waiting for postgres to be available...
Waiting for postgres to be available...
Waiting for postgres to be available...( x- x( I' O7 v4 C W( X
Waiting for postgres to be available...
A:
将docker 升级到最新版本。
成为第一个吐槽的人