I usually use Production Server with DNS based multitenancy, now as I learning development and getting involved in contributions. I required a Development Server as well, instead of multiple Development & Production Servers.
I had tried Multi Bench Setup wiki and successfully setup another bench as well. But, I’m not sure is it correct or not. My bench hierarchy is something like: /home/frappe/frappe-bench/new-bench and I can apply bench commands in new-bench as well.
But, when I tried to enable DNS based multitenancy at new-bench like subdomain.domain.com, while page shows only “Sorry! We will be back soon.” Currently, I’m trying with Production Server, also wants to keep Development & other Production Server both in new-bench1 and new-bench2 respectively.
Something like:
frappe-bench - Production
|-------------new-bench1=development
|-------------new-bench2=production1
|-------------new-bench3=production2
nginx is properly configured symlink to /etc/nginx/conf.d/ as well as supervisor. But when restarted nginx and supervisor the site on second bench unaccessible. OS ubuntu 16.04. When I stop supervisor, do bench start command in second bench and restart supervisor, both bench accessible and running well …
Hello @revant_one !! Although, I agree. We should not maintain production & development together on the same machine. But, let’s change this query to a different mode.
Is this possible to achieve multiple only master branch of ERPNext, with multiple benches on the same instance? I came to know about Bench Manager App, so every bench should have this bench manager installed to easily maintain? Also, let’s say, by enabling multi-tenancy for each bench. How we manage?
Any tips for this kind of architecture? Oh, one more dumb question: Is there any difference between master branch & production server? Both are bit confusing for me. As I know, master branch is stable branch of ERPNext, which has only contains major releases like 8.9.0, 8.10.0, 8.11.0 or 9.0 etc. & production server which has master branch?? Am I correct?
Hi, I had tried to implement the same scenario as I asked earlier. What I did till, let me explain and help me out where I’m doing wrong.
So, I had installed ERPNext (production) and created one more bench into a frappe-bench directory by command bench init retail. Now, I came into the retail directory and enabled DNS based multitenancy bench config dns_multitenant on.
Now, I installed bench manager app, and also run bench setup nginx after installing app. Also, reloaded nginx as well. But, I can only see: Sorry! We will be back soon.
Uses Supervisor and Nginx
All production benches are running with dns based mulitenancy
Create links to multiple frappe-bench-*.conf files under /etc/nginx/conf.d/ and /etc/supervisor/conf.d/
refer Setup Production
Developer Setup
In this case bench does not start automatically and you’ve to start it with bench start or bench serve (to start multiple sites)
Master Branch
This is the released stable code
Develop Branch
All the development happens here, you can help test the features on this branch. Feature contributions are sent to develop branch.
checkout to any branch in any setup.
Production server of an organization should be on master branch.
Developer setup depends on what is being developed.
Custom frappe apps released on production server should be on the same branch as production server.
Oh, I see. Sorry for the silly mistake. @revant_one
Now, I’m stuck at unknown issue. Now, I can see both files:
/etc/supervisor/conf.d/frappe-bench-retail.conf
/etc/nginx/conf.d/frappe-bench-retail.conf
Now, still I’m redirecting to Sorry! We will be back soon. page. I should change something in /etc/nginx/conf.d/frappe-bench-retail.conf ?? or what next??
server {
listen 80;
server_name
retail-bench.domain.com
;
root /home/frappe/frappe-bench/retail/sites;
doesn’t applicable to me, because there is no file/dir named frappe_bench_dir.
If server port doesn’t changed from 8000, then change it manually in nginx.conf and supervisor.conf. When I looked at frappe-bench/retail/sites/common_site_config.json, there is actually “webserver_port”: 8000. Should I change this value to 8001 & so on. Even if enabled DNS based multitenancy bench config dns_multitenant on ??
For redis, change redis port, what should I put value for redis port and how will it go for further benches? Like we should go on 11001 or …???
My current frappe-bench/retail/sites/common_site_config.json file is as follows: (However, it is exactly same as frappe-bench/sites/common_site_config.json. Does it matter?)
change one of the file, and change all ports, e.g. 11000 to 11001, 12000 to 12001, 13000 to 13001, 9000 to 9001, 8000 to 8001
or use the command bench config --help to change these ports by command instead of manually.
after that run bench setup nginx and bench setup supervisor also restart/reload supervisor and nginx
Yeahhhhhhhh!!! Very happy to see login page this time. But… But, It’s again something I missing !!
Sorry @revant_one !! I tried to use bench config --help but, confused which command will auto-increment these values. So, I had changed them manually !! Everything worked fine, got login page instead of Sorry! We will be back soon.
But, Even while right login credentials, validations stucks at Verifying…!!
Oh, Yes !! I used almost all commands !! Oh shitttttt, I had forgotten bench setup socketio.
Everything becomes fine, I created 2-3 benches for the test. All are working fine. Thereafter, I installed bench manager app as well. Goes fine.
On the another day, I tried to access all the benches with dns, One of the branch websites said “Site Error Occurred” while on the same bench, bench manager is working fine. However, I had get that site back by restarting & hit and trail.
One of another bench, site i.e. not accessible to me. I had tried harder to get it back but unfortunately not succeed. Site redirecting page to, “Sorry! We will be back soon.” I had tried even changing ports by increasing values to 11000…8000 to 8006 & so on !! Also, tried even copying back to /etc/supervisor/conf.d/frappe-bench-*.conf and completed that complete process.
No Clue, what to do/debug !! Now, I’m into debugging learning mode, eagerly waiting to learn these chapters as well.
I think there is a mistake, use common sense in guide which spread out over internet. Main bench named “bench-repo” which we cloned first time. By using this bench-repo we init (create) another bench by default named “frappe-bench” if you wish to create TWO BENCH, first :
$ bench init frappe-bench
then create another bench
$ bench init frappe1-bench
and you can create hundred bench from one bench-repo, DO NOT create a bench inside the frappe-bench or frappe1-bench ( this is what named multi bench )