Loongson+uos build business system problem solving

Two days ago, I temporarily received a task, saying that I would pass a certification, so I had to build a set of business system tests on the uos system, and Tongxin provided several servers to build it. However, the construction process was not very smooth, and the following problems were encountered:

1. Error when importing database file

Insert picture description hereThis library is taken directly from the production environment and should not be too long. So Baidu took a look and found that some configurations are too small. Add the following three configurations to the database configuration file and restart the database before importing it. can.

innodb_log_file_size=1024M
innodb_file_format ='Barracuda'
innodb_strict_mode=0

2. Cannot use jboss to deploy the project

When one of them was deployed, it was the same as when it was tested locally. I ran the deployment script directly. The result did not start, but I started it manually, and found the following error:
Insert picture description here

The war package is deployed using jboss6.1, only jdk1.7 can be used, and there has been no problem. I installed the uos system with the company’s server before and tested it. It can indeed run, but the jdk error is displayed here. I didn’t expect it to be related to the cpu at the time. It is estimated to be a bit problem, so I used the uname command to take a look.

uname -m

Insert picture description here
Insert picture description here
The number of bits is indeed okay, it is 64-bit, but this thing is mips architecture.
At the time, I didn't know what this was for. You can only search by keywords, but only these things are found
Insert picture description hereInsert picture description here

Okay, then I searched for mips jdk and saw that there is a special jdk in the Godson community. Isn't this difficult? Download a jdk1.7 and start jboss directly
Insert picture description here

I clicked in and found out that I was too naive-Loongson OpenJDK, there is no version 7
Insert picture description hereInsert picture description here

3. Use tomcat to start error-mq problem

It seems that jboss is not available, only tomcat can be used.
The server comes with jdk, installed using apt, and took a look at java -version
Insert picture description here

It can be used, then go directly to the offline package mode, decompress, change the configuration and put the war package to start directly.

  • At the beginning, tomcat 9.0 was put up, using the built-in jdk to start, and an error was reported.
  • Change to tomcat8.5, use the built-in jdk to start, and report an error.
  • Then change to 7.0, start using the built-in jdk, and report an error.

That means that as long as it is the built-in jdk, no matter which version of tomcat is started, an error will be reported. Then only change jdk.

There are three versions of jdk in the Loongson community, namely Loongson OpenJDK 13-ea 64-bit, Loongson OpenJDK 8 64-bit, and Loongson OpenJDK 6 32-bit.
Insert picture description here
Under normal circumstances, the jdk we use is 8. So I downloaded a jdk8 and used it with tomcat8, but it still reported an error when it started. The log just said that one or more listeners failed to start. For more detailed information
Insert picture description here, the error is reported before the corresponding container log file . The main reason is The log is not detailed enough, so the debug mode is used to check the error

./catalina.sh debug

Found the following error:
Insert picture description here

Failed to connect to [tcp://127.0.0.1:61617?wireFormat.maxInactivityDuration=0] after: 10 attempt(s) continuing to retry

This is an error reported by mq. I checked it and found that mq did not start. The reason is... When the script deploys mq, the mq jdk is specified in the mq configuration as the general version jdk1.7, and I forgot to change it.
Insert picture description here

4. The database of the deployment project cannot be connected

After changing the jdk of mq and restarting, it was found that the database could not be connected again.
Insert picture description here

You can connect using localhost, but you cannot connect using 127.0.0.1. This involves a more important issue. The difference between localhost and 127.0.0.1 in mysql , see below for details:
Difference between localhost and 127.0.01 in mysql

Insert picture description hereAll in all, when using 127.0.0.1 to connect to the database, it does not go through the network card like using localhost, it needs to be connected through the network card, firewall, etc. like other IPs.
mariadb10.3 may adopt the new caching_sha2_password authentication method by default, this method is not compatible with the conventional old web service interface (maybe, I am not sure, because I only think of it after modifying the encryption method and look it up. See what his encryption method is, it’s too late)
In short, use the command to change the encryption method, as follows

update mysql.user set authentication_string=password("123456"),plugin='mysql_native_password' where user='root';

Insert picture description hereNow the database encryption method is
Insert picture description herethe same as the old one. After the test, you can use localhost to connect.

5. x11 error

Then restarted tomcat, waited for a long time, reported the following error:
Insert picture description hereturn up again, see this error after the database is started
Insert picture description here

It's really a twists and turns...
Baidu reported this error and found that it was a problem with the remote connection tool used now, but I was too lazy to solve this problem. Anyway, uos has a graphical interface. You can directly remote to the graphical interface and use the terminal to run it. . So use Sunflower to remotely connect to the server and open the terminal to execute commands.

6. The deployment is successful and the browser cannot be accessed

at last! The database connection is successful and the log is printed!
However, a 500 error was reported when I entered the URL on the browser.
Insert picture description hereInsert picture description here

It took the most time to solve this error. Anyway, all kinds of Baidus had no results. I thought about changing tomcat, and I couldn't give up at the last step, so I changed tomcat to 9.0. After starting the visit, it was successful.

Attached tomcat-jdk matching form on the tomcat official website, obviously 8 tomcat with 7 or more jdk is ok, but I don't know why mine does not work. In the future, try to follow this to install jdk and tomcat.
Insert picture description here

7. Summary

Summarize the following main problems:
1. Loongson CPU has its own jdk, general jdk does not run normally on Loongson
2. Pay attention to start java project, must match the corresponding jdk
3. Some errors are remote connection tools As a result, you can not be obsessed with reporting errors and change a connection tool, which may be faster.
4. The database is very important. Before deploying the service, determine the configuration of the database.

Guess you like

Origin blog.csdn.net/xiguashixiaoyu/article/details/109364793