StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.74k stars 1.75k forks source link

allin1-ubuntu container image should support PV so that you can restart the image and i'll still have data #22718

Closed alberttwong closed 1 year ago

alberttwong commented 1 year ago

Enhancement

alberttwong commented 1 year ago

Cannot add PV. If you create the PV, use it and then try to reattach again, SR doesn't start up

atwong@Alberts-MBP ~ % docker volume create starrocks-storage-be
docker volume create starrocks-storage-fe
docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd --name=starrocks -v starrocks-storage-be:/data/deploy/starrocks/be/storage -v starrocks-storage-fe:/data/deploy/starrocks/fe/meta registry.starrocks.io/starrocks/allin1-ubuntu
starrocks-storage-be
starrocks-storage-fe
3242eedacb36b21b4e6c20692f56a6ed19b275a2690393580d19ef538c7561e9
atwong@Alberts-MBP ~ % docker stop starrocks
starrocks
atwong@Alberts-MBP ~ % docker rm starrocks
starrocks
atwong@Alberts-MBP ~ % 
docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd --name=starrocks -v starrocks-storage-be:/data/deploy/starrocks/be/storage -v starrocks-storage-fe:/data/deploy/starrocks/fe/meta registry.starrocks.io/starrocks/allin1-ubuntu
bf93284966d773d7aa9d6888f5493c43a8fe005d2872fad6988211d2a23582e4
atwong@Alberts-MBP ~ % mysql -P9030 -h127.0.0.1 -uroot --prompt="StarRocks > "
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
ss892714028 commented 1 year ago

Cannot add PV. If you create the PV, use it and then try to reattach again, SR doesn't start up

atwong@Alberts-MBP ~ % docker volume create starrocks-storage-be
docker volume create starrocks-storage-fe
docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd --name=starrocks -v starrocks-storage-be:/data/deploy/starrocks/be/storage -v starrocks-storage-fe:/data/deploy/starrocks/fe/meta registry.starrocks.io/starrocks/allin1-ubuntu
starrocks-storage-be
starrocks-storage-fe
3242eedacb36b21b4e6c20692f56a6ed19b275a2690393580d19ef538c7561e9
atwong@Alberts-MBP ~ % docker stop starrocks
starrocks
atwong@Alberts-MBP ~ % docker rm starrocks
starrocks
atwong@Alberts-MBP ~ % 
docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd --name=starrocks -v starrocks-storage-be:/data/deploy/starrocks/be/storage -v starrocks-storage-fe:/data/deploy/starrocks/fe/meta registry.starrocks.io/starrocks/allin1-ubuntu
bf93284966d773d7aa9d6888f5493c43a8fe005d2872fad6988211d2a23582e4
atwong@Alberts-MBP ~ % mysql -P9030 -h127.0.0.1 -uroot --prompt="StarRocks > "
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

Probably because of the IP changed... You need to either enable FQDN or give it a static IP

alberttwong commented 1 year ago

https://github.com/StarRocks/starrocks/blob/main/docker/dockerfiles/allin1/start_fe_be.sh looks like FQDN is enabled.

ss892714028 commented 1 year ago

https://github.com/StarRocks/starrocks/blob/main/docker/dockerfiles/allin1/start_fe_be.sh looks like FQDN is enabled.

xI9p1jBhVt You are right, let me take another look....

alberttwong commented 1 year ago

Tried

docker network create --subnet=172.20.0.0/16 customnetwork
docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd --name=starrocks -v starrocks-storage-be:/data/deploy/starrocks/be/storage -v starrocks-storage-fe:/data/deploy/starrocks/fe/meta --ip 172.20.0.10 --net customnetwork registry.starrocks.io/starrocks/allin1-ubuntu

Doesn't matter if static or dynamic IP.

The issue is: If you're "docker rm starrocks", you can't reattach the the PV storage anymore. You can have to delete all resources. If you want to use the storage again and again to persist the data between restarts, you need to "docker stop starrocks" and "docker run starrocks".

alberttwong commented 1 year ago

This "kind of" works per above comment.

kevincai commented 1 year ago

this will not be an issue since our 3.1 allin1 container. we use fixed 127.0.0.1 to register the services inside container.