Platform deployment
step1. Download OracleJDK
step2. Unzip
step3. Add environment variables
The specific operations are as follows:
lemon@ubuntu:~$ cd ~/download/
lemon@ubuntu:~/download$ wget https://download.oracle.com/otn-pub/java/jdk/13.0.2+8/d4173c853231432d94f001e99d882ca7/jdk-13.0.2_linux-x64_bin.tar.gz
lemon@ubuntu:~/download$ tar vxf jdk-8u191-linux-x64.tar.gz
lemon@ubuntu:~/download$ ls #View files in the current directory
jdk1.8.0_191 jdk-8u191-linux-x64.tar.gz
lemon@ubuntu:~/download$ sudo mv jdk1.8.0_191/ /usr/local/jdk1.8/ #Move the jdk1.8.0_191 folder to /usr/local/ and rename it to jdk1.8
lemon@ubuntu:~/download$ sudo vim /etc/profile #Edit environment variables
Add the following at the end of the environment variable:
export JAVA_HOME=/usr/local/jdk1.8
export JRE_HOME={JAVA_HOME}/jre export CLASSPATH=.: {JAVA_HOME}/lib:{JRE_HOME}/lib export PATH=.: {JAVA_HOME}/bin:$PATH
Reload the environment variable after saving to make it effective:
lemon@ubuntu:~/download$ source /etc/profile #Refresh environment variables to make it effective
lemon@ubuntu:~$ java -version#Enter java -version, if the following information is displayed, the JDK installation is successful
java version “1.8.0_191”
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
step1. Install MySQL and configure
step2. Create database and table
Since I chose to install the LAMP service when installing the Ubuntu system, MySQL has been installed and only needs to be set to enable it.
Test whether to install:
lemon@ubuntu:~$ mysql #Enter mysql, if the following prompt appears, it means that mysql has been installed
ERROR 1045 (28000): Access denied for user ‘lemon’@’localhost’ (using password: NO)
If not installed:
lemon@ubuntu:~$ sudo apt-get install mysql-server
lemon@ubuntu:~sudo apt isntall mysql-client lemon@ubuntu:~ sudo apt install libmysqlclient-dev
If installed:
lemon@ubuntu:~$ sudo mysql_secure_installation
Both will enter the MySQL setup process, the specific settings are as follows:
#1
VALIDATE PASSWORD PLUGIN can be used to test passwords…
Press y|Y for Yes, any other key for No: N (weak password check is not enabled)
#2
Please set the password for root here…
New password: (Set root password)
Re-enter new password: (repeat input)
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them…
Remove anonymous users? (Press y|Y for Yes, any other key for No): Y (Do not enable anonymous users)
#4
Normally, root should only be allowed to connect from
‘localhost’. This ensures that someone cannot guess at
the root password from the network…
Disallow root login remotely? (Press y|Y for Yes, any other key for No): Y (root login remotely is not allowed)
#5
By default, MySQL comes with a database named ‘test’ that
anyone can access…
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No): Y (Reload privilege tables now)
All done!
Next, enter MySQL for operation:
After the latest version of MySQL is installed, you cannot log in with a password. You need to log in with sudo to modify the login method.
lemon@ubuntu:~$ sudo mysql -uroot -p
Enter password: (empty password)
mysql>
mysql>UPDATE mysql.user SET authentication_string=PASSWORD(‘LEMON’), plugin=’mysql_native_password’ WHERE user=’root’;
mysql> FLUSH PRIVILEGES;
mysql>exit
lemon@ubuntu:~$ sudo service mysql restart
lemon@ubuntu:~$ mysql -u root -p
Enter password: (the password set in the previous step, PASSWORD in brackets)
mysql>CREATE DATABASE nutch;
mysql>USE nutch
mysql> CREATE TABLEwebpage
(
id
varchar(767) NOT NULL,
headers
blob,
text
mediumtext DEFAULT NULL,
status
int(11) DEFAULT NULL,
markers
blob,
parseStatus
blob,
modifiedTime
bigint(20) DEFAULT NULL,
score
float DEFAULT NULL,
typ
varchar(32) CHARACTER SET latin1 DEFAULT NULL,
baseUrl
varchar(767) DEFAULT NULL,
content
longblob,
title
varchar(2048) DEFAULT NULL,
reprUrl
varchar(767) DEFAULT NULL,
fetchInterval
int(11) DEFAULT NULL,
prevFetchTime
bigint(20) DEFAULT NULL,
inlinks
mediumblob,
prevSignature
blob,
outlinks
mediumblob,
fetchTime
bigint(20) DEFAULT NULL,
retriesSinceFetch
int(11) DEFAULT NULL,
protocolStatus
blob,
signature
blob,
metadata
blob,
batchId
varchar(767)DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED
DEFAULT CHARSET=utf8mb4;
mysql>exit
lemon@ubuntu:~$sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
Comment out bind-address = 127.0.0.1 and restart MySQL service
lemon@ubuntu:~$sudo service mysqld start
Then you can access the database on other computers through Navicat and other software.
That's Ok
Recommended Posts