What is a Nexus server?

A Nexus server is software that allows the user to store, access, and analyze objects created in EnSight (or other applications) with the aim to help the user collect, catalog, analyze data and easily create reports of cumulative information. These objects, called data items, can have a variety of types, from a (x,y) list of values to image files to 3D geometry (more details in the Report Generation Chapter, Items). The data items are collected into databases, which allows for easy storage and post-collection analysis. A Nexus server also provides a mechanism to select, process and display collections of items in customized report formats delivered via HTML.

Nexus servers can run locally on your desktop system or remotely on enterprise systems or in the cloud (Setting up a remote server instance is beyond the scope of this documentation although some discussion may be found here).   A Nexus server is most easily accessed via a web browser. It provides a REST API for EnSight or another external application to push data items into a Nexus database.  The instructions here focus on managing servers located on a user's local system.

Launching a local server

There are multiple ways to launch a Nexus local server, depending on whether you already have a database or not.

Option 1: Nexus Template Editor

From a command prompt / shell, type

nexus_template_editor

This will launch the Nexus Template Editor:


You can use this application to start a local Nexus server. Go into the Edit menu:


Two options appear. The first will allow you to create a new database, the second to launch the Nexus server.
If you need to create a new database, select the first option. A new window will pop up to ask where you want to create the database. Browse your directories and set where the empty database should be. The directory will be updated to include a 'media' directory, a 'manage.py' file, a 'view_report.nexdb' and a 'db.sqlite3' file.

After this step, or if you already have a database you want to connect the Nexus server to, select the Tools -> "Launch local Nexus server" option. A widget will appear:


If you answer Yes, the Nexus server will stay up even if you close the Nexus Template Editor application. After you make the selection here, you will be prompt to select the db.sqlite3 file in the database you want to connect to. Finally, set the port on which the Nexus server should run. The server is now up and running.

Option 2: EnSight

From EnSight, you can access Nexus through the Reports menu -> Connect to a report server:


 


A dialog on how to start/connect to a Nexus server will appear:



If you need to create a new database, select the first option. This will prompt You can use this dialog to launch a new Nexus server with a new database, to launch a Nexus server connected to an existing database, or to connect to an already running Nexus server.

If you already have a database, then select the second option: "Launch a report server using a previously created report database and connect to it". A widget will appear asking you to select the db.sqlite3 file from the database you want to use. Then, the server will be launched.


Option 3: From the database

This option can only be adopted if you already have a database and want to start the Nexus service on top of it. Navigate into the database directory, and double click on the "view_report.nexdb" file. This will automatically launch the Nexus server.




Once the server has been launched with any of the above mechanisms, the following dialog box will be displayed.



A server is now up and running on your local system (Note: a new console window may be opened to support the server).  If you click on the URL listed in the dialog box, a web browser window will be opened displaying the web interface to the server.  It will look something like this:



Any server launched locally will only be accessible on the machine it is launched on as the server will reject external access as a security measure. You will also need a username and password to be able to modify the database. No username or password are required to display items in the database directly or via reports.

The first option from the EnSight's menu ("Create a new report database, launch a report server and connect to it") will behave in the same way, with the addition that it will prompt for the directory where to create a new database before setting up the Nexus server. That is equivalent to using the "Nexus Template Editor" -> Tools -> "Create a new Nexus database" to first create an empty database and then "Nexus Template Editor" -> Tools -> "Launch local Nexus server" to start a Nexus server on top of that new database.



Launching a local Nexus server from EnSight or the Nexus template editor

Changing a Nexus server/database password

When a database is initially created, it will have the username 'nexus' and the password 'cei'.  This can be changed by options in the server itself. First, use the 'Log in' option at the top right of the Nexus server web pages.  Enter the current database username and password to log in. Once logged in, the Information menu will include a User administration option.



The administration pages will allow you to add more users, modify existing users, etc. This information is saved in the database and will be used by any Nexus server that is launched with the database listed in the Information->About page. Please note that operations performed on these pages control access to your Nexus server and the data it contains. ANSYS is not able to recover passwords you change on these pages so use them with caution.

Connecting to a running server

The template editor application will be connected to any servers it launches automatically and will allow you to create and edit report templates as well as copy data items between servers. If you are launching the application and the server you want to access is already running, the dialog box presented when the tool is launched will allow you to connect to an arbitrary server.  


If you are connecting to a local server, the 'Select Local Server...' button will fill out the dialog box after prompting you for the port number of the server.  Note: it assumes that the username is 'nexus' and the password is 'cei'.  You can also connect to a different server using the 'File->Disconnect from current Nexus server' and 'File->Connect to a Nexus server...' menu options.

Shutting down a server

Unless explicitly shut down, a Nexus server will continue to run in the background on most systems.  On Windows, closing the Nexus server console window will kill the server, but on other platforms the server may continue to run. Remember to manually shut servers you no longer need down. When you are done using the server, you can stop it via the 'Tools->Stop local Nexus server' menu. Note that this will shut down only the server you are currently connected to.