Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

ALTER SERVER

Updated on 2022-07-29 GMT+08:00

Function

ALTER SERVER adds, modifies, or deletes the parameters of an existing server. You can query existing servers from the pg_foreign_server system catalog.

Precautions

Only the owner of a server or a system administrator can run this statement.

Syntax

  • Change the parameters of an external server.
1
2
ALTER SERVER server_name [ VERSION 'new_version' ]
    [ OPTIONS ( {[ ADD | SET | DROP ] option ['value']} [, ... ] ) ];

In OPTIONS, ADD, SET, and DROP are operations to be executed. If these operations are not specified, the ADD operation will be performed by default. option and value are corresponding operation parameters.

Currently, only SET is supported on an HDFS server. ADD and DROP are not supported. The syntax for SET and DROP operations is retained for later use.

  • Change the owner of an external server.
1
2
ALTER SERVER server_name 
    OWNER TO new_owner;
  • Change the name of an external server.
1
2
ALTER SERVER server_name 
    RENAME TO new_name;
  • Refresh the HDFS configuration file. Only 8.0.0.10 and later versions (except 8.1.0) support this function.
1
ALTER SERVER server_name REFRESH OPTIONS;

Parameter Description

The server parameters to be modified are as follows:

  • server_name

    Specifies the name of the server to be modified.

  • new_version

    Specifies the new version of the server.

  • The server parameters in OPTIONS are as follows:
    • address

      Specifies the endpoint of the OBS service.

      Specifies the IP address and port number of the primary and standby nodes of the HDFS cluster.

      NOTE:
      • address is mandatory for HDFS servers. Therefore, ADD and DROP operations are not supported.
      • address only supports IPv4 addresses in dot-decimal notation, and an address string cannot contain spaces. Groups of addresses are separated by commas (,). An IP address and a port number are separated by a colon (:). You are advised to configure two IP address and port pairs in an HDFS cluster. One is used as the socket address of the primary HDFS NameNode and the other is used as that of the secondary HDFS NameNode.
      • If the server type is DLI, the address is the OBS address stored on DLI.
    • hdfscfgpath

      Specifies the HDFS cluster configuration file.

      NOTE:
      • If HDFS is in security mode, hdfscfgpath is mandatory.
      • If you set hdfscfgpath, you can only set one value for path.
    • encrypt

      Specifies whether data is encrypted. This parameter is available only when type is OBS. The default value is off.

      Value range:

      • on indicates that data is encrypted.
      • off indicates that data is not encrypted.
    • access_key

      Indicates the access key (AK) (obtained by users from the OBS page) used for the OBS access protocol. When you create a foreign table, its AK value is encrypted and saved to the metadata table of the database. This parameter is available only when type is OBS.

    • secret_access_key

      Indicates the secret access key (SK) (obtained by users from the OBS page) used for the OBS access protocol. When you create a foreign table, its SK value is encrypted and saved to the metadata table of the database. This parameter is available only when type is OBS.

    • dli_address

      Specifies the endpoint of the DLI service. This parameter is available only when type is DLI.

    • dli_access_key

      Specifies the AK (obtained by users from the DLI page) used for the DLI access protocol. When you create a foreign table, its AK value is encrypted and saved to the metadata table of the database. This parameter is available only when type is DLI.

    • dli_secret_access_key

      Specifies the SK (obtained by users from the DLI page) used for the DLI access protocol. When you create a foreign table, its SK value is encrypted and saved to the metadata table of the database. This parameter is available only when type is DLI.

    • region

      Indicates the IP address or domain name of the OBS server. This parameter is available only when type is OBS.

    • dbname

      Specifies the database name of a remote cluster to be connected. This parameter is used for collaborative analysis.

    • username

      Specifies the username of a remote cluster to be connected. This parameter is used for collaborative analysis.

    • password

      Specifies the user password of a remote cluster to be connected. This parameter is used for collaborative analysis.

  • new_owner

    Specifies the new owner of the server. To change the owner, you must be the owner of the foreign server and a direct or indirect member of the new owner role, and must have the USAGE permission on the encapsulator of the external server.

  • new_name

    Specifies the new name of the server.

  • REFRESH OPTIONS

    Refreshes the HDFS configuration file. This command is executed when the configuration file is modified. If this command is not executed, an access error may be reported.

Examples

Change the current name to the IP address of the hdfs_server server.

ALTER SERVER hdfs_server OPTIONS ( SET address '10.10.0.110:25000,10.10.0.120:25000');

Change the current name to hdfscfgpath of the hdfs_server server.

ALTER SERVER hdfs_server OPTIONS ( SET hdfscfgpath '/opt/bigdata/hadoop');

Helpful Links

CREATE SERVER DROP SERVER

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback