nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.31k stars 5.32k forks source link

Running nopCommerce in Web Farm Does Not Update installedPlugins.json Properly #3451

Closed toddca closed 5 years ago

toddca commented 5 years ago

nopCommerce version: 4.1

Steps to reproduce the problem:

  1. Install nopCommerce on two web servers and configure to point to the same DB.
  2. Install a plugin - the installedPlugins.json will be updated to include the name of this plugin on the server for which you are connected.

Note: the second web server still has the original installedPlugins.json with the original list of installed plug-ins prior to step #2.

Looking for a workaround/solution as well as any other issues running nopCommerce in a web farm.

RomanovM commented 5 years ago

Related task: https://github.com/nopSolutions/nopCommerce/issues/2494

cvalerio commented 5 years ago

If hosting environment is Windows, there are several workarounds to this:

  1. Install plugin in each server manually: if small farm (2-3 servers) and/or you want to verify plugin is functioning before reattaching server to the farm, this is my preferred way; this also doesn't need any particular setup at server level;
  2. Use DFS Replication to sync folders between server: useful in large farms, needs some setup and wise exclusions, but it should work (applications would still need manual restart in order to load new plugins, though...)
  3. Use Jenkins or similar tools to deploy plugins and automatically restart applications: REALLY large farms, really complicated, but I think viable solution...

HTH

toddca commented 5 years ago

I would not use DFSR, updating one web app will start replication to occur and depending on the file/location being replicated the web apps on the other servers will be restarted constantly and impact your entire server farm. You are better off taking each machine out of the LB, updating it, and then putting it back into service.

As far as updating the installedPlugins.json - we usually do not install/uninstall plugins all that much in production, but when we do we do so on one machine, replicate the installedPlugins.json to the others and restart each web app. Have not had an issue to this point but that may depend on the plugins you use.

skoshelev commented 5 years ago

Closed #3451

toddca commented 5 years ago

@skoshelev - when storing in redis why do you give this key/value its own DB and why do you hardcode the DB Id?

Also - why can't this just be stored in the SQL DB?

skoshelev commented 5 years ago

@toddca We cannot use the database to store these values, because the database may not be exists when caching should already work

toddca commented 5 years ago

When do you cache installed plugins when the Db does not exist? In fact, when do you even install plugins when the Db does not exist ???

-Todd


From: Sergey Koshelev notifications@github.com Sent: Monday, May 13, 2019 3:19:01 AM To: nopSolutions/nopCommerce Cc: Todd Carter; Mention Subject: Re: [nopSolutions/nopCommerce] Running nopCommerce in Web Farm Does Not Update installedPlugins.json Properly (#3451)

@toddcahttps://github.com/toddca We cannot use the database to store these values, because the database may not be exists when caching should already work

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/nopSolutions/nopCommerce/issues/3451#issuecomment-491722894, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAJVJJRYMAZI5RPNBTN6QU3PVEP7LANCNFSM4GIDTU4A.

skoshelev commented 5 years ago

Hi @toddca. I do not understand why you ask about plugins? The point is that caching may starts working even before database initialization, which means we can't save caching settings in it. As far as installation of plugins is concerned, they are installed after creating the main database structure.

toddca commented 5 years ago

Yes so why cant we cache the contents of installedPlugins.json in the DB?

-Todd


From: Sergey Koshelev notifications@github.com Sent: Tuesday, May 14, 2019 3:05:32 AM To: nopSolutions/nopCommerce Cc: Todd Carter; Mention Subject: Re: [nopSolutions/nopCommerce] Running nopCommerce in Web Farm Does Not Update installedPlugins.json Properly (#3451)

Hi @toddcahttps://github.com/toddca. I do not understand why you ask about plugins? The point is that caching may starts working even before database initialization, which means we can't save caching settings in it. As far as installation of plugins is concerned, they are installed after creating the main database structure.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/nopSolutions/nopCommerce/issues/3451?email_source=notifications&email_token=AAJVJJQLSIIDRLLGMJG4J6DPVJXEZA5CNFSM4GIDTU4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVKTRHY#issuecomment-492124319, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAJVJJQGN5ZX2XNCREYC25TPVJXEZANCNFSM4GIDTU4A.

ianpowell2017 commented 4 years ago

@toddca, did you find out how to solve this? I am trying to install nopCommerce in a web farm scenario. I am trying to figure out the steps to load balance this in AWS