Skip to content

Instantly share code, notes, and snippets.

@c4pt0r
Last active February 25, 2024 14:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save c4pt0r/1324c529ced4ca742bb8400040528ae6 to your computer and use it in GitHub Desktop.
Save c4pt0r/1324c529ced4ca742bb8400040528ae6 to your computer and use it in GitHub Desktop.
Build your own Dropbox using TiDB Cloud Free Tier + JuiceFS + AWS S3 in 2 lines.
1. Open S3 service in AWS, create bucket and get the access point, like this: https://${bucket-name}.s3.us-west-2.amazonaws.com
2. Go to https://tidbcloud.com and register a new free TiDB instance (10G), get a MySQL endpoint, and make sure the traffic filter is properly configured to allow public access.
3. Install the juicefs client locally in Distributed Mode (https://juicefs.com/docs/community/getting-started/for_distributed)
4. initialize and mount FUSE according to the following two lines:
# juicefs format --storage s3 \
--bucket https://${bucket-name}.s3.us-west-2.amazonaws.com \
--access-key ${aws-access-key} \
--secret-key ${aws-secret} \
mysql://${mysql-user}:${mysql-password}@\(your-cloud-tidb.prod.aws.tidbcloud.com:4000\)/juice \
myjfs
# juicefs mount mysql://${mysql-user}:${mysql-password}@\(your-cloud-tidb.prod.aws.tidbcloud.com:4000\)/juice mnt
5. You're all set!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment