Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of embedded and external chain Database in vcenter

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the vcenter embedded and external chain database example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

Vcenter supports in-line and out-of-chain databases, which are two common deployment models.

Vcenter supports embedding, and the embedded database defaults to vpostgresql.

Embedded database is suitable for small deployment, easy to install and does not need to configure ODBC

Embedded database can be selected for small scale, but Oracle database is usually selected for large scale.

Another point is PSC, small-scale is also embedded, but large-scale, multi-VC is best to use a single psc.

There is also that VCNEGER is deployed on the windows system, followed by the SQL SERVER database. Sql2008 R2 can be used for bundled databases for small deployments (up to 5 hosts and 50 virtual machines).

If the VCENTER SERVER APPLIANCE is deployed by VCENTER, the

After vCenter Server Appliance version 5.0.1, PostgreSQL was used for embedded databases instead of IBM DB2 (IBM DB2 is used in vCenter Server Appliance 5.0).

Most of the external databases are oracle, so it is necessary to configure ODBC and enable VCENTER related services in the VCENTER of windows. Not if it's vCenter Server Appliance.

VCenter Server Appliance 6. 0 is not supported. IPv6,6.5 is supported.

Note:

The vCenter Server Appliance 5 embedded database is configured to manage an inventory of more than 5 hosts and more than 50 virtual machines. If you use an embedded database with vCenter Server Appliance, exceeding these limits can cause many problems, including causing vCenter Server to stop responding.

The PostgreSQL database bundled with vCenterServer 6.0 by default is suitable for environments with up to 20 hosts and 200 virtual machines. For vCenterServer Appliance, embedded PostgreSQL databases can be used in an environment with up to 1000 hosts and 10000 virtual machines, but the embedded database uninstall is gone with VC APPLIANCE, and we produce external oracle databases.

In version 5.5, even the outer chain ORACLE database cannot exceed 50GB and the number of table rows exceeds 800 million, otherwise it is overfull when upgraded to 6.0 and needs to be cleaned before it can be upgraded.

Supplement the statement to clean up the database:

Use vcdb;--vcdb is the name of the vCenter database. If it is another name, change all vcdb in the script to the actual name.

Deletefrom dbo.VPX_EVENT_ARG;-- delete event log table

twelve。

Deletefromdbo.VPX_EVENT;-- delete event log table

Droptable dbo.VPX_HIST_STAT1;-- delete table dbo.VPX_HIST_STAT1

16.

Droptable dbo.VPX_HIST_STAT2;-- delete table dbo.VPX_HIST_STAT2

17.

Droptable dbo.VPX_HIST_STAT3;-- delete table dbo.VPX_HIST_STAT3

18.

Droptable dbo.VPX_HIST_STAT4;-- delete table dbo.VPX_HIST_STAT4

USE [VCDB]

/ * recreate the table object: Table [dbo]. [VPX_HIST_STAT1] script date: 12 Universe 17 Placement 15:32:57 2013 * /

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

CREATETABLE [dbo]. [VPX_HIST_STAT1] (

[COUNTER_ID] [bigint] NOTNULL

[TIME_ID] [bigint] NOTNULL

[STAT_VAL] [bigint] NOTNULL

) ON [PRIMARY]

/ * rebuild the table object: Table [dbo]. [VPX_HIST_STAT1] complete * /

USE [VCDB]

/ * recreate the table object: Table [dbo]. [VPX_HIST_STAT2] script date: 12 Universe 17 Placement 15:33:30 2013 * /

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

CREATETABLE [dbo]. [VPX_HIST_STAT2] (

[COUNTER_ID] [bigint] NOTNULL

[TIME_ID] [bigint] NOTNULL

[STAT_VAL] [bigint] NOTNULL

) ON [PRIMARY]

/ * recreate the table object: Table [dbo]. [VPX_HIST_STAT2] completion date of script: 12 purplets 15:33:30 2013 * /

USE [VCDB]

GO

/ * recreate the table object: Table [dbo]. [VPX_HIST_STAT3] script date: 12 Universe 17 Placement 15:34:20 2013 * /

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

CREATETABLE [dbo]. [VPX_HIST_STAT3] (

[COUNTER_ID] [bigint] NOTNULL

[TIME_ID] [bigint] NOTNULL

[STAT_VAL] [bigint] NOTNULL

) ON [PRIMARY]

/ * rebuild the table object: Table [dbo]. [VPX_HIST_STAT3] complete * /

USE [VCDB]

GO

/ * recreate the table object: Table [dbo]. [VPX_HIST_STAT4] script date: 12 Universe 17 Placement 15:34:57 2013 * /

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

CREATETABLE [dbo]. [VPX_HIST_STAT4] (

[COUNTER_ID] [bigint] NOTNULL

[TIME_ID] [bigint] NOTNULL

[STAT_VAL] [bigint] NOTNULL

) ON [PRIMARY]

/ * rebuild the table object: Table [dbo]. [VPX_HIST_STAT4] complete * /

/ * shrink the database * /

USE [VCDB]

GO

DBCC SHRINKDATABASE (Null VCDB')

GO

/ * shrink the database * /

By version 6.5, the function is more powerful, and there is little difference in the size of the database between the embedded and the outer chain.

Another problem

How to make VMware vCenter for Linux support MySQL

Study the Microsoft SQL definition table to make the MySQL table most similar to the Microsoft SQL table. Starting with the file / usr/lib/vmware-vpx/VCDB_mssql.sql, I created a later VCDB_mysql.sql file.

The conversion is as follows, however, these changes will force vCenter to support only UTF-8 strings. You can easily support UTF-16, but there is a limit to MySQL with a size index of 1000 bytes, and some types of nvarchar areas extend and pass this limit.

Convert NTEXT type to TEXT type or BLOB type (if you want to support UTF-16) NVARCHAR type to VARCHAR nvarchar type to varchar

ACCESSIBLE and INTERVAL are considered keywords for MySQL, so they need to transform the following:

INTERNAL to `INTERVAL`

ACCESSIBLE to `ACCESSIBLE`

Finally, some of the same functions in Microsoft SQL Server and MySQL don't do the same thing-especially the isnull function. This is an issue in MySQL, not the equivalent of Microsoft SQL or Oracle's nvl function of the isnull function. This change is as follows:

Isnull change to ifnull

ISNULL changed to IFNULL

In addition, the CAST function in MySQL has different parameters than Microsoft SQL. I had to change the CAST to convert numbers through the SIGNED type instead of BIGINT; because the CAST function in MySQL does not support BIGINT. In addition, len is not a valid MySQL function, so we must also change the two database declarations mentioned above to LENGTH instead of LEN.

The last question is the case. Everything in Linux is case-sensitive, including the database name of MySQL, so the final change is to convert case.

Vpx_sequence to VPX_SEQUENCE

Vpx_object_type to VPX_OBJECT_TYPE

Vpx_lock to VPX_LOCK

Vpx_version to VPX_VERSION

Use the following command to submit the new schema to the MySQL database server. Note: you should use the IP address of your MySQL server, replace the IPOfMySQLServer parameter, your MySQL username instead of the MySQLUserName parameter, and the command will require a password.

Mysql-p-h IPOfMySQLServer-u MySQLUserName < VCDB_mysql.sql

Now, all that is left is to solve some STATS stored procedures, undo and delete the database.

However, even after all these updates, the MySQL attempt fails because the vpxd service does not recognize MySQL as a valid database. However, through some specific tools of Linux, I have found that PostgreSQL is an effective database.

Open source database support is a must for GNU / Linux vCenter-based servers.

Thank you for reading this article carefully. I hope the article "sample Analysis of embedded and external chain databases in vcenter" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report