Más contenido relacionado La actualidad más candente (20) Similar a EWD 3 Training Course Part 4: Installing & Configuring QEWD (20) EWD 3 Training Course Part 4: Installing & Configuring QEWD1. Copyright © 2016 M/Gateway Developments Ltd
EWD 3 Training Course
Part 4
Installing & Configuring
QEWD
Rob Tweed
Director, M/Gateway Developments Ltd
Twitter: @rtweed
2. Copyright © 2016 M/Gateway Developments Ltd
QEWD
• Complete EWD 3 run-time back-end
environment for applications:
– Interactive browser-based applications
– Interactive React Native mobile applications
– HTTP Web Services
– REST services
• Built using EWD 3 modules
• Extensible
3. Copyright © 2016 M/Gateway Developments Ltd
Pre-packaged EWD 3 Platform
• Ideal if you want to build and run applications:
– Interactive browser-based desktop apps
– Mobile apps using React Native
– REST and Web Service back-ends
• with a Node.js back-end
• Particularly if you want to use Caché, Redis or
GT.M
• All the necessary EWD 3 modules have been
integrated for you
– Very simple installation & configuration
4. Copyright © 2016 M/Gateway Developments Ltd
Getting Started on Windows with Caché
• Pre-requisites
– Windows 7 or later
– Decent modern browser
• Chrome recommended
– Decent text editor
• eg Notepad++
– Caché installed and running
5. Copyright © 2016 M/Gateway Developments Ltd
Step 1
• Install Node.js
– Go to https://nodejs.org
– Download latest version of Node.js
• LTS version recommended
• Currently 6.9.x
– Invoke the downloaded msi installer file
– Check using Command Prompt windows
• node –v
– Should report v6.9.3
6. Copyright © 2016 M/Gateway Developments Ltd
Step 2
• Create a directory for all QEWD work:
– eg C:qewd
7. Copyright © 2016 M/Gateway Developments Ltd
Step 3
• Install QEWD and qewd-monitor:
cd qewd
npm install qewd qewd-monitor
Ignore any warnings
On completion you should find a new directory:
C:qewdnode_modules
8. Copyright © 2016 M/Gateway Developments Ltd
Step 4
• Get and install the latest cache.node for
Node.js 6.x:
– Move/copy from Downloads directory to:
• C:qewdnode_modules
– Rename to cache.node
https://s3-eu-west-1.amazonaws.com/cache.node/build-124/win64/cache610.node
9. Copyright © 2016 M/Gateway Developments Ltd
Step 5 (a)
• Set up and configure QEWD
– Copy:
• C:qewdnode_modulesqewdexampleewd-xpress.js
– To:
• C:qewdqewd.js
10. Copyright © 2016 M/Gateway Developments Ltd
Step 5 (b)
• Edit C:qewdqewd.js
– eg using Notepad++
– Specify your Caché mgr path within the config
object, eg: var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New QEWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr'
}
}
};
11. Copyright © 2016 M/Gateway Developments Ltd
Step 5 (b)
• Edit C:qewdqewd.js
– eg using Notepad++
– Specify your Caché mgr path within the config
object, eg:
Note the double
back-slashes
Note the comma!
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New QEWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr'
}
}
};
12. Copyright © 2016 M/Gateway Developments Ltd
Step 6
• Set up qewd-monitor
– Create new directories:
• C:qewdwww
• C:qewdwwwqewd-monitor
– Copy all the files in:
• c:qewdnode_modulesqewd-monitorwww
– To:
• c:qewdwwwqewd-monitor
13. Copyright © 2016 M/Gateway Developments Ltd
Step 7
• Start up QEWD:
– In a Command Prompt window:
cd qewd
node qewd
C:ewd3>node qewd
webServerRootPath = C:qewd/www/
Worker Bootstrap Module file written to node_modules/ewd-qoper8-worker.js
========================================================
ewd-qoper8 is up and running. Max worker pool size: 1
14. Copyright © 2016 M/Gateway Developments Ltd
Step 8
• In your browser, enter the URL:
– http://127.0.0.1:8080/qewd-monitor/index.html
– When prompted for the management password, enter:
• keepThisSecret!
• QEWD and qewd-monitor should now be fully working!
15. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup file
• C:qewdqewd.js
– Can be renamed if you wish
• Define a config object
• Invoke the QEWD start() function
– Passing in the config object as an argument
16. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New QEWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
17. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New EWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
var qewd = require('qewd').master;
qewd.start(config);
18. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New QEWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
The management password that
You enter when you start up
qewd-monitor application
19. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'My EWD App Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
Used in qewd-monitor
to display the name of this
instance of QEWD
Useful if you have more
than one instance running
20. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'My EWD App Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
Port on which Express
listens for incoming
requests
21. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'My EWD App Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
Maximum number
of worker processes
to be started by
QEWD to handle
demand
22. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New EWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
What database
do you want to
connect to your
worker processes?
- cache
- gtm
23. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New EWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}};
If Caché, where is
its mgr directory
located?
24. Copyright © 2016 M/Gateway Developments Ltd
QEWD startup config object
var config = {
managementPassword: 'keepThisSecret!',
serverName: 'New EWD Server',
port: 8080,
poolSize: 1,
database: {
type: 'cache',
params: {
path: 'c:InterSystemsCache2015-2mgr’
}
}}; Other Caché database params available:
- username (_SYSTEM)
- password (SYS)
- namespace (USER)
Only need to be specified if different
values from defaults required
25. Copyright © 2016 M/Gateway Developments Ltd
QEWD is ready
• You can now try developing your own
applications
• Can use any JavaScript framework
– Including your own manually created
JavaScript code
26. Copyright © 2016 M/Gateway Developments Ltd
Installing QEWD on Linux
• The QEWD repository includes an installer
folder
– Contains a set of pre-written installer scripts
– Designed for use with Ubuntu 16.04
• "virgin" system without:
– Node.js or a database (GT.M, Cache or Redis)
• Easily adapted for use with other Linux versions
• Can be used as a starting point for "non-virgin"
systems
27. Copyright © 2016 M/Gateway Developments Ltd
Using the Installers
• Pre-requisites / assumptions:
– Freshly-installed Ubuntu 16.04 system:
• Physical server
• Virtual Machine
• Cloud image (EC2, Digital Ocean, etc)
– SSH access
– Port 8080 externally accessible
28. Copyright © 2016 M/Gateway Developments Ltd
Linux Installers:
• QEWD + NVM + Node.js
• Choice of database:
– GT.M (Free, Open Source)
– GlobalsDB (Free, Proprietary, Deprecated)
– Cache (Proprietary/Commercial):
• Use installer file as a guide only
• You must have a valid Cache license
29. Copyright © 2016 M/Gateway Developments Ltd
Using the Installers
• See instructions at:
– https://github.com/robtweed/qewd/tree/master/installers
30. Copyright © 2016 M/Gateway Developments Ltd
Installing QEWD on RPi
• QEWD can also be installed and run on a
Raspberry Pi
– Using Redis (ewd-redis-globals)
• A pre-built installer can be found in the
/installers folder
• See instructions at:
– https://github.com/robtweed/qewd/tree/master/installers
31. Copyright © 2016 M/Gateway Developments Ltd
Docker versions of QEWD
• Pre-built containers in Docker.io:
– rtweed/qewd:
• QEWD for Intel x64 machines
– rtweed/rpi-qewd
• QEWD for Raspberry Pi
• See the separate slide deck on using the
Docker versions of QEWD for more
information