I have a starter (free) tier account with Openshift online. I have an application consisting of two pods, a Node and a Mongo. The pods build and deploy; from the terminal that executes in the web console on the running Node pod I can run curl localhost:8080 and the Node process obligingly spits back my base page.
I have a route that was autogenerated; the web console gives me a link to <myappname>.stuff.starter-east-1.openshiftapps.com and appears to correctly reference the Node service that sits on top of the running Node pod.
However, when I point my browser at that hostname, I get the Openshift error page that tells me that either the route or path was not typed correctly, or the pod isn't running.
I have tried this with my own code and with the example node packages and I see the same thing.
When I use the oc tool to query things about my application, I see that I don't have a router resource - but the route claims to have been exposed on a router. So I think I'm using some kind of default router in the node, and I don't have to launch one in my project, but I'm not sure. Most of the other questions around this topic are for people using the Enterprise product and running on their own hardware, where they have more control at the admin layer over the router package; all the suggestions seem to imply that for the Online product this 'just works'. Any ideas what I am missing?
Update : After some period of time, the example project did work and a browser request was serviced with the basic example page. Looking at the two setups I cannot see any differences, or why my route (in my custome app) never gets activated but the sample project route does.
Turns out the issue was that my application (node) was listening to localhost:8080, when it needs to be listening to 0.0.0.0:8080. I'm not enough of a networking guy to explain why that matters to the router but it does.
Related
Finally i completed my first full project using server, client, data
i would like to know few things about how to host and upload full website include(server ,react, mysql)
i so wondering how that is work, for now i understand that to upload a simple website you need a domain and to hosting, just do npm run build and upload it..., this is something that i know but, when that is not just a simple website like
when i have such as
server side with Node.js + express that have requests (on localhost) *probably need to change the localhost to something else but what
Database running with MySql
React app that have many request to (localhost)
how can i hosting all of them and running my website for everyone, i mean that my sql will still running, CRUD Data will update normal, and the server will still get request and send or update them to mysql data.
and if I'll want to make some change on mysql, server, client
i want to change it like i change it now
Actually i'm not a FullStack developer if i don’t know it... 🥶 so i really interesting to understand all of that issues
i hope you guys havק An understandable answer for me, thanks 🙏 and just take your time :)
Well, where to start hehe. There are a lot of different ways to host a web app. Heroku for example makes this process really simple.
Personally, I use Digital Ocean to host my apps. This is generally how that goes:
I have a project with a folder structure that seperates the server logic and the client logic.
Since you're using Node, you build your client with npm run build. Next make sure the dist/build folder is inside your server folder. That is the folder you are going to 'host'. On Digital Ocean, you make a new droplet (which basically is just a tiny part of a server).
You install Node, Git, Pm2 and (for example) Nginx. You clone your project from Github to the server and install all the dependencies.
You have to do a few configurations with nginx (specifying a domain name for example) to make everything work. This article goes into more detail about that.
Also, a database is frequently hosted seperately. You should read more about that.
If you have everything setup, you can just code on your project as usual. Push new updates to github, and pull in the changes on the server.
Here is another post on Stackoverflow talking about hosting MySql with react.
I have an application deployed on Openshift Online v3 starter plan which (used to) run well until yesterday. Yesterday I had to publish a new version of my application. Apparently, the platform encountered some problems redeploying it, I had to cancel some processes which seemed locked or continually restarting.
Finally I managed to have my pod running with the new version, the logs look fine.
The issue now is that my app is no longer exposed. When hitting the URL which was assigned to me, I got the infamous "not available" OO page:
Application is not available
The application is currently not serving requests at this endpoint. It may not have been started or is still starting.
Possible reasons you are seeing this page:
The host doesn't exist. Make sure the hostname was typed correctly and that a route matching this hostname exists.
The host exists, but doesn't have a matching path. Check if the URL path was typed correctly and that the route was created using the desired path.
Route and path matches, but all pods are down. Make sure that the resources exposed by this route (pods, services, deployment configs, etc) have at least one pod running.
I checked these 3 suggestions, and got sure that my host existed, that the path was correct, and that my pods where up. So, not understanding what the real issue was, I dropped the existing route and created a new one.
It's been 2 hours now, and the route UI keeps displaying this message:
The route is not accepting traffic yet because it has not been admitted by a router.
My understanding is that the router which should admit my route is not part of my project, it is managed by Openshift Online, am I right ?
So what could I do now to unlock my new route ?
Thanks for your suggestions
There it is ! My application is reachable again at last : It took 2 days for the router to setup my route. No action required from my part.
But the starter platform is still experiencing difficulties, so I will avoid any redeployment until the status turns green again.
this is maybe a common question with many answers on internet but i can not make it work, so please help to give some hints
i setup the Ethereum private blockchain with the steps at https://github.com/ethereum/go-ethereum/wiki/Connecting-to-the-network
the first node has been started with basic parameter like :
geth --datadir "firstNode" --identity "firstNode" --networkid 65535000 --rpc --nat "any" --rpccorsdomain "*" console
the second pc in local network has been started with bootNodes of the 1st node enode address
even in the same network, these PC did not see each others with admin.peers cli,
instead, i see other enode of outside internet
when i try to connect my 3rd PC ( my laptop) from internet to my private block chain that is same networkid (say 65535000)
i supposed that i just need one 24/7 running node as bootnode so that other PC can start with that bootnode the the peers will automatically find out themselves as many document said. but in really i can not form up a private chain for testing, i tried many solutions but the issue still there, what i'm mining now is others blocks from internet , not my blocks
is there any option i'm missing ?
checked:
- my internet router open the uPNP by default
- the two pc need to addPeer(enode address) manually to see each others, without manual peering, they could not find themselves even they are boot up with the bootnodes from geth cli at startup
- from outside, i'm trying to peer with my local private chain by connecting to the 1st node with the public IP (check on router) on enode address, but doesn't help
I'm so confusing now and dont know what exactly to look up
Thanks for your help
Which tool are you using to build this application?
I personally faced this issue on IBM Bluemix , was not able to discover peers via internet but in bluemix I found this solution
On the Blockchain dashboard under the Network tab there will be action buttons on the right side of the panel for each validating peer. If the peer is stopped one of the actions will be start. Select that button. If you are using Hyperfabric then you should consider similar settings.
I've been trying to use Openshift Online v3 to host a web app. It works fine with the red hat-provided domain, but I can't get the routing working to get it to work on any other domain. all I get is:
Application is not available
The application is currently not serving requests at this endpoint. It may not have been started or is still starting.
Possible reasons you are seeing this page:
The host doesn't exist. Make sure the hostname was typed correctly and that a route matching this hostname exists.
The host exists, but doesn't have a matching path. Check if the URL path was typed correctly and that the route was created using the desired path.
Route and path matches, but all pods are down. Make sure that the resources exposed by this route (pods, services, deployment configs, etc) have at least one pod running.
Does anybody know how to do a custom domain in Openshift v3?
Step 1: Create two routes in openshift v3 console. One provided default by the openshift (*.openshiftapps.com) and create another route with the host name as your domain name.
Step 2: Go to domain registrar and add a CNAME record for your domain which points to *.openshiftapps.com domain
Wait for the CNAME addition to take effect and access your domain name from the browser, now it should get the page loaded properly.
As was the case with OpenShift Online Developer Preview, the GA free OpenShift Online starter tier does not support custom domains. Custom domains will only be available when the full paid tier is available. The only option in the interim is to use a proxy in front. One option is to use Cloudflare as that proxy.
Take a look at these docs.
$ oc create route edge --service=frontend \
--cert=${MASTER_CONFIG_DIR}/ca.crt \
--key=${MASTER_CONFIG_DIR}/ca.key \
--ca-cert=${MASTER_CONFIG_DIR}/ca.crt \
--hostname=www.example.com
For starter (free) plan, you may try hidden redirected URL. Some DNS providers provide such service.
How can I put a custom host name for the new project created in the OpenShift (Next Gen) Developer Preview?
It was pretty straight forward for the previous version where I have to add an alias and add the required CNAME entry in DNS. For this version, I tried both CNAME and A. First I add a CNAME to the default address provided by the platform; then I tried adding A record for the address to the Cluster IP shown in the service. Both methods failed to solve it unfortunately!
I can see a router object in the site but not sure what to do!
Anyone any idea?
At this point in time, the developer preview does not permit you to add a custom hostname through the platform itself. OpenShift does support the concept, but it is disabled for now.
The only way to can achieve the same result at the moment is to run your site behind a CDN such as CloudFlare, or your own separate proxy outside of OpenShift, with those terminating the request for your custom host name and then forwarding it.
That said, how it would usually be done if enabled is by creating a new route with the specified hostname.
oc expose service myapp --name myapp-public --hostname www.example.com