1. Build the configuration that disconf needs to be installed.
Installing LINUX:CENTOS7
Installing zookeeper:zookeeper-3.4.6
Installing redis:redis-3.0.0
Installing nginx:nginx-1.8.0
Installing mysql:mysql-community-release-el6-5.noarch.rpm
Installing tomcat:apache-tomcat-8.0.28
3. Install MySQL
The installation process was very smooth, but the command operation was particularly uncomfortable.
(1) View MySQL service status
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > 1, ps-ef |grep mysqld
- 2, Ps-aux|grep mysqld
- 3. Service mysqld Status
- 4. Service MySQL status</span>
(2) Enter MySQL
(3) Perform MySQL related operations, the operation is performed at the prompt of MySQL, remember: and each command is terminated with a semicolon.
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > 1. Displays the list of databases.
- show databases;
- 2. Display the data table in the library:
- use MySQL;//Open Library
- Show tables;
- 3, display the structure of the data table:
- describe table name;
- 4, build the library:
- Create database name;
- 5, build the table:
- Use library name;
- CREATE TABLE table name (field settings list);
- 6. Deleting the library and deleting the table:
- drop database name;
- drop table name;
- 7. Empty the records in the table:
- Delete from table name;
- 8. Display the records in the table:
- SELECT * from table name; </span>
(4) Execute SQL script
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > MySQL < all-databases.sql (Import database)
- Mysql>source News.sql; (executes under MySQL command, can import tables)
- For example: source/usr/local/disconf/src/disconf/disconf-web/sql/0-init_table.sql;
- </span>
(5) Remotely connect to MySQL on a Linux server using Navicate?
① into MySQL, view all users
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > SELECT ' Host ', ' User ' from user;</span>
② Updating user tables
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > UPDATE user SET ' Host ' = '% ' WHERE ' user ' = ' root ' LIMIT 1;
- </span>
③ Force Refresh Permissions
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > Flush privileges;</span>
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > Complete the above steps to connect to the database remotely, the key sentence above is
- UPDATE user SET ' Host ' = '% ' WHERE ' user ' = ' root ' LIMIT 1;
- Where% means to allow all IP remote access, if you need to specify a specific IP to write a specific IP can be
- </span>
4. Start Tomcat
After booting, shutting down, and error tracking for the Tomcat service under Linux, using Putty to connect remotely to the server, you typically start the shutdown Tomcat service in several ways:
Switch to the bin directory under the Tomcat home directory (CD Usr/local/tomcat/bin)
(1), start Tomcat service
①: Direct start./startup.sh
②: Start nohup as a service./startup.sh &
③: Console dynamic output mode starts./catalina.sh Run dynamically displays the console output information of the Tomcat daemon, then exits and closes the service after CTRL + C
Explain:
There is a disadvantage of Tomcat booting through ①, ③, and when the client connection is disconnected, the Tomcat service will stop immediately, and through Mode II can be run as a Linux service
Tomcat initiated by way of ①, ②, whose logs are written to the corresponding log file, and cannot dynamically view the output information and error conditions of the Tomcat console, by way of three can start the Tomcat service in console mode,
directly see the program Runtime background console output information, do not have to be very troublesome to open the Catalina.out log file for viewing, so that it is easy to track the background output information. The Tomcat console information includes information such as log4j and System.out.println () output.
(2), close Tomcat service
./shutdown.sh
5.nginx Log
Nginx.conf will have two logs, Access.log and Error.log, respectively. Where these two logs can be liked. In general, there will be a logs in the Nginx directory to save. You can then also set Access.log and Error.log in the corresponding server directory to understand the corresponding server situation.
Access.log main record "Who is logged in, from where to log in, after login what happened", the specific format can be set in nginx.conf.
The main record of Error.log is to check for errors that occur inside nginx.conf.
The above error is generated, mainly the configuration path is not correct, the path of the log file is reconfigured in nginx.conf. Workaround: Set up Access.log next time in the home directory.
6, it is very important to view log files!
After the environment is well-configured, the continuous occurrence of Tomcat does not come, Nginx does not come, all up, disconf page can not access, this time to look at the log file is particularly important. Each service is configured with the relevant log files, look at the boot log, can quickly locate errors, solve the problem.
7. Turn off the firewall
When looking for data to solve a problem, many solutions have to turn off the firewall. So pay attention to shutting down the firewall. In front of the building, very careful. To the last step, forget, cause the page has not come out, wasted a lot of time.
[Java]View PlainCopy
- <span style="font-family: ' kaiti_gb2312 '; font-size:18px;" > Check firewall status command firewall-cmd--state
- Turn off Firewall Command---service firewalld stop
- </span>
Appendix:
In this process, there is basically a part of the process of installing the configuration.
Create folder--download--unzip--Install compile--Configure environment variable--Modify configuration file--Configure the associated port number.
(1) Create a new directory by creating a file mkdir. If the directory already exists, then long will not be able to create. Format: mkdir folder name, for example: mkdir one
Touch can be used to create a binary file. Touch file name. There should be a space between the touch file file names. Example: Touch myID
(2) Directory command:
The LS command is meant to list the contents of a directory.
The ls-l command lists the folder contents in verbose mode.
The ls-a command lists everything in the file, including the following "." The hidden file at the beginning.
Transform directory: CD. Format: CD-relative path or absolute path; Represents a return to the current upper-level directory. CD-Means back to the directory that you just started.
Display the current directory: PWD
(3) sudo command
The sudo command allows authorized users to execute commands from Superuser or other users. Note: sudo allows the user to borrow Superuser privileges, and then the "su" command actually allows the user to log on as a super user. So sudo is more secure than Su.
(4) Copy files or directories: CP source file Destination file
Cp-r file destination file. You can copy files or folders using the-R parameter, and you can only copy files without the-R.
(5) Delete directory: RM file directory
(6) Look at only a few lines: Tail-n-F. Where-N: followed by a number, indicating the meaning of a few lines. -F: Indicates continuous monitoring of the following file name, wait until Ctr+c will end the tail monitor.
For example: Tail-n 20/etc/man.config. Indicates that the last 20 rows are displayed.
(7) Ifconfig View and configure network devices. (see Ifcofig, not ipconfig)
"DISCONF" Environment to build "Linux"