Tools
Version Matrix
SevOne Data Insight Version | sevone-cli | sevone-guii | signature-tools |
---|---|---|---|
3.13.x | 2.1.x | 2.4.x | 1.1.0 |
3.14.x | 2.2.x | 2.5.x | 1.2.0 |
6.5.x | 2.3.x | 2.6.x | <latest version> For example, 2.0.1 |
6.6.x | 2.4.x | 2.7.x | <latest version> For example, 2.0.1 |
6.7.x | 2.5.x | 2.8.x | <latest version> For example, 2.0.1 |
SevOne CLI
sevone-cli tool provides convenience commands around common tasks such as setting up the GUI Installer or managing the Kubernetes cluster. It also provides wrappers around ansible playbooks.
Pod Commands
The CLI tool wraps some of the more complex commands but in some cases, it might be useful to run commands directly against a pod.
$ sevone-cli exec <pod_name> -- <cmd>
Example: Allows you to log into the MySQL pod
$ sevone-cli exec mysql -- mysql -uroot -pdatainsight datainsight
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
MySQL Commands
Instead of logging into the MySQL pod and running a command there, the mysql subcommand lets you run queries directly from your terminal.
$ sevone-cli mysql '<query>'
Example
$ sevone-cli mysql 'select count(*) from tenants'
+----------+
| count(*) |
+----------+
| 1 |
+----------+
Ansible Playbooks
Any playbook found under /opt/SevOne/upgrade/ansible/playbooks can be executed by simply providing its name, without a file extension.
$ sevone-cli playbook <name> [--extra-args]
Example: Run the up.yaml playbook, passing in args to the underlying ansible-playbook command
$ sevone-cli playbook up --tags apps
GUI Installer
Change Ports
- Copy /etc/sevone-guii/client.yaml to /etc/sevone-guii/client.custom.yaml and
/etc/sevone-guii/api.yaml to
/etc/sevone-guii/api.custom.yaml.
$ cp /etc/sevone-guii/client.yaml /etc/sevone-guii/client.custom.yaml $ cp /etc/sevone-guii/api.yaml /etc/sevone-guii/api.custom.yaml
- The following table lists the default port numbers and its respective config file location for
the client and API.
Name Default Port Config File Location Client 3000 /etc/sevone-guii/client.custom.yaml API 3001 /etc/sevone-guii/api.custom.yaml - If you need to change the port number, using a text editor of your choice, edit the .yaml
file to change the setting and save the file.
Example: Change port number for Client
$ vi /etc/sevone-guii/client.custom.yaml main: port: 3000 # <-- change port number
Example: Change port number for API
$ vi /etc/sevone-guii/api.custom.yaml main: port: 3001 # <-- change port number
- Restart the client and API services.Important: In case of any configuration changes, you need to restart both client and API services.
$ sudo systemctl restart sevone-guii-@api $ sudo systemctl restart sevone-guii-@client
Retry Failed Stages
There are certain stages that cannot be retried when failed. This behavior can be bypassed by modifying that particular stage's retry field in /etc/sevone-guii/api.yaml file.
- Using a text editor of your choice, edit /etc/sevone-guii/api.yaml
file.
$ vi /etc/sevone-guii/api.yaml
- For this example, assume that the Upgrade stage has failed. You will need to modify the
retry field i.e., toggle it to true, for label: Upgrade in
/etc/sevone-guii/api.yaml
file.
- id: up.yaml label: Upgrade type: playbook order: 3 retry: true # <--- toggle this on
- Save /etc/sevone-guii/api.yaml file.
- Using a text editor of your choice, edit /SevOne.info file. Revert your SevOne Data
Insight major / minor version to a prior / lower
version.
$ vi /SevOne.info
- Refresh the web browser page. The stage's retry button should now be enabled.
Manage Services
The graphical user interface installer services can be started / stopped using the standard systemd commands.
$ sudo systemctl status sevone-guii-@api
$ sudo systemctl status sevone-guii-@client
$ sudo systemctl start sevone-guii-@api
$ sudo systemctl start sevone-guii-@client
$ sudo systemctl stop sevone-guii-@api
$ sudo systemctl stop sevone-guii-@client
View Logs
The logs can be viewed using journalctl.
$ journalctl -u sevone-guii-@api [-f]
$ journalctl -u sevone-guii-@client [-f]
Clear ARA Status
When running incremental upgrades, ARA (Ansible Run Analysis) status from the previous upgrade must be cleared. Execute the following command to clear the ARA status.
$ rm /etc/sevone-guii/ara/server/ansible.sqlite
$ sudo systemctl restart ara-server
Skip Stage(s)
While using the GUI Installer, you may skip certain stages by deleting its corresponding playbook. For example, if you want to skip the SOA Upgrade stage, you may execute the following command.
Example
$ rm -rf /opt/SevOne/upgrade/ansible/playbooks/soa.yaml
After successfully executing the command above, refresh the page. You will see that the SOA Upgrade stage is no longer rendered.
Useful 'kubectl' Commands
- When provisioning of control plane node is complete via user interface, ensure that
control plane node is correctly provisioned from CLI.
Example
$ ssh sevone@<SevOne Data Insight 'control plane' node IP address or hostname> $ kubectl get nodes NAME STATUS ROLES AGE VERSION sdi-node01 Ready control-plane,master 52d v1.28.2+k3s1
- When the agent nodes have joined the Kubernetes cluster, execute the following command to
confirm the same.
Example
$ ssh sevone@<SevOne Data Insight 'control plane' node IP address or hostname> $ kubectl get nodes NAME STATUS ROLES AGE VERSION sdi-node01 Ready control-plane,master 52d v1.28.2+k3s1 sdi-node02 Ready <none> 2m25s v1.28.2+k3s1 sdi-node03 Ready <none> 2m45s v1.28.2+k3s1
- To check the status of the deployment, ensure that all the pods are in Running status.
Example
$ kubectl get pods NAME READY STATUS RESTARTS AGE di-create-secrets-xllfj 0/1 Completed 0 22h di-upgrade-l2cs8 0/1 Completed 0 22h clienttest-success-89lmt 0/1 Completed 0 22h clienttest-fail-lb8mq 0/1 Completed 0 22h di-report-version-sweeper-28276440-zpcxt 0/1 Completed 0 20h ingress-ingress-nginx-controller-54dfdbc9cf-g9wdz 1/1 Running 0 22h di-prometheus-node-exporter-shnxk 1/1 Running 0 22h di-graphql-7d88c8c7b5-fbwgc 1/1 Running 0 22h di-ui-5b8fbcfc54-rtwlq 1/1 Running 0 22h di-kube-state-metrics-6f4fbc67cb-tsbbk 1/1 Running 0 22h di-migrator-fdb9dd58b-29kl2 2/2 Running 0 22h ingress-ingress-nginx-defaultbackend-69f644c9dc-7jvvs 1/1 Running 0 22h di-printer-7888679b59-cqp9q 2/2 Running 0 22h di-scheduler-7845d64d57-bdsm2 1/1 Running 0 22h di-registry-68c7bbc47b-45l5v 1/1 Running 0 22h di-djinn-api-5b4bbb446b-prsjd 1/1 Running 1 (22h ago) 22h di-mysql-0 2/2 Running 0 22h di-prometheus-server-7dc67cb6b5-bjzn5 2/2 Running 0 22h di-redis-master-0 2/2 Running 0 22h di-wdkserver-6db95bb9c9-5w2kt 2/2 Running 0 22h di-assetserver-5c4769bd8-6f2hw 1/1 Running 0 22h di-prometheus-node-exporter-mp5xf 1/1 Running 0 22h di-report-tombstone-sweeper-28277040-kj227 1/1 Running 0 10h datasource-operator-controller-manager-5cf6f7f675-h5lng 2/2 Running 3 (5h37m ago) 22h di-asset-sweeper-28277645-tq6gb 0/1 Completed 0 12m di-user-sync-28277645-dl6ks 0/1 Completed 0 12m di-asset-sweeper-28277650-hxwvn 0/1 Completed 0 7m46s di-user-sync-28277650-6kxf7 0/1 Completed 0 7m46s di-asset-sweeper-28277655-gjtpr 0/1 Completed 0 2m46s di-user-sync-28277655-chgxd 0/1 Completed 0 2m46s
- The following command describes the SevOne NMS datasources and the configured peer's information
such as, NMS version, SOA version, Primary / Secondary / Virtual IP address, etc.
Example
$ ssh sevone@<SevOne Data Insight 'control plane' node IP address or hostname> $ kubectl describe nms Name: di-1 Namespace: default Labels: <none> Annotations: <none> API Version: datasource.sevone.com/v1alpha1 Kind: NetworkManagementSystem Metadata: Creation Timestamp: 2023-10-06T07:49:45Z Generation: 1 Resource Version: 3232 UID: e7b83abd-6cc7-4f8e-bb87-6fce7a01854d Spec: Encryption Key Secret: Key: keys.json Name: securitykeys Host: 10.129.27.10 Poll: 30s Port: 443 Secret: datasource-di-1 Timeout: 5s Status: API Version: 6.7.0 Ip: 127.0.0.1 Name: SevOne Appliance Primary Ip: 127.0.0.1 Service: datasource-di-1 Version: 6.7.0 Events: <none>
- The following command describes the current state of load
balancing.
$ ssh sevone@<SevOne Data Insight 'control plane' node IP address or hostname>
$ kubectl describe endpointslice $service
where, $service is the name of one of NMS's Status.Service returned from command kubectl describe nms above. For example, datasource-di-1.
Example
$ kubectl describe endpointslice datasource-di-1 Name: datasource-di-1 Namespace: default Labels: app=nms endpointslice.kubernetes.io/managed-by=NetworkManagementSystem kubernetes.io/service-name=datasource-di-1 nms_cr=datasource-di-1 Annotations: <none> AddressType: IPv4 Ports: Name Port Protocol ---- ---- -------- grpc 443 TCP Endpoints: - Addresses: 10.129.27.10 Conditions: Ready: true Hostname: di-1 NodeName: <unset> Zone: <unset> Events: <none>
Important: Conditions.Ready: true means that the NMS address(es) are eligible for load balancing.