In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
one。 How to connect to the local server
There are two ways to connect to the local database server:
1.1. By sharing memory. This is recommended when the application and the database server are on the same host. In this way, the application is connected to the same shared memory as the online system. The application puts the message on the segment for online processing, and after online processing, the result is put back to the segment for the application to take away.
1.2. Connect through TCP/IP using a socket (sockets) or TLI programming interface. This method can be used for both local and remote connections. When the application and the database server are on the same host, informix uses the network loopback mechanism.
The settings of configuration parameters and environment variables depend on how the application connects to the database server.
The advantage of using shared memory as a local connection is better performance. But the shared memory segment where the information is stored is not secure. Because the user can destroy the paragraph intentionally or unintentionally. Therefore, if a system has high security requirements. The connection mode of TCP/IP should be used.
two。 Remote connection to online
The application must connect to the remote online system through TCP/IP or IPX/SPX. While connecting to the online system through TCP/IP, you can also connect to online through shared memory. That is, you can connect to the online system in a hybrid way.
three。 Remote connection through TCP/IP
Informix communicates with TCP/IP through the following interfaces
Sockets
TLI (Transport Layer Interfaces)
Sockets and TLI (transport layer interface) are the interfaces used to control the application and network layers. Their calls are similar and can accomplish the same tasks (for example, connecting data, sending and receiving data). You can check the files in the $INFORMIXDIR/release directory to determine which interface your hardware platform provides.
four。 How customers connect
When the application wants to connect to the database service, it must set up some basic connection information. This information is stored in the $INFORMIXDIR/etc/sqlhosts file, which must be maintained by the online system administrator.
The application must set the informixserver environment variable. The variable points to an entry in the sqlhosts file. For a connection to online, this value is the value of the DBSERVERNAME of the online configuration file, which can be the unique name of any sqlhosts file.
Once the application finds the correct entry in the sqlhosts file, it can obtain the necessary information to connect to the database server.
If the application is on a different machine than the database server, there should be an sqlhost file on each machine. Because the database server needs this file for initialization.
four。 What do customers need to pay attention to when using TCP/IP?
4.1. If you connect using TCP/IP, provide the following information:
Where's the mainframe? Informix requires the Internet address of the host, which is stored in / etc/hosts. This Internet is used with "." A separated set of numbers.
The port number on the host. The port number is used by the client to indicate which server on the host it wants to connect to. There is always a listening process on the host listening to this port number, waiting for a connection request from the client. The port number must be unique in the / etc/services file.
The program interface connected to the host, either socket or TLI.
4.2.TCP/IP connected sqlhosts file
Dbservername: this is one of the DBSERVERNAME values or DBSERVERALIASS values in the configuration file of online, and it is also the value of the INFORMIXSERVER environment variable set before startup.
Nettype: ontlitcp for TLI and onsoctcp for sockets.
Hostname: the host name where the database server is located. This value is usually used as a key value to find the host IP address in the / etc/hosts file.
Servername: the name of the service connected to the host. This value is usually used as a key value to find the port number and protocol in the / etc/services file.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.