get it set up<\/a> before continuing.<\/p>\n\n\n\ngit clone https:\/\/github.com\/flynn-examples\/go-flynn-example<\/pre>\n\n\n\nChange into the downloaded directory.<\/p>\n\n\n\n
cd go-flynn-example<\/pre>\n\n\n\nThen create a new application on Flynn.<\/p>\n\n\n\n
flynn create example<\/pre>\n\n\n\nDoing so adds a new Flynn Git remote which you can verify using the following command.<\/p>\n\n\n\n
git remote -v<\/pre>\n\n\n\nflynn https:\/\/git.flynn.example.com\/example.git (push)\nflynn https:\/\/git.flynn.example.com\/example.git (fetch)\norigin https:\/\/github.com\/flynn\/nodejs-flynn-example.git (fetch)\norigin https:\/\/github.com\/flynn\/nodejs-flynn-example.git (push)<\/pre>\n\n\n\nEach application should also have a default route that can be seen with the next command.<\/p>\n\n\n\n
flynn route<\/pre>\n\n\n\nROUTE SERVICE ID STICKY LEADER PATH\nhttp:example.flynn.example.com example-web http\/46d02fc6-9a21... false false \/<\/pre>\n\n\n\nWhile much of the database operations are performed automatically, you will still need to create one for the applications to use.<\/p>\n\n\n\n
flynn resource add postgres<\/pre>\n\n\n\nThe preparations are then complete and you can deploy the application to the cluster using the next command.<\/p>\n\n\n\n
git push flynn master<\/pre>\n\n\n\n=====> Application deployed\nTo https:\/\/git.flynn.example.com\/example.git\n* [new branch] master -> master<\/pre>\n\n\n\nAt the end of the deployment output, you should see a confirmation of what was deployed and where. You can then open the application URL in a web browser or use curl<\/tt> as shown below to test the application by replacing the <flynn.example.com><\/tt> with the cluster domain.<\/p>\n\n\n\ncurl http:\/\/example.<flynn.example.com><\/pre>\n\n\n\nHello from Flynn on port 8080 from container 4767bda1-f828-4191-bcb7-864c4096e052\nHits = 1<\/pre>\n\n\n\nGreat, the example application is working and responding correctly.<\/p>\n\n\n\n
One of the main advantages of a cluster is redundancy in multiple replicas of the services, but the application is currently running only a single instance. To increase the number of instances, use the following command.<\/p>\n\n\n\n
flynn scale web=3<\/pre>\n\n\n\nscaling web: 1=>3\n07:02:27.944 ==> web 56815ce0-3536-41b0-b385-3beb08712c6d pending\n07:02:27.944 ==> web 881b65b0-caa1-4715-9280-2c22f02756ff pending\n07:02:27.944 ==> web flynn-881b65b0-caa1-4715-9280-2c22f02756ff starting\n07:02:27.944 ==> web flynn-56815ce0-3536-41b0-b385-3beb08712c6d starting\n07:02:28.447 ==> web flynn-56815ce0-3536-41b0-b385-3beb08712c6d up\n07:02:28.447 ==> web flynn-881b65b0-caa1-4715-9280-2c22f02756ff up<\/pre>\n\n\n\n<\/tt>If you now refresh your browser window or run the curl<\/tt> command as above a couple of times, you should see replies from 3 different container IDs.<\/p>\n\n\n\nConclusions<\/h2>\n\n\n\n
Congratulations, you should now have a production-ready Flynn cluster at your disposal. Next, you might want to look into deploying your own applications on Flynn. To find out more about Flynn and its advanced features, check out the Flynn application documentation<\/a> pages.<\/p>\n\n\n\nFlynn also gets better every day as they track the infrastructure space and regularly integrate new components and features. New and modern technologies are often quickly available without the users needing to figure out how everything fits together. So keep your systems up to date and you will always have the latest and greatest that Flynn has to offer.<\/p>\n","protected":false},"featured_media":27347,"comment_status":"open","ping_status":"closed","template":"","community-category":[113,116],"class_list":["post-24534","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-integrations","community-category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/24534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=24534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/27347"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=24534"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=24534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}