How to avoid Hyper ledger Composer Rest server restart while upgrading(with change in model files) composer network installed? - loopbackjs

We have a working setup of 3 peer nodes and a multi user rest server running on 1 of the peers. Now there are multiple user cards created and imported in the rest server(using web based client) which is working fine. I can trigger transactions and query the blockchain with it.
However In case I need to upgrade my network and there is some change in model file(i.e. any participant/asset/transaction parameters changes). I need to restart rest server so that effect can be observed by WEB based client application. So my questions are:
1. Is there a way to upgrade Rest interfaces without restarting the server.
2. In case Rest server crashed or restarted is there some way to use the old cards that were created before server shutdown.

When the REST server starts you can see that it "discovers" the Business Network and then generates the End Points. The discovery is not dynamic, so that when you change the model or other element of a BNA you need to restart the REST server to re-discover the updated network. (In a live scenario I would think changes to the model are infrequent.)
Are you using multi-user mode for the REST server? Assuming that you are, then Configuring the REST server with a persistent Data Source as described in the documentation, or this tutorial should solve the problem of re-importing the cards. You could also "backup" the cards after they have been used the first time by Exporting them.

Related

MMO Backend Architecture Questions and Review Request

I am making a simple MMO backend with Django as a personal/portfolio project.
(I am not actually making an mmo game)
You can find the project here
So I have some questions for the architecture because I designed it
1. Architecture
1.1 Terminology
AuthServer= Web Server responsible for the authentication
UniverseServer= Web Server responsible for the persistent storage of the game (Couldn't find a better naming)
MatchmakingServer= Web Server that acts as intermediary between the client and the GameServerManager
GameServerManager= A cluster manager responsible for starting/stoping GameServerInstances
GameServerInstance= An instance of the game server
PlayerClient= The game client of the player
1.2 Flow
1.2.1 Authentication
PlayerClient logins to AuthServer to obtain an AuthToken at /api/auth/login/
1.2.2 Retrieving Player Data
PlayerClient requests all the needed data from the UniverseServer at /api/universe/user/{...} (example: the characters list)
1.2.3 Connecting To A Game Server
PlayerClient requests an available game server from the MatchmakingServer with some parameters
The MatchmakingServer checks if there is an available GameServerInstance on the database with these parameters
If there is an available GameServerInstance, the MatchmakingServer responds to the PlayerClient with the IP and the Port of the GameServerInstance, else it is gonna send a request to the GameServerManagerto spawn one
When the MatchmakingServer would request the GameServerManager to spawn an instance it would pass a ServerAuthToken so that the GameServerInstance can make authorized requests to /api/universe/server/{...}/ to update any value (example: the experience of a character)
On the Django project I am implementing AuthServer, UniverseServer, MatchmakingServer as separate apps to stay as modular as possible.
First of all I would love from an experienced in this field to review the whole architecture.
And the questions:
Does this architecture makes sense? What could I change to improve (even for naming for a more standard namings/functionality/etc...)
What tools can be used as GameServerManager. Can kubernetes/agones do that? Does AWS or CloudOcean have anything for this?
I am making this project as a portfolio but does this architecture/stack have the capabilities to go to production for even an mmo with a low playerbase like ROTMG?
How could this be scaled? Separate the apps to different projects and host everything individually? Use load balancers? Use proxies?
Is this considered cloud architecture or cloud orchestration or something else?
Every advice is welcome
From the questions you can understand that I have minimal knowledge on this field so please be as detailed as possible (or/and provide resources to read more)
Thanks for your time :)

Sharepoint 2013 Server Farm has duplicate servers of same machine one having name of IP address and other as hostname

Recently our Sharepoint server 2013 database was upgraded from SQL server 2008 R2 to SQL server 2012 SP4. This has resulted in several issues.
There now two servers created in a single server farm one representing IP address and the other having host name. Both of the servers are having full set of services. Earlier it was only one server showing the host name
The search service is not running.
The Start and Stop of services on the server with IP address completes successfully, but on the server having the host name get stuck on starting or stopping stage.
Recreation of service applications like search service or user profile service also gets stuck and never complete
There are also two timer service instances, one for each machine, but starting or stopping any of them never gets completed and remains stuck.
What I want.
Only one server in the farm showing host name
All the services working i.e not getting stuck in starting stopping and service application like search and user profile working.
Server has just one application for port 80 and one for CA
This is a production server and each day 1500 to 2000 tasks are generated and similar number of workflows are run this means I cant risk outage.
Thanks in advance
Regards
Imran
Solved Search Service Issue
Stored the Search Service Application
$ssa=Get-SPEnterpriseSearchServiceapplication -Identity XXXXXXX
Stored Service instance
$si = $ssa.service.Instances
Noticed that the proxy for Search service application was also not created
created proxy
$proxy=New-SPEnterpriseSearchServiceApplicationProxy -SearchApplication $ssa
Set the admin component by
Set-SPEnterpriseSearchAdministrationComponent -SearchApplication $ssa -SearchServiceInstance $si
Noticed that Search Administration Web Service for Search Service Application was showing Stopped and Search Service Application was showing Error status, started by
$ssa.Provision()
Checked the status of both the Service Applications it was showing started
Checked the admin component by
$ssa.AdminComponent
It was showing server name
At least one of my problems was solved and my users are able to do searches. I still have to resolve other issues.

