openstack compute service list --service nova-compute empty - openstack-nova

After the installation of nova-compute on compute node, it failed to start and this command from the controller node return an empty result
openstack compute service list --service nova-compute
And the nova-compute.log file contain these two messages:
018-11-19 12:06:05.446 986 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge
2018-11-19 12:30:13.784 1140 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge
openstack compute service list :
return three service components for the controller with a down state
+----+------------------+------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At
+----+------------------+------------+----------+---------+-------+----------------------------+
| 2 | nova-conductor | Controller | internal | enabled | down | 2018-11-17T17:32:48.000000 |
| 4 | nova-scheduler | Controller | internal | enabled | down | 2018-11-17T17:32:49.000000 |
| 5 | nova-consoleauth | Controller | internal | enabled | down | None
+----+------------------+------------+----------+---------+-------+----------------------------+
service nova-compute status :
Active
How can i resolve these problems ?

This is because you might have missed to create the databases for nova_cell0.
# mysql -u root -p
MariaDB [(none)]> CREATE DATABASE nova_cell0;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'#'localhost' \ IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'#'%' \ IDENTIFIED BY 'NOVA_DBPASS';
#su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
109e1d4b-536a-40d0-83c6-5f121b82b650
# su -s /bin/sh -c "nova-manage db sync" nova
# nova-manage cell_v2 list_cells
#su -s /bin/sh -c "nova-manage api_db sync" nova
make sure in /etc/nova/nova.conf in compute node you have added following configuration:
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:RABBIT_PASS#controller
Then restart compute services.
the try the command openstack compute service list.
this solution also holds good when openstack compute service list is empty or nova hypervisor list is empty.

Related

Connect with Liquibase (Docker) to a SSH tunneled database

