Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose.yaml cannot work from outside the local environment. #67

Open
jainal09 opened this issue Jan 30, 2021 · 6 comments
Open
Labels
docker Deployed in docker

Comments

@jainal09
Copy link

Description

I am following the docker compose cluster tutorial from here - http://tendis.cn/#/Tendisplus/%E8%BF%90%E7%BB%B4/new_cluster_compose?id=docker-compose%e7%89%88

It works as expected. But, i want to access this cluster from outside (i deployed this docker-compose in a vm)
But, when I try to access this from outside the vm through the vm's global ip it does not work because I believe in the docker compose file there are hard coded ip address and also subnet is also 192.168.98.0/24 so when accessing it from out side it gets forwarded to 192.168.98.12 but for a global network this is not possible as 192.168.98.12 is the local ip of the virtual machine.

Expected Behavior

It should be docker host binded so when accessing from outside it should be redirected to host ip of the local machine.

Current Behavior

mentioned in the desciption

Possible Solution

something like this --network: host should be added in networks of compose file.

Steps to Reproduce (for bugs)

just run the docker-compose file on a cloud vm and try to access it from outside where the redis host is the global ip of the vm
eg.
My global ip of the cloud vm is - 40.114.118.11
But when i try to access the cluster:
image

However from inside the vm:
image

Context

Trying to deploy the cluster for PROD.

Your Environment

  • Operating System and version: ubuntu 18
  • Machine Specifications: 2vcpus 8gb ram 500 gb ssd
  • Tendis Version:
  • Tendis Configuration: docker-compose.yaml
  • IO/Network used:
  • Link to your project:
@jainal09
Copy link
Author

@orangeagain @TendisDev

@OMG-By
Copy link

OMG-By commented Feb 2, 2021

docker-compose.yaml is docker compose default config file.

  1. if you want cloud vm access cluster. you can use redis-cli -h ip -p 30000 -a tendisplustest -c to access. because docker port 51002 mapping localhost 30000. can use docker ps -a look this.
  2. if you want modify subnet. you can modify docker-compose.yaml or use helm to build cluster.
  3. --network may have safe problem. and cluster node port all is 51002. cluster will build fail.

@jainal09
Copy link
Author

jainal09 commented Feb 14, 2021

Yes, redis-cli -h 40.114.118.11 -p 30000 -a tendisplustest -c will solve the connection problem.
But when i will run the set command it will redirect to 192.168.98.22:51002 which for the global tendis cluster deployment is incorrect what should I do in such condition.
Please see the below screen shot accessing a redis cluster located in a Vm with ip - 40.114.118.11
image
@OMG-By

@jainal09
Copy link
Author

any updates on this @tencent-adm @OMG-By @vinchen @Evil-crow

@OMG-By
Copy link

OMG-By commented Feb 20, 2021

In my env. it can work success.
image
image
image

you can use cluster nodes and cluster info see cluster state.
@jainal09 What is your build process?

@OMG-By
Copy link

OMG-By commented Feb 20, 2021

And If you've ever failed to build. you should rm tendis tmp data dir /data/tmp/.
This might affect the new cluster env.

@huawux huawux added the docker Deployed in docker label Mar 5, 2021
TendisDev added a commit that referenced this issue Apr 21, 2021
fix some bugs
fix some bugs:
1. add check for changing ReplManager::_logRecycStatus::saveBinlogId
2. RocksKVStore::truncateBinlogV2 need change newSave #71 
3. RepllogCursorV2 use BinlogCursor instead of Cursor
4. change Transaction::createCursor() and RocksTxn::createCursor() to be protected #67 
5. RocksKVCursor dont call seek("") anymore, and add a check of seeked. #67 

[OPT] deleteRangeBinlog call compactRange() after deleteRange() #70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Deployed in docker
Projects
None yet
Development

No branches or pull requests

3 participants