Django-celery on multiple computers

I got everything I wanted to do with django-celery working on my development machine. More specifically, the app accepts photo urls which are then turned into tasks that the same machine downloads.
Now what I want to do is put the django code on heroku and the celery tasks on a dedicated computer that will be kept in the office.
I don't know what the next step is though. How do I tell the django app to connect to the office computer? What is the process for setting up the office computer to accepts tasks from the django app? How do I give the local computer login credentials to the django app so that it can connect to the database to update the models?
Ideally, I am looking to put something like this in my setting.py file:
remote_worker = '123.2.4.23:1234'
and on the office computer
tasks = 'photos/tasks.py'
remote_app = 'herokuapp123.com/myapp'
username = 'me'
password = 'pw'
I know there are a lot of questions. Any help or pointers would be appreciated!
This largely depends on what AMQP backend you are using for celery. If you are using the default (RabbitMQ) you will need do one of the following:
Install RabbitMQ on heroku server, expose its port to your business IP through firewall and configure your office computer to connect to it
Install RabbitMQ locally on your business computer and configure celery on Heroku to connect to it
Install RabbitMQ on both sides and bridge them.
Alternatively you can integrate the heroku server in your own business network using a VPN solution and have them directly talk to each other (because after all you probably don't want to transmit AMQP packets bare over the interwebz).
Scenario 1 is probably the easiest to set up as Heroku already provides you the plugin infrastructure to do so. Scenario 2 is probably not what you want as you will have to punch a hole in your business firewall for that. Both scenarios 1 and 2 will have latency and reliability issues as routing AMQP traffic over the internet is not going to be expedient or reliable. You will have dropped messages and celery will keep retrying until it succeeds or reaches the max number of failures. However AMQP was designed to handle network issues, they just may inadvertently affect your performance if that is critical. But then again in that case you should reconsider putting the celery workers on a business desktop.
Scenario C is probably best in terms of reliability but also more difficult to set up. Choose based on your needs.

Accessing local devices in Point of Sale web application

I am building a web application, not hosted by the client but on the cloud somewhere, probably azure. It will need the ability to access some local devices such as a receipt printer or cash draw from where they run it. Via a browser this is obviously not possible.
I was thinking of creating a service that they can install locally on their PC that listens to a web service and when it gets a message can perform the tasks such as opening the cash draw.
Is this how people have done similar things in the past? Are there other methods? What technologies do you recommend as I plan on the local service being able to be run on either PC or Mac with minimum fuss. I was considering either Flex or Mono (the app was written in ASP.NET), any other suggestions?

Move to 2 Django physical servers (front and backend) from a single production server?

I currently have a growing Django production server that has all of the front end and backend services running on it. I could keep growing that server larger and larger, but instead I want to try and leave that main server as my backend server and create multiple front end servers that would run apache/nginx and remotely connect to the main production backend server.
I'm using slicehost now, so I don't think I can benefit from having the multiple servers run on an intranet. How do I do this?
The first step in scaling your server is usually to separate the database server. I'm assuming this is all you meant by "backend services", unless you give us any more details.
All this needs is a change to your settings file. Change DATABASE_HOST from localhost to the new IP of your database server.
If your site is heavy on static content, creating a separate media server could help. You may even look into a CDN.
The first step usually is to separate the server running actual Python code and the database server. Any background jobs that does processing would probably run on the database server. I assume that when you say front end server, you actually mean a server running Python code.
Now, as every request will have to do a number of database queries, latency between the webserver and the database server is very important. I don't know if Slicehost has some feature to allow you to create two virtual machines that are "close" in terms of network latency(a quick google search did not find anything). They seem like nice guys, so maybe you could ask them if they have such a service or could make an exception.
Anyway, when you do have two machines on Slicehost, you could check the latency between them by simply pinging between them. When you have the result you will probably know if this is at all feasible or not.
Further steps depends on your application. If it is media heavy, then maybe using a separate media server would make sense. Otherwise the normal step is to add more web servers.
--
As a side note, I personally think it makes more sense to invest in real dedicated servers with dedicated network equipment for this kind of setup. This of course depends on what budget you are on.
I would also suggest looking into Amazon EC2 where you can provision servers that are magically close to each other.