Tag Archives: Alibaba cloud

[Solved] ERROR RocketmqCommon-Failed to obtain the host name

report an error when building a rocketmq stand-alone environment.

Problem encountered: using command

nohup sh mqnamesrv &

The following error occurred

java. net. UnknownHostException: hadoop03: hadoop03: unknown error
at java. net. InetAddress. getLocalHost(InetAddress.java:1505)
at org. apache. rocketmq. common. BrokerConfig. localHostName(BrokerConfig.java:201)
at org. apache. rocketmq. common. BrokerConfig.& lt; init> (BrokerConfig.java:39)
at org. apache. rocketmq. broker. BrokerStartup. createBrokerController(BrokerStartup.java:101)
at org. apache. rocketmq. broker. BrokerStartup. main(BrokerStartup.java:56)
Caused by: java. net. UnknownHostException: hadoop03: unknown error
at java. net. Inet4AddressImpl. lookupAllHostAddr(Native Method)
at java. net. InetAddress$2. lookupAllHostAddr(InetAddress.java:928)
at java. net. InetAddress. getAddressesFromNameService(InetAddress.java:1323)
at java. net. InetAddress. getLocalHost(InetAddress.java:1500)
… 4 common frames omitted

This is because the IP address corresponding to your host name cannot be found during startup. Just add the above configuration in /etc/hosts

Solution:

Operate according to the following command

Add the mapping marked in red to the file. Note: permission problems may occur during editing, and the root account needs to be switched

:wq! Save exit

Use the JPS command to check the process to see if NamesrvStartup has been started. If it is about closing it

sh mqshutdown namesrv

Start mqnamesrv again

nohup sh mqnamesrv &

Check the log and solve the problem

OSS Error: The difference between the request time and the current time is too large

1. Problem
alicloud OSS reports an error when uploading a file: the difference between the request time and the current time is too large

2. Reason
the request was initiated 15 minutes later than the current time of the OSS server. The OSS determines that the request is invalid and returns an error

3. Solution
the system time of OSS adopts GMT time. The system time of the equipment needs to be adjusted to GMT time or its corresponding time zone.

[Solved] Upload object failed, error: error domain = nscocoaerrordomain code = 260 “aliyun object stores OSS IOS upload files

Aliyun object stores OSS and IOS uploaded files,

Alibaba cloud OSS object store official demo


put.uploadingFileURL = [NSURL fileURLWithPath:@"<filePath>"];
// put.uploadingData = <NSData *>; // Upload NSData

You need a file path here. You can’t write the file name directly.

Upload object failed, error: error domain = nscocoaerrordomain code = 260 “the file” 123456.PNG “couldn’t be opened because there is no such file

The correct wording should be:

    NSString * filePath = [[NSBundle mainBundle] pathForResource:@"123456" ofType:@"png"];
    put.uploadingFileURL = [NSURL fileURLWithPath:filePath];

Then it succeeded!!!

[Solved] getObject: FAILED RequestCoreException: cURL resource: Resource id #78; cURL error: SSL certificate

Reason:

The reason for this problem is that curl.cainfo is not configured, which is located in php.ini.

Solution:

Since the reasons for the errors are stated, it is much easier to solve them, as follows:

1. Download cacert

Download address: https://curl.haxx.se/ca/cacert.pem

2. Modify php.ini and restart

curl.cainfo="real_path/cacert.pem"

matters needing attention:

Needs to be turned on php_curl、php_openSSL extension;