neha-ecsion / Thinaer-QueryManager

0 stars 0 forks source link

Deploye QueryManger Mysql DB Code on Ubuntu Server #4

Open neha-ecsion opened 5 years ago

neha-ecsion commented 5 years ago

1.Deployed the code on Ubuntu Server but Url not getting IP address. 2.Add Nginx Engine for this but not worked.

neha-ecsion commented 5 years ago

09-09-2019

1.Add a IP address on Cors Policy in Startup.cs for run the code on IP address. 2.Change Query for details log for not get param as @.

Issues: 1.TimeZone Issue in Ubuntu. 2.Mysql Query issues for not getting the params. pass it like '" + connectionStatus + "' 3.Request Response save the data and getting the output. 4.Heartbeat issue not updating.

neha-ecsion commented 5 years ago

10-09-2019

1.not getting the first record in QueryManagerdb.cs Remove the reader.read() from code. 2.changes all the table name from queries in queryhub and querymanager db because all names get changed in migration. 3.check with localhost work fine but on on ubuntu server

4.Response not saving in table and page get in process mode.

Commit: https://bitbucket.org/ecsion/querymanager-ecsion/commits/e8cade1b15b166ca65bfcd7eb6eb98ef9b134a64

neha-ecsion commented 5 years ago

11-09-2019

  1. Code not getting the proper output for Request and Response because of commands that contain the special characters. So added the Html encode and decode functionality to save that with Encode command and Disply the page with Decode that command.
  2. Special characters not saved in mysql database table gatewayRequestResponse:

I. When we request a command to gateway that contain the special characters ex: Backslash(\) which get saves with Double Backslashes in mysql table which gives an error when we deserialize with json.

For that we add HTML Encode and Decode functionality. When we request a command to gateway → that command saves in our mysql db. First we Encode the command using Html Encode function ex: objGatewayModel.commandResponse = System.Net.WebUtility.HtmlEncode(JsonConvert.SerializeObject(string));

   b.When we display the list of Request and Response List on page we have to Decode that command and then display in list using Html Decode function.

    ex:
   <div>@Html.Raw(System.Net.WebUtility.HtmlDecode(string))</div>

Commit: https://bitbucket.org/ecsion/querymanager-ecsion/commits/f7a83beec957466bdcebb93df08389c8e5337630

neha-ecsion commented 5 years ago

12-09-2019

1.Create a documentation for chages required for deployment Windows to Ubuntu Server and add issues that I have faced during deployment.

https://docs.google.com/document/d/1KYL1QRTQO7Ls5k67Bcelvu-Ckw7a8Y4wNQFqIsvI0rQ/edit?usp=sharing

2.Code changes that have we did in Saurabh code to deploy that added to our for commit the code on bitbucket.

3.Test and debug all the functionality for QueryManager. and do changes that are required.

Commit: https://bitbucket.org/thinaer/querymanager-dot-net/src/feature-query-manager-with-mysql/

Google Sheet link for deployment: https://docs.google.com/document/d/1tx_Hvlwo3YyTSTObMnhqycYStWVvoNHKgP30GEUC0p4/edit?usp=sharing

neha-ecsion commented 5 years ago

13-09-2019

  1. Worked On Deploy code Queryamanager with Nginx.

  2. Add code in Program.cs for Kestral work ex: .UseKestrel()

  3. Deploy a sample code for test Nginx to my local VM machine on ubuntu . http://www.projectcodify.com/hosting-aspnet-core-on-linux-using-nginx

  4. Add Service log files to working flow (change the Path of service log) now getting service log properly.

commit: https://bitbucket.org/thinaer/querymanager-dot-net/commits/b1ca3441dc5dba173e792582eade02a228fd0ac9

neha-ecsion commented 5 years ago

17-09-2019

  1. MySql.Data.MySqlClient.MySqlException: 'Unable to connect to any of the specified MySQL hosts.' [Issue in Local connection with Remote Mysql server: MySql.Data.MySqlClient.MySqlException: 'Authentication to host '127.0.0.1' for user 'querymanager' using method 'sha256_password' failed with message: Access denied for user 'querymanager'@'localhost' (using password: YES)']

Change the 127.0.0.1 to localhost into Connection String in appsettings.json and Startup.cs.

  1. Reconnect Issue: Server get onclose() event after connection from server side.(Gateway Continue fire Onclose() event.) https://stackoverflow.com/questions/51184541/net-core-signalr-server-timeoute-reconnect-issue → Sync Async Issue.(On Gateway code(Saurabh))

8.On server get System.IO.IOException: The configured user limit (1024) on the number of inotify instances has been reached.

→ Fix it by close the server and reopen Or → call following command to maximize the limit

Just for reference for others. You can get your current inotify file watch limit by executing: $ cat /proc/sys/fs/inotify/max_user_watches You can set a temporary new limit with: $ sudo sysctl -w fs.inotify.max_user_watches=16384 If you like to make your limit permanent use: $ echo fs.inotify.max_user_watches=16384 | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p

  1. Update query in Sendmessage() sometimes does not update the gateway_id (on reload condition and Reconnect)

→ Now Gateway Code pass the gateway_id parameter in ConnectGateway() and with socket_id ,gateway_id also Inserted in gatewayLists.

Commit: https://bitbucket.org/thinaer/querymanager-dot-net/src/feature-query-manager-with-mysql/

Google docs: https://docs.google.com/document/d/1KYL1QRTQO7Ls5k67Bcelvu-Ckw7a8Y4wNQFqIsvI0rQ/edit

google Sheet: https://docs.google.com/spreadsheets/d/1hLUrF-_8hQnLHs9C-hn6BAcLncX4IkF8dn54m7FQyA0/edit#gid=0

neha-ecsion commented 5 years ago

19-09-2019

  1. Fix issue on QueryManager.
  2. Upsert query changes to 2 queries because of id skip 2 ids.
  3. create document for encode and decode for querymanager.
  4. fix the query for issue display request response list

https://docs.google.com/document/d/1cYciWT9r15MXzJsRcXumsw_Jr6VSpvqdxRvXAZUATlg/edit?usp=sharing

commit: https://bitbucket.org/thinaer/querymanager-dot-net/commits/29a90df572d3be664d2c014923ee60bb1bc281ed

neha-ecsion commented 5 years ago

20-09-2019

  1. Test the QueryManager
  2. Check for Upsert query . I get 1 more upsert query in gatewayData table but working fine check with data inserting from local and check database also 3.Creating a document for deployment from windows to ubuntu server

Google doc: https://docs.google.com/document/d/1ZNVWt62nPK4x_2Zk-RehcuOmJTlE5XVl1wYoS-_FHkc/edit?usp=sharing