yum默认链接的还是国外的镜像,速度相对不理想,配置成国内的镜像会快很多
首先进行更新:
yum update
base源
第一步:备份你的原镜像文件,以免出错后可以恢复。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
epel源
Epel 7
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
第三步:运行yum makecache生成缓存
yum clean all
yum makecache
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast && yum -y install docker-ce
-v ${HOME} 用户的主目录
MySQL 是最流行的开源关系型数据库。凭借其可靠性、易用性和性能,MySQL 已成为 Web 应用程序的数据库优先选择。
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
docker network rm test_link
docker network create test_link
docker run -d --name mariadb --net test_link --restart=always --privileged=true -v /root/docker/testlink_home/mariadb:/bitnami -e MARIADB_ROOT_PASSWORD=mariadb -e MARIADB_USER=bn_testlink -e MARIADB_PASSWORD=bn_testlink -e MARIADB_DATABASE=bitnami_testlink bitnami/mariadb
docker run -d -p 8280:8080 -p 8443:8443 --name testlink --net test_link --restart=always --privileged=true -v /root/docker/testlink_home/testlink:/bitnami -e TESTLINK_DATABASE_USER=bn_testlink -e TESTLINK_DATABASE_PASSWORD=bn_testlink -e TESTLINK_DATABASE_NAME=bitnami_testlink bitnami/testlink
浏览器内访问:http://你的IP地址:端口
user
,默认密码:bitnami
。yum install java
which java
ls -lr /usr/bin/java
ls -lrt /etc/alternatives/java
vim /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
source /etc/profile
echo $JAVA_HOME
which java
docker pull 16888888/jira:v1.0
docker pull 16888888/jira_mysql:v1.0
端口映射为宿主机8181端口映射jira容器8080端口,宿主机8182端口映射MySQL容器3306端口,有端口冲突更改容器端口映射:
docker start -it -d jira_mysql:v1.0
docker start -it -d jira:v1.0
docker pull atlassian/jira-software
mkdir -p /root/docker/jira_home
chmod 777 /root/docker/jira_home
docker network rm net_jira
docker network create net_jira
docker pull mysql:5.7
docker run -d -p 3307:3306 --name mysql_jira --privileged=true --net net_jira -v /var/lib/mysql:/var/lib/mysql -v /etc/mysql/conf.d:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
vim /etc/mysql/conf.d/my.cnf
[mysqld]
sql_mode = NO_AUTO_VALUE_ON_ZERO
innodb_file_format=Barracuda
innodb_large_prefix=ON
innodb_default_row_format=DYNAMIC
character_set_server=utf8mb4
collation-server = utf8mb4_unicode_ci
default-storage-engine=INNODB
docker restart mysql_jira
docker exec -it mysql_jira bash
mysql -u root -p
123456
alter user 'root'@'localhost' identified by '123456'; 使用root登录
show variables like '%default_storage_engine%';
show variables like '%character_set_server%';
show variables like '%innodb_default_row_format%';
show variables like '%innodb_large_prefix%';
show variables like '%innodb_file_format%';
show variables like '%innodb_log_file_size%';
show variables like '%sql_mode%';
drop database jiradb; 删除数据库
create database jiradb character set utf8mb4 collate utf8mb4_bin; 创建数据库
grant select,insert,update,delete,create,drop,alter,index on jiradb.* to 'root'@'42.192.73.147' identified by '123456';
show grants for root@42.192.73.147;
flush privileges; 授权
show databases; 查看所有数据库
docker run -d -p 8069:8080 --name jira --privileged=true --net host -v /var/atlassian/application-data/jira:/var/atlassian/application-data/jira atlassian/jira-software
### 配置数据库驱动
yum install wget
1. 下载驱动:
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.tar.gz
tar -zxf mysql-connector-java-8.0.25.tar.gz
2. 复制驱动到容器
docker cp mysql-connector-java-8.0.25/mysql-connector-java-8.0.25.jar jira:/opt/atlassian/jira/atlassian-jira/WEB-INF/lib/
docker cp mysql-connector-java-8.0.25/mysql-connector-java-8.0.25.jar jira:/opt/atlassian/jira/lib
3. 重启容器:
docker exec -it jira bash
chmod 777 /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/mysql-connector-java-8.0.25.jar
chmod 777 /opt/atlassian/jira/lib/mysql-connector-java-8.0.25.jar
exit
docker restart jira
docker run -d -p 3306:3306 --name mysql_jira --restart always --privileged=true -u root -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
docker run -d -p 8083:8083 -p 8086:8086 --name=influxdb1 --restart=always --privileged=true -u root --network grafana influxdb:1.7.10
docker run -d -p 8083:8083 -p 8086:8086 --name=influxdb1 --restart always --privileged=true -u root influxdb:1.7.10
curl -i -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE jmeter"
docker run -d -p 8080:8080 -p 50000:50000 --name jenkins1 --restart always --privileged=true -u root jenkins/jenkins
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。