forked from utianayuba/kolla-ansible-aio-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trove-test.txt
56 lines (46 loc) · 3.23 KB
/
trove-test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#1. Download Trove Wallaby Guest image and upload it to the OpenStack Glance
wget -c https://tarballs.opendev.org/openstack/trove/images/trove-wallaby-guest-ubuntu-bionic.qcow2 -O trove-wallaby-guest-ubuntu-bionic-20220101.qcow2
source admin-openrc.sh
openstack image create trove-wallaby-guest-ubuntu-bionic-20220101 --private --disk-format qcow2 --container-format bare --tag trove --tag mysql --tag mariadb --tag postgresql --file trove-wallaby-guest-ubuntu-bionic-20220101.qcow2
openstack image list
#2. Modify trove_guestagent_datastore_postgres_service.py
sudo cp `sudo find /var -name service.py | grep postgres | grep /var/lib/kolla | head -1` trove_guestagent_datastore_postgres_service.py
sudo chown karno:karno trove_guestagent_datastore_postgres_service.py
vim trove_guestagent_datastore_postgres_service.py
...
if extra_volumes:
volumes.update(extra_volumes)
# Ensure folders permission for database.
for folder in ['/etc/postgresql', '/var/run/postgresql']:
operating_system.ensure_directory(
folder, user=CONF.database_service_uid,
group=CONF.database_service_uid, force=True,
as_root=True)
# Expose ports
...
for U in `sudo find /var -name service.py | grep postgres | grep /var/lib/kolla`; do sudo cp -v trove_guestagent_datastore_postgres_service.py $U; done
#3. Modify trove_postgresql_config.template
sudo cp `sudo find /var -name config.template | grep postgresql | grep /var/lib/kolla | head -1` trove_postgresql_config.template
sudo chown karno:karno trove_postgresql_config.template
sed -i '/^[^#]/ s/\(^.*wal_keep_segments.*$\)/#\1/' trove_postgresql_config.template
for U in `sudo find /var -name config.template | grep postgresql | grep /var/lib/kolla`; do sudo cp -v trove_postgresql_config.template $U; done
#4. Create datastore versions
openstack datastore version create 8 mysql mysql "" --image-tags trove,mysql --active --default
openstack datastore version create 10.7 mariadb mariadb "" --image-tags trove,mariadb --active --default
openstack datastore version create 14 postgresql postgresql "" --image-tags trove,postgresql --active --default
openstack datastore list
openstack datastore version list mysql
openstack datastore version list mariadb
openstack datastore version list postgresql
#5. Create database instances
source karno-openrc.sh
openstack network list
openstack database instance create --flavor flavor-2-2-20 --size 1 --databases db0 --users dbuser:dbpasswd --datastore mysql --datastore-version 8 --nic net-id=eead2df2-a4c6-4b25-b3d8-c97c2136450c mysql-8
openstack database instance create --flavor flavor-2-2-20 --size 1 --databases db0 --users dbuser:dbpasswd --datastore mariadb --datastore-version 10.7 --nic net-id=eead2df2-a4c6-4b25-b3d8-c97c2136450c mariadb-10.7
openstack database instance create --flavor flavor-2-2-20 --size 1 --databases db0 --users dbuser:dbpasswd --datastore postgresql --datastore-version 14 --nic net-id=eead2df2-a4c6-4b25-b3d8-c97c2136450c postgresql-14
openstack database instance list
#6. Test access the database from database client instance
sudo yum install -y mariadb postgresql
mysql -h 10.0.0.XXX -u dbuser -pdbpasswd db0
mysql -h 10.0.0.XXX -u dbuser -pdbpasswd db0
psql -h 10.0.0.XXX -U dbuser -W db0