27 Commits

Author SHA1 Message Date
João Jandre
49cecaed06
Normalize loggers and upgrade log4j 1.2 to log4j 2.19 (#7131)
* Normalize logs

All classes that could have their loggers inherited from their fathers had their own loggers deleted;
Most loggers didn't have to be static, so most of them were normalized so that they wouldn't be;
All loggers are protected now;
Static logger's name are now 'LOGGER';
Non-static logger's name are now 'logger';
New class DbUpgradeAbstractImpl created so that all Upgraders extend it and inherit its logger

* Upgrade log4j

* fix errors caused by the merge

* Refactor cglibThrowableRenderer functionality to log4j2 and upgrade the last configuration files

* fix sonarcloud bug

* Fix errors caused by merge, remove some unused loggers, and rename a variable that was mistakenly renamed on the normalization commit

* Readd snmpTrapAppender, remove TestAppender

* Regenerate changes

* regenerate changes

* refactor last custom appender

* fix systemvm configuration xml

* Regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* Fix utils pom

* fix some tests

* regenerate changes

* Fix jar being printed on exception

* fix logging in system VMs, fix commands not having log4j2 classpath.

* regenerate changes

* Fix some unwanted renomeations

* fix end of file

* regenerate changes

* regenerate changes

* fix merge error

* regenerate changes

* fix tests

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* readd reload4j to tungsten as juniper depends on it

* Regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* re-add reload4j dependency to network-contrail, as juniper depends on it

* regenerate changes

* regenerate changes

* regenerate changes

* fix typo

* regenerate changes

* regenerate changes

* Fix end of files

* regenerate changes

* add logj42 to cloud-utils-SHADED.jar

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* Regenerate changes

* Regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* Regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* Regenerate changes

* fix some tests

* Regenerate changes

* Regenerate changes

* fix test

* Regenerate changes

* Regenerate changes
2024-02-08 09:55:41 -03:00
davidjumani
d949302d0f
packaging: Adding Centos8, Ubuntu 20.04, XCPNG8.1 Support (#4068)
* DB : Add support for MySQL 8

- Splits commands to create user and grant access on database, the old
statement is no longer supported by MySQL 8.x
- `NO_AUTO_CREATE_USER` is no longer supported by MySQL 8.x so remove
that from db.properties conn parameters

For mysql-server 8.x setup the following changes were added/tested to
make it work with CloudStack in /etc/mysql/mysql.conf.d/mysqld.cnf and
then restart the mysql-server process:

    server_id = 1
    sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
    innodb_rollback_on_timeout=1
    innodb_lock_wait_timeout=600
    max_connections=1000
    log-bin=mysql-bin
    binlog-format = 'ROW'

    default-authentication-plugin=mysql_native_password

Notice the last line above, this is to reset the old password based
authentication used by MySQL 5.x.

Developers can set empty password as follows:

    > sudo mysql -u root
    ALTER USER 'root'@'localhost' IDENTIFIED BY '';

In libvirt repository, there are two related commits

2019-08-23 13:13 Daniel P. Berrangé            ● rpm: don't enable socket activation in upgrade if --listen present
2019-08-22 14:52 Daniel P. Berrangé            ● remote: forbid the --listen arg when systemd socket activation

In libvirt.spec.in

        /bin/systemctl mask libvirtd.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-ro.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-admin.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-tls.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-tcp.socket >/dev/null 2>&1 || :

Co-authored-by: Wei Zhou <w.zhou@global.leaseweb.com>
Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-08-17 16:28:30 +05:30
Rohit Yadav
381039a58f
db.properties: Enforce UTC timezone by default (#4055)
* db.properties: Enforce UTC timezone by default

This would give users ability to change the timezone

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* fix server time to UTC

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* Update the db.usage.url.params=serverTimezone=UTC per Liridon's testing

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-05-06 10:49:50 +02:00
Rohit Yadav
eda3b35bfa CLOUDSTACK-10012: Migrate to Embedded Jetty
- Migrate to embedded Jetty server.
- Improve ServerDaemon implementation.
- Introduce a new server.properties file for easier configuration.
- Have a single /etc/default/cloudstack-management to configure env.
- Reduce shaded jar file, removing unnecessary dependencies.
- Upgrade to Spring 5.x, upgrade several jar dependencies.
- Does not shade and include mysql-connector, used from classpath instead.
- Upgrade and use bountcastle as a separate un-shaded jar dependency.
- Remove tomcat related configuration and files.
- Have both embedded UI assets in uber jar and separate webapp directory.
- Refactor systemd and init scripts, cleanup packaging.
- Made cloudstack-setup-databases faster, using `urandom`.
- Remove unmaintained distro packagings.
- Moves creation and usage of server keystore in CA manager, this
  deprecates the need to create/store cloud.jks in conf folder and
  the db.cloud.keyStorePassphrase in db.properties file. This also
  remove the need of the --keystore-passphrase in the
  cloudstack-setup-encryption script.
- GZip contents dynamically in embedded Jetty

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-03 23:57:25 +05:30
Wido den Hollander
0c1c27ba85
CLOUDSTACK-9871: Set SQL Mode in SQL Session for MySQL 5.7 compatibility
MySQL 5.7 has a more strict SQL mode by default with which CloudStack
is not compatible.

By setting the SQL Mode to a more relaxed mode on run-time we can
run without changing any SQL server settings.

Admins could also apply this to the [mysqld] section of their my.cnf:

sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2017-04-12 15:13:08 +02:00
Nick Livens
02c5d44f0b Dynamic loading of DB driver + support for other DB providers 2016-05-23 15:50:28 +02:00
Rohit Yadav
069aa4e5f3 CLOUDSTACK-8433: remove awsapi db usage and add upgrade cleanup path
- Removes awsapi db properties usage across codebase
- Removes references from spring xmls, test cases and TransactionLegacy
- Adds sql command to drop database cloudbridge in schema-451to460-cleanup.sql

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-06 15:22:04 +02:00
Hugo Trippaers
594b51c629 Fixup the license headers in the utils project. All files now use the same license header and this is enforced by the maven-license-check plugin. 2014-02-18 12:08:36 +01:00
tuna
fca6d56681 remove private changes 2013-12-10 10:36:30 +07:00
tuna
dc151115be AutoScaling without NetScaler 2013-12-10 10:35:55 +07:00
tuna
61e80f030a remove unused code 2013-12-09 23:33:15 +07:00
tuna
d935d3865a tuna 2013-12-09 23:33:14 +07:00
Abhinandan Prateek
6cfcbc665e reverting a local change 2013-07-18 16:22:08 +05:30
Bharat Kumar
d73bb22802 Incorportaed the review changes Now dhcpservice IPs are removed when last vm from the subnet is removed. Rebased with master.
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-07-17 12:35:06 +05:30
Kelven Yang
7b75f0d990 Sync master to javelin one more time 2013-02-01 11:37:33 -08:00
Kishan Kavala
1f57d925eb Apply API refactoring changes. Make changes to Regions API to work with new code 2013-01-25 18:41:59 +05:30
Rohit Yadav
6214b1d4bd db.properties: adding other key value info for dbcreator to work in a generic way
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 17:19:55 -08:00
Prasanna Santhanam
1f1a13448f simulator: resurrect simulator hypervisor as plugin
Multiple fixes:
1. changes to the mvn configuration
    a. include simulator to client.war
    b. activate simulator by profile
2. templates for simulator
3. developer prefill for simulator
    a. Use deplydb-simulator to setup simulator db
4. Inherit components-simulator.xml from components.xml
5. ListVolumesCommand missed for MockStorageManager
6. Include simulator properties into utils/db.properties

TODO:
 Secondary storage VMs don't come up because ComponentLocator doesn't
retain a unique set of adapaters by name. Fix this in subsequent
checkin.
2012-12-23 19:28:57 -08:00
Laszlo Hornyak
988ccfc45d removed some unused database connection properties
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-13 22:46:29 -08:00
Likitha Shetty
2a8b9e5130 CLOUDSTACK-292: AWSAPI calls fail with 'com.cloud.utils.exception.CloudRuntimeException: DB Exception on: null' 2012-12-13 22:06:16 -08:00
Kishan Kavala
f0f33bf4da Added Mock ApiServer, Regions API calls with api keys 2012-10-17 14:16:36 +05:30
Edison Su
06d516a80c if db.properties.override missing, shouldn't panic 2012-10-10 16:20:35 -07:00
Chip Childers
95ce55f0a1 License header updates for the utils folder 2012-08-03 14:15:09 -04:00
David Nalley
91fadc4a0d fixing line ends in utils 2012-04-09 20:05:41 -04:00
frank
2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
Abhinandan Prateek
3c6a0efa29 bug 11181: adding a param so that mysql can cache the listVM prepared statement sql effectively 2011-09-07 05:50:33 +05:30
Manuel Amador (Rudd-O)
05c020e1f6 Source code committed 2010-08-11 09:13:29 -07:00