一.準備階段html
個人環境爲 騰訊雲鏡像centos7.4 ,centos 內置 mariadb 須要先刪除java
#檢查是否安裝了 mariadb rpm -qa |grep mariadb #刪除mariadb rpm -e --nodeps mariadb-libs #進入/home 將安裝包下載或上傳的這個位置 cd /home
二.配置mysqlnode
#使用wget 下載yum源的rpm包 wget -c http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm #安裝rpm sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm #更新源 yum update #安裝 MySQL yum install mysql-server
#啓動服務
systemctl start mysqld.service
三.運行 MySQL 安全配置 mysql
#啓動MySQL
systemctl start mysqld
#運行MySQL安全配置
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): #輸入默認密碼(默認爲空,可直接回車) ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] y #是否設置新密碼 Y 設置 New password: #輸入兩次 Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! 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. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y #是否刪除匿名帳戶 Y ... Success! 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? [Y/n] n #不容許root帳戶遠程登錄嗎? ... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y #是否測試默認數據庫 - Dropping test database... ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist ... Failed! Not critical, keep moving... - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y #從新加載權限表 ... Success! All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! Cleaning up...
四.安裝JDK
#檢查 是否安裝了Java #查看版本 java -version #查看是否安裝了 Java rpm -qa |grep java 下載Java 官網 :http://www.oracle.com/technetwork/java/javase/overview/index.html ftp 上傳至 /home
#解壓至/opt目錄 tar zxvf jdk-10.0.2_linux-x64_bin.tar.gz -C /opt/ #修改環境變量 vim /etc/profile #在最下添加 export JAVA_HOME=/opt/jdk-10.0.2 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH #生效配置 source /etc/profile #驗證環境 java -version
五.安裝confluence 官網:https://www.atlassian.com/software/confluence
wget -c https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.10.2-x64.bin
#賦予權限 chmod +x atlassian-confluence-6.10.2-x64.bin #安裝confluence ./atlassian-confluence-6.10.2-x64.bin
#安裝過程 Unpacking JRE ... Starting Installer ... This will install Confluence 6.10.2 on your computer. OK [o, Enter], Cancel [c] #是否安裝 o Click Next to continue, or Cancel to exit Setup. Choose the appropriate installation or upgrade option. Please choose one of the following: # 安裝方式 Express Install (uses default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing Confluence installation [3] 1 See where Confluence will be installed and the settings that will be used. Installation Directory: /opt/atlassian/confluence Home Directory: /var/atlassian/application-data/confluence HTTP Port: 8090 RMI Port: 8000 Install as service: Yes #安裝端口 是否安裝 Install [i, Enter], Exit [e] i Extracting files ... Please wait a few moments while we configure Confluence. Installation of Confluence 6.10.2 is complete Start Confluence now? Yes [y, Enter], No [n] # 開始安裝 y Please wait a few moments while Confluence starts up. Launching Confluence ... Installation of Confluence 6.10.2 is complete Your installation of Confluence 6.10.2 is now ready and can be accessed via your browser. Confluence 6.10.2 can be accessed at http://localhost:8090 Finishing installation ... #安裝完成
安裝完成 ,開始配置confluence confluence 安裝成功自動啓動
1.輸入ip:8090 或 網址:8090,選擇安裝方式 我這裏選擇生產安裝,下一步
2.選擇附加組件 ,由於我沒有購買附加軟件的許可證 因此我直接下一步
3.輸入許可證,下一步
4.設置數據庫 ,我用的是我剛纔配置的MySQL 數據庫 因此我選擇我本身的數據庫linux
5.設置數據庫,這裏須要下載個插件 根據提示作就能夠了 ,而後測試鏈接 正確配置後 點擊下一步 開始自動配置數據庫 或者參考官方文檔 連接地址https://confluence.atlassian.com/doc/database-configuration-159764.html
開始自動配置數據庫,若是在這裏報錯 ,服務掛掉了,能夠試試 重啓下 服務 而後刪除爲confluence建立的數據庫 ,在重建的同名的數據庫 而後在訪問confluencesql
配置完成就能夠進入confluence了 ,若是遇到什麼問題,請在評論區留言,互相交流小提示:我在linux下配置confluence鏈接MySQL數據庫時,在鏈接數據庫成功點擊下一步進行設置數據庫時老是失敗,後來發現 個人linux系統裏沒有swap分區 ,而後我新建了一個交換分區 問題就神奇的解決了