docker部署stellar
V刘晨曦
发表于 2022-11-13 23:49:55
115
0
0
参考文档:https://github.com/stellar/docker-stellar-core-horizon
下载镜像,构建容器
//拉取 images ,根据配置启动 container' M7 u! A K1 ]$ t2 J. l/ `* u
docker run --rm -it -p “ 8000:8000 ” -v “ / home / scott / stellar:/ opt / stellar ” - name stellar stellar / quickstart --testnet
启动参数
–pubnet: 正式网络$ [9 h/ y3 i1 X$ h; g% j+ C) K; O0 L
–testnet: 测试网络& Q; v4 f9 S! h% b0 V7 q- D, w
–standalone: 私有网络
% ~& s% i- I' Z! m: M) ~" X
访问正在运行的stellar容器
sudo docker exec -it stellar /bin/bash+ Z4 U( u" t) n7 c
重启服务1 z; G+ u. x& i2 r5 W
在container(容器)中,可以使用 supervisord 来管理三个服务。
//前提已经进入对应的容器中,命令在上面+ d7 t4 r6 q' t5 }' R' t5 w
root@79e50b56739e:/# supervisorctl$ W5 S# i4 e8 M4 v
horizon RUNNING pid 22, uptime 3:19:328 e' |8 g: Q) C
postgresql RUNNING pid 20, uptime 3:19:32 ?5 M) j9 H* J: e0 ]0 J" d7 t
stellar-core RUNNING pid 751, uptime 3:12:11, \& c# N Y7 l7 v
//停止
supervisor> stop stellar-core / ]& ~: @2 t x
//重启* q% s" C1 ^; g( M; A/ g3 |
supervisor> restart horizon
//开始/ n- H$ K) s" d6 D- O# ]; r
supervisor> start horizon
查看日志
//进入对应的容器中,存放在如下路径
/var/log/supervisor/
supervisord管理的进程输出的stdout和stderr分别保留中2个文件中。4 s0 w4 g! k$ b: l: D. D
访问postgreSql数据库0 k; B: J" b G
账号:stellar
密码:第一次运行输入的密码
端口:5432
问题
Q:. n8 k* _, R7 ]' K" E
$ docker run -d -v "/str:/opt/stellar" -p "8000:8000" --name stellar stellar/quickstart --pubnet, g' e8 [9 ^7 g1 [" r* V2 R
$ 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
$ docker logs stellar: S W# [/ X- Z& v2 n! _
running `/start --pubnet'
pids are [5]+ j$ B4 H+ n1 N$ j
Starting Stellar Quickstart* i, d) g6 E% R( p
mode: persistent
network: pubnet (Public Global Stellar Network ; September 2015)
postgres: config directory exists, skipping copy6 v2 V# x1 C8 V/ u
supervisor: config directory exists, skipping copy
stellar-core: config directory exists, skipping copy5 ~( Q& l8 h& V- c6 o9 w
horizon: config directory exists, skipping copy$ V( T- W8 x8 s9 k& o, Y5 u
postgres user: stellar
exited 5
A:3 Q6 |3 x* U$ ]2 m y6 [
删除启动时候映射的文件夹,再次启动。例如-v “/data/home/admin/stellar:/opt/stellar” 中的/data/home/admin/stellar。' c; c* [! h& R I2 ]) i
Q:# Z0 G( V4 U6 h5 G
winpty docker run --rm -it -p "15432:5432" -p "18000:8000" -p "11626:11626" - "c:/some/local/path:/opt/stellar" --name stellar tellar/quickstart --testnet0 }' h7 u y/ M
running `/start --testnet'
pids are [5]% F! }3 m' }* n9 J8 O5 r
Starting Stellar Quickstart
mode: persistent, V- U% T% R, S" {, m
network: testnet (Test SDF Network ; September 2015)
postgres user: stellar+ }; R& P( M5 \+ _
Enter New Postgresql Password:
Confirm:) q; p6 @2 |4 t5 B" }
init-postgres: yes0 Z1 j2 C* e4 o; I# ]/ [
ok
Waiting for postgres to be available...
Waiting for postgres to be available...
Waiting for postgres to be available...4 I/ g' G$ i. J7 a8 E( K7 p1 ~, [( `4 l
Waiting for postgres to be available...
A:& ]2 F/ l5 f7 U7 m
将docker 升级到最新版本。# h& \' n+ j# ?4 s4 R* c
成为第一个吐槽的人