I constructed an SSH tunnel to a MySQL database (I know that this can be done without a password, but this is not the question).
jfabianmeier#JFM-HP-2018:~$ sshpass -p mySuperPassword ssh -o StrictHostKeyChecking=no -M -S my-ctrl-socket -fNT -L 3306:mysql5:3306 myUserName#alfa3031.alfahosting-server.de
jfabianmeier#JFM-HP-2018:~$ ssh -S my-ctrl-socket -O check myUserName#alfa3031.alfahosting-server.de
Master running (pid=405)
Connecting to MySQL seems to work, at least without SSL (I don't know why, maybe the server only supports old protocols).
jfabianmeier#JFM-HP-2018:~$ mysql -h 127.0.0.1 -P 3306 -u web1444 -pmyDBPassword --ssl-mode=DISABLED
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 140637890
Server version: 5.7.25 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| usr_web1444_1 |
| usr_web1444_2 |
| usr_web1444_3 |
| usr_web1444_4 |
| usr_web1444_5 |
+--------------------+
6 rows in set (0.26 sec)
mysql> exit
Bye
Liquibase does not work, though. I tried below Docker command, but cannot figure out what is wrong about it.
jfabianmeier#JFM-HP-2018:~$ docker run -e INSTALL_MYSQL=true --rm -v $(pwd):$(pwd) liquibase/liquibase:4.15 --url=jdbc:mysql://localhost:3306/usr_web1444_4?autoReconnect=true&useSSL=false --changeLogFile=~/changelogs/changelog.sql --username=web144 --password=myDBPassword update
[1] 408
-bash: --changeLogFile=~/changelogs/changelog.sql: No such file or directory
jfabianmeier#JFM-HP-2018:~$ Checksum verified. Installing mysql-connector-java-8.0.30.jar to /liquibase/lib/
mysql-connector-java-8.0.30.jar successfully installed in classpath.
####################################################
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## Free schema change activity reports at ##
## https://hub.liquibase.com ##
## ##
####################################################
Starting Liquibase at 09:56:38 (version 4.15.0 #4001 built at 2022-08-05 16:17+0000)
Liquibase Version: 4.15.0
Liquibase Community 4.15.0 by Liquibase
Missing required subcommand
Usage: liquibase [GLOBAL OPTIONS] [COMMAND] [COMMAND OPTIONS]
Command-specific help: "liquibase <command-name> --help"
Global Options
....
I would like to know whether my Liquibase command is just wrong, or the URL is wrong, or if the issue might be with the SSL problem above. I honestly do not understand the error message and was not able to find something helpful through Google.
If you are able to connect with the mysql client probably the tunnel is correctly configured.
The error seems to be motivated because Liquibase doesn't understand the command provided when invoking Docker from the command line:
docker run -e INSTALL_MYSQL=true --rm -v $(pwd):$(pwd) liquibase/liquibase:4.15 --url=jdbc:mysql://localhost:3306/usr_web1444_4?autoReconnect=true&useSSL=false --changeLogFile=~/changelogs/changelog.sql --username=web144 --password=myDBPassword update
As you can see, it is printing by console the error and the typical usage help:
Missing required subcommand
Usage: liquibase [GLOBAL OPTIONS] [COMMAND] [COMMAND OPTIONS]
Command-specific help: "liquibase <command-name> --help"
I tested the code and it seems to be motivated by the url argument.
Please, try providing that value enclosed within quotes:
docker run -e INSTALL_MYSQL=true --rm -v $(pwd):$(pwd) liquibase/liquibase:4.15 --url="jdbc:mysql://localhost:3306/usr_web1444_4?autoReconnect=true&useSSL=false" --changeLogFile=~/changelogs/changelog.sql --username=web144 --password=myDBPassword update
In addition, bash is reporting that Liquibase is unable to find your change logs:
-bash: --changeLogFile=~/changelogs/changelog.sql: No such file or directory
The Liquibase official Docker image documentation mentions the following when describing how to provide the necessary change logs:
The docker image has a /liquibase/changelog volume in which the directory
containing the root of your changelog tree can be mounted. Your
-- changeLogFile argument should list paths relative to this.
Following that advice, please, try providing the following docker command for running your migration (assuming your current directory contains changelogs/changelog.sql):
docker run -e INSTALL_MYSQL=true --rm -v $(pwd):/liquibase/changelog liquibase/liquibase:4.15 --url="jdbc:mysql://localhost:3306/usr_web1444_4?autoReconnect=true&useSSL=false" --changeLogFile=changelog/changelogs/changelog.sql --username=web144 --password=myDBPassword update
Please, note again the use of double quotes to enclose the url parameter.
If your tunnel is not working properly Liquibase will report something like the following:
####################################################
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## Free schema change activity reports at ##
## https://hub.liquibase.com ##
## ##
####################################################
Starting Liquibase at 17:22:56 (version 4.15.0 #4001 built at 2022-08-05 16:17+0000)
Liquibase Version: 4.15.0
Liquibase Community 4.15.0 by Liquibase
Unexpected error running Liquibase: Connection could not be created to jdbc:mysql://localhost:3306/usr_web1444_4?autoReconnect=true&useSSL=false with driver com.mysql.cj.jdbc.Driver. Could not create connection to database server. Attempted reconnect 3 times. Giving up.
- Caused by: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
- Caused by: Connection refused
For more information, please use the --log-level flag

Orion Context Broker already running error

I have a problem when i start orion context broker as a docker container, it is always exiting, it says that Orion is already running, how can i fix this issue?
srdjan-orion-1 | time=2022-07-27T09:53:34.508Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=contextBroker.cpp[432]:pidFile | msg=PID-file '/tmp/contextBroker.pid' found. A broker seems to be running already
srdjan-orion-1 exited with code 1
When i run sudo ps aux | grep contextBroker this is the result: srdjan 31012 0.0 0.0 11568 652 pts/0 S+ 11:56 0:00 grep --color=auto contextBroker
The problem is also when i execute this command, the first number that appears after my username is always changing, and when i try to execute the kill order this is the result: sudo kill 31012 kill: (31012): No such process
and also this: sudo kill 11568 kill: (11568): No such process
Thanks for the help!

Mysql database gone on each docker restart

Background: I was updating my dockerfile and to make sure it works I rebuild my docker from scratch after purging everything using system prune -a. After it was built successfully I tried making a database called "database_A" and using "show databases" it does show that "database_A" was created. However whenever I restart the container it will be gone and checking using the query "show databases" the database "database_A" does not exist.
This is how I run the mysql container:
echo "runing mysql container..."
docker run --rm -it \
--network host \
-e MYSQL_ROOT_PASSWORD=secret \
--volume $(pwd)/mysql_data:/var/lib/mysql \
--volume $(pwd)/mysql.conf:/etc/mysql/mysql.conf.d \
--name mysql \
-p 3307:3307 \
-d mysql:5.6
in mysql.conf.d/mysqld.cnf it was specified
datadir = /var/lib/mysql
Using the bash terminal on the mysql container I checked the /var/lib/mysql folder and the ibdata1 file wasn't update at all. I tried creating a folder in the /var/lib/mysql and it does shows up in /mysql_data in host. So it's using the right volume but saving in different location? How can I verify it?
Try to use permanent folder for storing mysql db data files. Using $(pwd)/mysql_data seems temporary and dependent of where you run the container.
Below flow shows that created database is retained after container removal and starting new one with the same bind mount:
$ docker run --name some-mysql -v ~/private/mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=secret -d mysql:5.6
$docker exec -it some-mysql bash
root#0873b9898e23:/# mysql -uroot -psecret
Welcome to the MySQL monitor...
mysql> crete database test;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
mysql> ^DBye
root#0873b9898e23:/# exit
# let's remove the container and create new one
$ docker rm -f some-mysql
some-mysql
$docker run --name some-mysql -v ~/private/mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=secret -d mysql:5.6
docker exec -it some-mysql bash
root#6f77e071321e:/# mysql -uroot -psecret
Welcome to the MySQL monitor....
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
Also, note mysql docker docs.

Issues with helm install Orion Context Broker

I'm trying to install FIWARE Orion on AKS using your Helm chart. I installed MongoDB using
helm repo add azure-marketplace https://marketplace.azurecr.io/helm/v1/repo
helm install my-release azure-marketplace/mongodb
Consequently I configured the MongoDB in values.yaml as follows:
## database configuration
db:
# -- configuration of the mongo-db hosts. if multiple hosts are inserted, its assumed that mongo is running as a replica set
hosts: [my-release-mongodb]
# - my-release-mongodb
# -- the db to use. if running in multiservice mode, its used as a prefix.
name: orion
# -- Database authentication (not needed if MongoDB doesn't use --auth)
auth:
# --user for connecting mongo
user: root
# -- password to be used on mongo
password: mypasswd
# -- the MongoDB authentication mechanism to use in the case user and password is set
#mech: SCRAM-SHA-1
I use the command : helm install test orion
As I see this error in the pod logging I suppose something is wrong;
kubectl logs test-orion-7dfcc9c7fb-8vbgw
time=2021-05-28T19:50:29.737Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocContextCachePersist.cpp[59]:mongocContextCachePersist | msg=Database Error (persisting context: command insert requires authentication)
Can you help me with this please?
Kind regards,
Johan,
you should assure that mongo-db is actually available at "my-release-mongodb:27017", you can use "kubectl get services" for that. Beside that, assure that "root:mypasswd" are actually the credentials setup at mongodb.

Difficulty changing max_allowed_packet in mysql

I am trying to change the max_allowed_packet=20M. This is that I've done:
$ mysql -u root -e 'show variables like "max%"'
+----------------------------+----------------------+
| Variable_name | Value |
+----------------------------+----------------------+
| max_allowed_packet | 16777216 |
$ sudo vim /etc/my.cnf
# my.cnf
[mysqld]
max_allowed_packet=20M
$ sudo service mysql restart
$ mysql -u root -e 'show variables like "max%"'
+----------------------------+----------------------+
| Variable_name | Value |
+----------------------------+----------------------+
| max_allowed_packet | 16777216 |
Why is nothing changing here? What do I need to do to actually change this setting? (Note that I am using ec2 here).
Try
[mysqld]
max-allowed-packet=20M
instead.
Computer can be SO picky!
Your restart query is incorrect. It should be:
$ sudo service mysqld restart
You missed "d" in mysqld